Android Build Failed?

Monkey Targets Forums/Android/Android Build Failed?

QuickSilva(Posted 2011) [#1]
Finally (!!!) managed to get Android target to appear but now I cannot build my Android app. I`m starting to go a little mad now I think. Why do things have to be so hard?

Here`s what I`m getting. Any ideas as to what the problem may be?

Thanks for any help.
Jason.

Translating Game
"C:/Program Files (x86)/Monkey/bin/trans_winnt" -target=android -run C:/Users/Jason/Desktop/Game/Game.monkey

TRANS monkey compiler V1.17
Parsing...
Semanting...
Translating...
Building...
Buildfile: C:\Users\Jason\Desktop\Game\Game.build\android\build.xml
    [setup] Android SDK Tools Revision 12
BUILD FAILED
C:\Users\Jason\Desktop\Game\Game.build\android\build.xml:65: Unable to resolve target 'android-8'
Total time: 0 seconds
Android build failed.

Process Complete



TeaBoy(Posted 2011) [#2]
Hmm... have you tried deleting the build directory of your project and trying again? you could always try updating the SDK too, it may rectify the problem.


GfK(Posted 2011) [#3]
Wrong path to the android SDK would be my first port of call. I'm sure when I installed it, it did not install it where I told it to; I wanted it at c:\android but instead it went to c:\Program Files\Android\android.


QuickSilva(Posted 2011) [#4]
Deleting build directory did not work. Checked the path thoroughly and it appears to be correct (Android wouldn`t show up as target would it if it were wrong?)

After Goggling a bit more I found this about the error message,

Unable to resolve target 'android-8' means you need to install SDK Platform Android 2.2

As I have only installed SDK Platform Android 2.1 maybe this is the problem? Will give it a try.

Are you guys using higher than 2.1? (I used this as it said in the docs to install at least 2.1)

Thanks for answering so speedily by the way, most appreciated.

Jason.


GfK(Posted 2011) [#5]
I installed everything from Android 2.1 upwards. Weibo has a useful guide somewhere to getting the android target up and running.

[edit] https://wiebo.wordpress.com/2011/05/08/how-to-monkey-and-android-development-setup/


TeaBoy(Posted 2011) [#6]
yes, android-8 is 2.2, which is why I suggested updating your SDK *hint hint* ;o)

happy to help!


QuickSilva(Posted 2011) [#7]
OK, that worked. My Android game now runs on the emulator but I have no graphics. I can hear my music playing though so I know that my app is running. What could be causing this?

BTW, I`m sorry for all of these questions, I think I posted more on the Monkey forums about simply setting the targets up than I have for ages on the Blitz forums. It is actually quite frustrating.

Jason.


dave.h(Posted 2011) [#8]
is your cls command in the right place ive put this in after ive drawn my screen and all you get is a blank screen


QuickSilva(Posted 2011) [#9]
Hi dave.h. I do not have a cls in my drawing loop as I am drawing a background already so it is not needed.

My game is also working properly in all other targets with no rendering issues. I haven`t a clue as to what could be causing this???

Jason.


dave.h(Posted 2011) [#10]
i had a prob when i first started with android and i didnt include a cls function as i was creating an art drawing program.I never got it to work as for some reason it kept clearing the screen even though there was no cls function in it.I never figured out why and it might even have been corrected in the newer vesions of monkey as ive not tested.If its not a large program you would probably have more luck if you posted some code.


QuickSilva(Posted 2011) [#11]
Hi dave.h,

You are correct. For some reason you do need a Cls in your render loop even if you are drawing a background yourself. It doesn`t seem to cause any problems for the other targets, just Android. I`m sure that there is a good reason for this. I always thought that if you are drawing the background yourself then it was wasteful to include a Cls too.

Maybe someone can explain why this is?

Jason.

Edit:
Upon further testing you do not need a Cls in your drawing loop on Android. I have no idea why I was getting the black screen before but it now seems to work fine.