Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Android / Tier 2 - Facebook errors

Author
Message
The Zoq2
14
Years of Service
User Offline
Joined: 4th Nov 2009
Location: Linköping, Sweden
Posted: 23rd Jun 2013 23:16
Once again I venture into the world of trying to compile my project for android. I followed the guide on the top of this page until the interpeter parts (which I don't have to care about since im using T2). From there I followed the guide on the community wiki.

However, when I import the facebook project into eclipse, I get 100 errors across diffirent files. All of them seem to be related to a missing R class. I have imported my own project with the names and .r class fixes but that didn't help either. Right now I have everything set up on my F: drive in a folder called AndroidNew. In there I have copied the whole IDE folder.

I have installed:
Version 22 of Android SDK Tools
Version 16.0.2 of Android SDK platform tools
Android 3.2(API13)
Android 2.3.1(API9)

There are some similar errors in my project but Eclipse dosn't show them unless I looking in the src files. I think I have fixed all the com.mytemplate.myapp lines.

However, in the Wiki step 10 says "Change ALL occurrences 'com.mycompany.mytemplate' to your package name, the same rules apply as for step 12 in iOS/Mac Project and Product Name changing above." Which to me seems missplaced since it comes after the strings.xml files which does not contain any com.... values. Aim I missing something there.

Im using 10813 and the templates included in the IDE folder. I also skipped the Armbei part of the Wiki guide since it looks like I already have some files in those folders. 1 .a file in each directory which are about 20 mb each.

Have I missed a step somewhere?
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 23rd Jun 2013 23:50
I just looked at the Wiki Templates page (as I happen to be the author of it).

About step 10....hmmm?

Either I meant there to be something different or it was a copy/paste error. But that line does look out of place. I removed it.

I haven't worked on the page for awhile. The last few betas have had basically functioning templates.

Did you mean armeabi? The only mention about those is that I had to split the download files. Since you are working with v10813, you shouldn't be downloading anything from the AppGameKit Wiki Templates page.

Quote: "
I followed the guide on the top of this page"

Huh? Do you mean the "Step by Step guide to creating a working .APK file." post?

I think that one needs to be redone fresh, but I am not the author of it.

It appears that your main problem is the missing 'R' errors. But you also appear to have tried working through the section on the Wiki page for fixing that. Did you note the bold comment "for versions starting with v10811 - do this BEFORE you import the project" in the instructions?

If you made your changes after importing the project, you need to delete it from Eclipse and then re-import it.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
The Zoq2
14
Years of Service
User Offline
Joined: 4th Nov 2009
Location: Linköping, Sweden
Posted: 24th Jun 2013 00:04
Quote: "Did you mean armeabi? The only mention about those is that I had to split the download files. Since you are working with v10813, you shouldn't be downloading anything from the AppGameKit Wiki Templates page."


Yep, I guess my assumptions where right then

Quote: "Huh? Do you mean the "Step by Step guide to creating a working .APK file." post?"


I did, I guess it may be a bit outdated, but I just used for the installation instructions.

Quote: "It appears that your main problem is the missing 'R' errors. But you also appear to have tried working through the section on the Wiki page for fixing that. Did you note the bold comment "for versions starting with v10811 - do this BEFORE you import the project" in the instructions?"


I did it before importing the project, if my memory isn't lying, I didn't change anything in my own project after importing it either.

The problems where all in the facebook project which had the errors from the beginning and as far as I understand, I shouldn't have to change anything in the facebook project?
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 24th Jun 2013 02:24
No, you should not have changed anything in the Facebook project.

Maybe, try delete everything in Eclipse; close Eclipse; delete the facebook directory and copy it over from the Windows installation; reopen Eclipse; import the Facebook project; import your project.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
The Zoq2
14
Years of Service
User Offline
Joined: 4th Nov 2009
Location: Linköping, Sweden
Posted: 25th Jun 2013 22:46
Because I have some traces of old android compilation stuff and other random crap on my main computer, I tried setting everything up on my ultrabook, it seems like doing that got rid of most of the problems. The facebook project does not seem to have any errors, however I get 2 errors in the template project.

The first error is global to the whole project and says "The project was not built since its build path is dincomplete. Can not find the class file for android.support.v4.app.Fragment. Fix the build path then try building this project.

The other one says "The type android.support.v4.app.Fragment cannot be resolved. It is indirectly referenced from required .class files.

The ultrabook is running windows 8 though
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 25th Jun 2013 23:29 Edited at: 25th Jun 2013 23:30
I know I have posted this fix at least two or three times.

But here it is again:
1. Open the Properties window for your project in Eclipse
2. Click on 'Java Build Path'
3. Click on 'Libraries' tab, if not already open
4. Click on 'Add External Jars...'
5. Select 'android-support-v4.jar' (<androidsdkpath>/extras/android/support/v4)
6. Click on 'Open' to pass it back
7. Click on 'OK' to finish adding it
8. (Belts and suspenders)Close Eclipse, restart it and refresh your project

EDIT: The first time I posted this fix is here.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
The Zoq2
14
Years of Service
User Offline
Joined: 4th Nov 2009
Location: Linköping, Sweden
Posted: 26th Jun 2013 11:16 Edited at: 26th Jun 2013 12:01
Guess I should have searched for the awnser then

Looks like I managed to compile the template and it is running on my device, now I just have to add my own code to it. Thanks for the help as allways.

Also, to get the extras library, you have to install it thru the SDK manager unless you have done that before. Just a note for anyone else trying to do this. I think I will add this to the template wiki because that has been the best source of information about this

Edit: Looks like im not out of the water yet, when I try to compile the app thru cygwin, it seems like none of the #includes for my own classes has worked.

This is the log.txt file:



And this is the template.h file which I believe is the problem



The first error I get says that it can't find the constructor/deconstructor for the Player class when I create the object "player".

This is the player class


All of the cpp / h files are in the jni directory which as far as I know is where I should put them. Have I done something wrong or is cygwin/gcc (im guessing GCC is the comiler we are using) more strict than visual studio when it comes to including things?
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 26th Jun 2013 15:29
Quote: "I think I will add this to the template wiki because that has been the best source of information about this"

Please don't. I am in the process of making the changes to that page now and will add the information about fixing for the fragments myself.

And the original AGK Guide does mention including the extras and that is where everyone should start when setting up environments.

The AppGameKit Wiki Template page was meant only for dealing with templates, not for the whole process.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
The Zoq2
14
Years of Service
User Offline
Joined: 4th Nov 2009
Location: Linköping, Sweden
Posted: 26th Jun 2013 15:33
Alright, makes sense...

Do you know what may be the problem with my broken include statments though, I can't seem to figgure it out
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 26th Jun 2013 15:34
As for your first set of errors, did you add your .cpp files to the <andproj>/jni/Android.mk file between Core.cpp and template.cpp? If not, that is your issue because you have to tell the compiler to build those files.

The second error is the same if you haven't include the file for the class implementation of your Player class in the Android.mk file.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
The Zoq2
14
Years of Service
User Offline
Joined: 4th Nov 2009
Location: Linköping, Sweden
Posted: 26th Jun 2013 15:51 Edited at: 26th Jun 2013 15:55
Quote: "As for your first set of errors, did you add your .cpp files to the <andproj>/jni/Android.mk file between Core.cpp and template.cpp? If not, that is your issue because you have to tell the compiler to build those files."


Looks like that solved the issue, thanks a lot for all your help
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 26th Jun 2013 16:54
No sweat.

Happy Programming!

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master

Login to post a reply

Server time is: 2024-03-28 20:10:06
Your offset time is: 2024-03-28 20:10:06