Problems getting started with Android and Flash

Monkey Forums/Monkey Programming/Problems getting started with Android and Flash

Gerry Quinn(Posted 2011) [#1]
Hi,

I finally got a new PC, a 64-bit laptop with Windows 7, and installed Monkey V45C. Previously I was using Windows XP and I had no problems getting Flash and Android targets operational. But on this I can only manage HTML5 and GLFW (it says XNA too but I don't have the Game Studio installed).

I installed all the various bits and bobs for Flash and Android and set the paths. Monkey recognises them and allows me to compile. But...

On Flash I get the error:
Building...
Error loading: C:\Program Files\Java\jdk1.6.0_26\jre\bin\server\jvm.dll
TRANS Failed to execute 'mxmlc -static-link-runtime-shared-libraries=true MonkeyGame.as', return code=6

(The file jvm.dll is certainly there.)

The Android emulator starts fine and the emulator runs. On this I got a different problem:

Buildfile: C:\Dev\Monkey\Current\frazzle\frazzle.build\android\build.xml
[setup] Android SDK Tools Revision 13
BUILD FAILED
C:\Dev\Monkey\Current\frazzle\frazzle.build\android\build.xml:65: Unable to resolve target 'android-8'

I have installed APIs 7 and 13, same as on my old PC. There is no 8 anywhere.

Anyone have a clue? I installed Android and Apache in Progeram Files (86) because they wanted that, and Flex and Java in Program Files, because they made no recommendations. Could this be an issue? I spell out the full paths explicitly in config.winnt.

Any help would be gratefully received!


benmc(Posted 2011) [#2]
For me, particularly your mxmlc error, I had to set the User-level system environment variables on Win7 to point to all the Java, Flex, ANT, and Android SDK folders I needed.

It seemed the winnt config file didn't use the paths I had set there. It's almost like they were ignored and things weren't being found.

In the Monkey targets folder for Android, can you edit the defalt.properties file and change the SDK from android-8 to something you have installed?


Gerry Quinn(Posted 2011) [#3]
Well, setting the user environment variables didn't work! Monkey refused to list any targets at all, even after I deleted the new environment variables and rebooted! I had to re-install Monkey. (It must be caching the variables or something.)

Setting the Android target in default.properties worked fine (once I remembered to delete the build folder). But it stopped later with a new error:

[aapt.exe] C:\Dev\Monkey\Current\frazzle\frazzle.build\android\AndroidManifest.xml:2: error: No resource identifier found for attribute 'installLocation' in package 'android'
BUILD FAILED

Actually I just noticed this earlier in the android build output:
[setup] WARNING: Attribute minSdkVersion in AndroidManifest.xml (3) is lower than the project target API level (7)

Anyone know how I fix this?

By the way, I added the environment variables to my User variables using Setx. Should I perhaps have added them to System variables instead?


benmc(Posted 2011) [#4]
I'm not sure what Setx is, but I just used the Windows 7 system tools. I had them in the System variables first, and then it only worked when I moved them to the Users variables.

Here are the folders I made sure to put in my User path. Of course I used their full path, but yours will be different than ours.

Note that I have everything installed on the root of my C-Drive or in a non Program Files folder.

\flex_sdk_4.5.1.21328\bin
\apache-ant-1.8.2-bin\apache-ant-1.8.2
\apache-ant-1.8.2-bin\apache-ant-1.8.2\bin


Gerry Quinn(Posted 2011) [#5]
Still no luck... I reinstalled Android and Java SDK, and I moved Flex and Ant as they didn't seem to have any uninstaller, to a non Program Files folder. I set the paths in config.winnt. I put the folders in the user path. With or without the user environment variables, I get the same errors as before. I even tried running Monkey in WinXP compatibility mode. Still the same.

I think I will file a bug report.


Gerry Quinn(Posted 2011) [#6]
Problems finally sorted in bug thread, thanks for the help!