About Monkey 2 › Forums › Monkey 2 Programming Help › Error running application on Android
Tagged: Android Build
This topic contains 17 replies, has 4 voices, and was last updated by
juliocmfj 1 year, 8 months ago.
-
AuthorPosts
-
August 18, 2017 at 9:21 pm #9903
Hello everyone.
I used BlitzMax for many years, but now the support for it has gone and it has been stopped in time.
I found Monkey 2, and I’m very interested in developing games for the Android platform, but… I have been able to configure to compile for Android, but at the time of running App, it presents the error that is in the attached image.
Can anyone help with this problem?
I love this language and I do not want to have to use Unity3D, because the best thing to do is to program “zero” things.
Thank you in advance for your attention.
Attachments:
August 19, 2017 at 12:58 am #9906What version of android does your device run? What version of monkey2 are you using?
There is a bug in one version of android that can cause libraries to fail to load if they are not loaded in correct dependancy order by the app. This has been fixed in more recent versions of monkey2 though. I recommend trying monkey2 v.1.1.06 if your not already. Otherwise, we have a problem!
August 19, 2017 at 1:41 am #9907Good night Mark. I am using version 1.1.05 of Monkey 2 and I have Android 7.1 in the mobile and the 5 in the emulator.
This error occurs both in the mobile phone and in the emulator.
Any tips on how to solve?
August 19, 2017 at 2:07 am #9908Please try monkey2 v1.1.06, available from blitzresearch.itch.io
August 19, 2017 at 6:12 am #9911I typed the version wrong. I’m using 1.1.06
August 19, 2017 at 6:38 am #9912Have you updated to latest Android Studio, NDK etc?
Everything works fine here on both my nvidia shield and the emulator.
How have you configured the emulator?
Can you perhaps send me a zip of the Android Studio project somehow?
August 19, 2017 at 6:54 am #9913Android SDK and NDK are up to date. I’ve already compiled the Monkey 2 modules for Android as well.
I have attached the configuration file of Monkey 2. It can be some error in this file…
I do not know what else to do.
Attachments:
August 19, 2017 at 7:10 am #9915I just tried the PromptInvasion banana on an x86 emulator running lollipop (api 21) again and all is still fine here.
I’ve posted the ‘view details’ output from the virtual device manager below. You could perhaps try to create an identical virtual device and run PromptInvasion on it.
Also, your env_windows.txt file has MX2_ANDROID_APP_PLATFORM=20 which looks unusual and is not what I have here (android-14). Any reason you changed this? Have you tried MX2_ANDROID_APP_PLATFORM=android-14? you’ll need to rebuild all modules etc, and delete any .products files.
And that’s me about out of ideas, sorry.
Emulator details (mostly default settings):
Monkey12345678910111213141516171819202122232425262728293031323334353637383940414243Name: Nexus_5X_API_21CPU/ABI: Intel Atom (x86)Path: D:\devtools\Android\.android\avd\Nexus_5X_API_21.avdTarget: default [] (API level 21)Skin: nexus_5xSD Card: 100Mhw.dPad: noruntime.network.speed: fullhw.accelerometer: yeshw.device.name: Nexus 5Xvm.heapSize: 256skin.dynamic: yeshw.device.manufacturer: Googlehw.gps: yeshw.initialOrientation: Portraitimage.androidVersion.api: 21hw.audioInput: yesimage.sysdir.1: system-images\android-21\default\x86\tag.id: defaultshowDeviceFrame: yeshw.camera.back: emulatedhw.mainKeys: noAvdId: Nexus_5X_API_21hw.camera.front: emulatedhw.lcd.density: 420avd.ini.displayname: Nexus 5X API 21hw.gpu.mode: autohw.device.hash2: MD5:1be89bc42ec9644d4b77968b23474980hw.ramSize: 1536hw.trackBall: noPlayStore.enabled: falsehw.battery: yeshw.cpu.ncore: 2hw.sdCard: yestag.display:runtime.network.latency: nonehw.keyboard: yeshw.sensors.proximity: yesdisk.dataPartition.size: 800Mhw.sensors.orientation: yesavd.ini.encoding: UTF-8hw.gpu.enabled: yesAugust 19, 2017 at 7:22 am #9916I am recompiling the modules following your prompt. As soon I’m done here, I’ll give you this test. And again, thank you so much for your attention. Great developer feedback.
August 19, 2017 at 8:37 am #9920Hey Mark!!!! It worked the way you did. Thank you one more time.
Just one last question: Can I only generate the APK by opening the project through Android Studio? Is not there a way to generate the same direct through the Monkey 2 IDE?
August 19, 2017 at 2:18 pm #9922There is an article how to build .apk from command line – just setup .bat file and use it in a one click.
https://www.apriorit.com/dev-blog/233-how-to-build-apk-file-from-command-line
August 19, 2017 at 7:28 pm #9925Thank you nerobot.
I’ll now take a look at this article, and then study Monkey 2, because there’s a lot of difference in structure and code between it and BlitzMax.
August 20, 2017 at 12:58 am #9931So the fix was the setting MX2_ANDROID_APP_PLATFORM=android-14?
August 20, 2017 at 1:14 am #9933Yes. This simple change solved all my problems regarding build for Android.
To generate APK without opening Android Studio, justo go to the folder: yourProject.products\Android, open the Windows console in this folder and use the following command: gradlew build. It will do the whole process and in the end, it will generate two APK’s: a DEBUG version and another RELEASE.
After this process, if you want to generate only one APK DEBUG, the code is: gradlew assembleDebug. For APK RELEASE: gradlew assembleRelease.
I hope I have helped.
August 20, 2017 at 5:00 am #9935Fix: to compile for Android, you need to load the project at least once in Android Studio so that Gradle can be upgraded, and in the following you can use the commands mentioned above.
-
AuthorPosts
You must be logged in to reply to this topic.
