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 / Compile for Android Error

Author
Message
easter bunny
7
Years of Service
User Offline
Joined: 20th Nov 2012
Playing: Dota 2
Posted: 14th Jan 2013 05:22
I've gone through Daniel TGC's Video tut, and when I get up to the Compiling bit with Eclipse, The Video says there should be one error, which can be fixed with Android Tools>Fix Project Properties
But I have 4 errors:

Error1:
Error: String types not allowed (at 'configChanges' with value 'keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize'). AndroidManifest.xml /[myappname] line 44 Android AAPT Problem

Error2:
[Ditto] at line 61

Error3:
Project '[myappname]' is missing required library: 'libs/gcm.jar' [myappname] Build path Build Path Problem

Error4:
The project cannot be built until build path errors are resolved [myappname] Unknown Java Problem

Can anyone help me?
Sorry if the errors are hard to read here
and

There are 10 types of people, those who understand binary and those who don't
Ancient Lady
Valued Member
15
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 14th Jan 2013 16:08
What version of AppGameKit are you working with?

Are you using Tier 1 or Tier 2?

For the first two errors, edit the AndroidManifest.xml file and remove 'screenSize|smallestScreenSize' from both places.

Did you do the clean and build in Cygwin?

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
easter bunny
7
Years of Service
User Offline
Joined: 20th Nov 2012
Playing: Dota 2
Posted: 14th Jan 2013 23:30 Edited at: 14th Jan 2013 23:37
I use Tier 1, with AppGameKit 1.08 BETA4, i cleaned and built it with cygwin as well.
I fixed the AndroidManifest.xml, that worked fine
now it just has:
Project '[MyAppName]' is missing required library: 'libs/gcm.jar' [MyAppName] Build path Build Path Problem

There are 10 types of people, those who understand binary and those who don't
Ancient Lady
Valued Member
15
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 15th Jan 2013 16:32
Did you copy your android IDE directory from a fresh v1084 install?

You might be best off installing v1088, it has many fixes and the required gcm.jar file is in the <android>/AGK/IDE/apps/interpreter_android/libs directory.

It sounds painful, but you will want to upgrade anyway. Just make sure to copy over all the android stuff (and core interpreter) in the IDE directory to make sure you have all the new things, and there are a bunch.

You will then need to update your AndroidManifest.xml files again.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
easter bunny
7
Years of Service
User Offline
Joined: 20th Nov 2012
Playing: Dota 2
Posted: 15th Jan 2013 23:41
ok, ill try that right now

There are 10 types of people, those who understand binary and those who don't
easter bunny
7
Years of Service
User Offline
Joined: 20th Nov 2012
Playing: Dota 2
Posted: 16th Jan 2013 02:44
Good new and Bad news:
Good news is, upgrading to v1.08beta8 fixed the problem.
Bad news is, now there's 38 more errors
most of the errors are in MyFacebookActivity.java, things like 'Session cannot be resolved to a type'

just looking over the error, all of them have something to do with Facebook, except 3 error in IMarketBillingService.java

Anyone have an idea what went wrong?

There are 10 types of people, those who understand binary and those who don't
easter bunny
7
Years of Service
User Offline
Joined: 20th Nov 2012
Playing: Dota 2
Posted: 16th Jan 2013 02:50 Edited at: 16th Jan 2013 02:54
I just copied the facebook folder from C:/programfiles/thegamecreators/agk88/ide/apps to C:/Android/AGK/IDE/apps/ and used fix project propeties, and that got rid of all the facebook related errors, but i still have 3 new ones:

The method asBinder() of type IMarketBillingService.Stub must override a superclass method Resource:IMarketBillingService.java

The method asBinder() of type IMarketBillingService.Stub.Proxy must override a superclass method Resource:IMarketBillingService.java

The method sendBillingRequest(Bundle) of type IMarketBillingService.Stub.Proxy must override a superclass method Resource:IMarketBillingService.java

edit: I also have 30 warnings, most of them saying that i have unused imports

There are 10 types of people, those who understand binary and those who don't
easter bunny
7
Years of Service
User Offline
Joined: 20th Nov 2012
Playing: Dota 2
Posted: 16th Jan 2013 03:15
Fixed.... sort of.
I manged to get this problem sorted, I works fine when the package is name com.thegamecreators.agk_player, but when I rename the package, it comes up with 2 errors,
Description Resource Path Location Type
R cannot be resolved to a variable IAPActivity.java /AGK Player/src/com/thegamecreators/agk_player line 162 Java Problem
R cannot be resolved to a variable MyFacebookActivity.java /AGK Player/src/com/thegamecreators/agk_player line 30 Java Problem

There are 10 types of people, those who understand binary and those who don't
Ancient Lady
Valued Member
15
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 16th Jan 2013 16:00
I just updated some instructions on the AGK Wiki Template page that relate to the issue you are having.

Under the "Android Project and Product Name:" section, steps 8-9 (with reference to step 7) show how to fix the 'R cannot be resolved' issue.

