Unable to compile on Android!

Monkey Targets Forums/Android/Unable to compile on Android!

visionastral(Posted 2011) [#1]
Hello!
I have installed Ant 1.8, the android SDK, Java SDK, eclipse and have configurated it for android via the Android plugin. (I'm on win7 64bits)
Everything seems fine, but when I try to compile in monkey to android, I'm having this:

Translating basicgame
C:/Monkey/bin/trans_winnt -target=android -run C:/Monkey/bananas/hitoro/basicgame/basicgame.monkey

TRANS monkey compiler V1.20
Parsing...
Semanting...
Translating...
Building...
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
Buildfile: C:\Monkey\bananas\hitoro\basicgame\basicgame.build\android\build.xml
[setup] Android SDK Tools Revision 11
[setup] Project Target: Android 2.2
[setup] API level: 8
[setup]
[setup] ------------------
[setup] Resolving library dependencies:
[setup] No library dependencies.
[setup]
[setup] ------------------
[setup]
[setup] WARNING: Attribute minSdkVersion in AndroidManifest.xml (3) is lower than the project target API level (8)
[setup]
[setup] Importing rules file: tools\ant\main_rules.xml

clean:

BUILD SUCCESSFUL
Total time: 0 seconds
Buildfile: C:\Monkey\bananas\hitoro\basicgame\basicgame.build\android\build.xml
[setup] Android SDK Tools Revision 11
[setup] Project Target: Android 2.2
[setup] API level: 8
[setup]
[setup] ------------------
[setup] Resolving library dependencies:
[setup] No library dependencies.
[setup]
[setup] ------------------
[setup]
[setup] WARNING: Attribute minSdkVersion in AndroidManifest.xml (3) is lower than the project target API level (8)
[setup]
[setup] Importing rules file: tools\ant\main_rules.xml

-debug-obfuscation-check:

-set-debug-mode:

-compile-tested-if-test:

-pre-build:

-dirs:
[echo] Creating output directories if needed...
[mkdir] Created dir: C:\Monkey\bananas\hitoro\basicgame\basicgame.build\android\bin
[mkdir] Created dir: C:\Monkey\bananas\hitoro\basicgame\basicgame.build\android\gen
[mkdir] Created dir: C:\Monkey\bananas\hitoro\basicgame\basicgame.build\android\bin\classes

-aidl:
[echo] Compiling aidl files into Java classes...

-renderscript:
[echo] Compiling RenderScript files into Java classes and RenderScript bytecode...

-resource-src:
[echo] Generating R.java / Manifest.java from the resources...

-pre-compile:

compile:
[javac] C:\Program Files (x86)\Android\android-sdk\tools\ant\main_rules.xml:384: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds
[javac] Compiling 2 source files to C:\Monkey\bananas\hitoro\basicgame\basicgame.build\android\bin\classes
[javac] Note: C:\Monkey\bananas\hitoro\basicgame\basicgame.build\android\src\com\monkey\MonkeyGame.java uses unchecked or unsafe operations.
[javac] Note: Recompile with -Xlint:unchecked for details.

-post-compile:

-obfuscate:

-dex:
[echo] Converting compiled files and external libraries into C:\Monkey\bananas\hitoro\basicgame\basicgame.build\android\bin\classes.dex...

-package-resources:
[echo] Packaging resources
[aapt] Creating full resource package...

-package-debug-sign:
[apkbuilder] Creating MonkeyGame-debug-unaligned.apk and signing it with a debug key...

debug:
[echo] Running zip align on final apk...
[echo] Debug Package: C:\Monkey\bananas\hitoro\basicgame\basicgame.build\android\bin\MonkeyGame-debug.apk

install:
[echo] Installing C:\Monkey\bananas\hitoro\basicgame\basicgame.build\android\bin\MonkeyGame-debug.apk onto default emulator or device...
[exec] error: device not found
BUILD FAILED
C:\Program Files (x86)\Android\android-sdk\tools\ant\main_rules.xml:639: The following error occurred while executing this line:
C:\Program Files (x86)\Android\android-sdk\tools\ant\main_rules.xml:271: exec returned: 1
Total time: 4 seconds
Android build failed.

Process Complete


Can anybody help me?
What am I doing wrong?


TeaBoy(Posted 2011) [#2]
install:
[echo] Installing C:\Monkey\bananas\hitoro\basicgame\basicgame.build\android
\bin\MonkeyGame-debug.apk onto default emulator or device...
[exec] error: device not found


Is your emulator running?

Your emulator probably hasn't fully loaded or is running too slow.

Can you try running via your android phone (if you have one).


visionastral(Posted 2011) [#3]
mmm... how can I run the android emulator? :P
Runing the emulator.exe in the sdk/tools folder doesn't do anything...
(sorry, I have really no experience with the android SDK at all)

I do have an htc hero android phone, but I can't test it right now...
I was just seting up monkey and all the SDKs and checking all was installed correctly.
I will have to try with the phone connected.

Can you please give me some advice about running the emulator?


Volker(Posted 2011) [#4]
Start the SDK Manager. Create a new virtual device
with your needed settings. Start the VD.
Wait a very long time until it's started...
Rebuild your project with monkey.
VD should be detected and your app start running.


visionastral(Posted 2011) [#5]
Thank you very much! I'll check this tomorrow!


visionastral(Posted 2011) [#6]
Hey! that worked!
I needed the ADB drivers for my phone to be recognised and connect it via usb using the HTC SYNC option in the phone, otherwise it just ignores the phone.
Both the emulator and the phone are working now!
Thank you very much for your help!