I have not posted a v1088 template yet because it doesn't quite work right.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
easter bunny
7
Years of Service
User Offline
Joined: 20th Nov 2012
Playing: Dota 2
Posted: 17th Jan 2013 01:40 Edited at: 17th Jan 2013 05:46
I've now got it to compile, but when I run the apk in an emulator (blue stacks), It just comes up with a black screen

edit: if I run it on my phone(Sony Xperia S), it also just comes up with a black screen

There are 10 types of people, those who understand binary and those who don't
Ancient Lady
Valued Member
15
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 17th Jan 2013 16:09 Edited at: 17th Jan 2013 16:15
The Eclipse emulator doesn't work.

Did the app work in Windows?

What directory did you put your media in?

How are you referencing the media in your app? Are you sure that the case is exactly the same as the actual files?

EDIT:

And do you have the agk::Sync() command as the last command in the app::Loop() method?

And are you using any loops anywhere waiting for user input?

EDIT:
Did you edit the IDE/app/interpreter/interpreter.cpp file to uncomment the correct line to use the bytecode.byc file?

The correct one in v1088 is on line 260.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
easter bunny
7
Years of Service
User Offline
Joined: 20th Nov 2012
Playing: Dota 2
Posted: 18th Jan 2013 00:23
The app works in windows,
I put the media in assets/[mymedia]
so its assets/bytecode.byc to get the bytecode file
The case is the same for all the files
Sync() is the last command of the loop
strcpy ( g_pInterpreterByteCodeFile, "bytecode.byc" ); // comment in for T1 BASIC APP at line 260 is UNcommented

btw: I have subdirectories in the assets folder for some of the files (it might use bak1img = LoadImage("backrounds/backround1.png")
is that ok?

There are 10 types of people, those who understand binary and those who don't
easter bunny
7
Years of Service
User Offline
Joined: 20th Nov 2012
Playing: Dota 2
Posted: 18th Jan 2013 00:53 Edited at: 18th Jan 2013 02:19
Here is exactly what i did, step by step.
1. duplicate C:\Android\AGK\IDE\apps\interpreter_android
2. rename it C:\Android\AGK\IDE\apps\test
3. open C:\Android\AGK\IDE\apps\test\.project with Notepad++
4. change <name>AGK Player</name> on line 3 to <name>test</name>
5. save C:\Android\AGK\IDE\apps\test\.project
6. open C:\Android\AGK\IDE\apps\test\AndroidManifest.xml
7. change android:versionName="1.0.1083" package="com.thegamecreators.agk_player"> on line 4 to android:versionName="1.0.1083" package="com.thegamecreators.test"> (as im not uplaoding it, its ok to leave it the same isn't it?)
8. save it
9. open C:\Android\AGK\IDE\apps\test\res\values\strings.xml with notepad++
10. change <string name="app_name">AGK Player</string> on line 3 to <string name="app_name">test</string>
11. make sure line 260 in C:\Android\AGK\IDE\apps\interpreter\interpreter.cpp is NOT commented
12. open C:\Android\AGK\IDE\apps\test\HardCodedCompileScript.bat
13. change lines 2 and 3 to:
C:\Android\cygwin\bin\bash -c "PATH=/bin:$PATH /cygdrive/c/android/android-ndk-r6b/ndk-build clean"
C:\Android\cygwin\bin\bash -c "PATH=/bin:$PATH /cygdrive/c/android/android-ndk-r6b/ndk-build 2> log.txt"
14. save and run HardCodedCompileScript.bat
15. import the project into Eclipse
16. use project>Clean
note. there are no errors at the moment
17. make a small program in agk

18. compile it
19. copy its .byc file into C:\Android\AGK\IDE\apps\test\assets
20. rename it bytecode.byc
21. use project>Clean
note. there are still no errors at the moment
22. use run>run
23. select Android Application
24. Close Android Device Chooser
25. the resulting test.apk is now in C:\Android\AGK\IDE\apps\test\bin
26. test.apk doesn't work, its just has a blank screen

Note: I have already done a small amount of 'patch work' on interpreter_android, I modified |screenSize|smallestScreenSize error and MyFacebookActivity.java and IAPActivity.java from the page you referred me to before

There are 10 types of people, those who understand binary and those who don't
Ancient Lady
Valued Member
15
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 18th Jan 2013 16:16
There are some additional steps, just added, for v1085+ on the wiki page.

I'm working with Paul to get something working. My Tier 2 template produces the same blank page. The LogCat displayed in Eclipse (my Nexus 7 is connected directly) shows that there is some problem with the display. This may be the same issue you are having.

I haven't tried the Tier 1 Android build for 108 beta anything, yet.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
easter bunny
7
Years of Service
User Offline
Joined: 20th Nov 2012
Playing: Dota 2
Posted: 19th Jan 2013 00:21
YESSSSSSS, I figured out the problem (with the black screen), I had all the media, including bytecode.byc, in [project]/assets/ BUT, they have to be in [project]/assets/MEDIA/[media including bytecode.byc]. No wonder it wasn't working!
Thank you for all your help with the compile problems, maybe someone else will learn from my mistake. My app should be published on the Play Store very soon.

There are 10 types of people, those who understand binary and those who don't

Login to post a reply

Server time is: 2019-12-13 15:19:09
Your offset time is: 2019-12-13 15:19:09