Error running application on Android

About Monkey 2 Forums Monkey 2 Programming Help Error running application on Android

Tagged: 

This topic contains 17 replies, has 4 voices, and was last updated by  juliocmfj 1 year, 8 months ago.

Viewing 15 posts - 1 through 15 (of 18 total)
  • Author
    Posts
  • #9903

    juliocmfj
    Participant

    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.

    #9906

    Mark Sibly
    Keymaster

    What 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!

    #9907

    juliocmfj
    Participant

    Good 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?

    #9908

    Mark Sibly
    Keymaster

    Please try monkey2 v1.1.06, available from blitzresearch.itch.io

    #9911

    juliocmfj
    Participant

    I typed the version wrong. I’m using 1.1.06

    #9912

    Mark Sibly
    Keymaster

    Have 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?

    #9913

    juliocmfj
    Participant

    Android 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:
    1. env_windows.txt
    #9915

    Mark Sibly
    Keymaster

    I 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):

    #9916

    juliocmfj
    Participant

    I 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.

    #9920

    juliocmfj
    Participant

    Hey 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?

    #9922

    nerobot
    Participant

    There 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

    #9925

    juliocmfj
    Participant

    Thank 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.

    #9931

    therevills
    Participant

    So the fix was the setting MX2_ANDROID_APP_PLATFORM=android-14?

    #9933

    juliocmfj
    Participant

    Yes. 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.

    #9935

    juliocmfj
    Participant

    Fix: 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.

Viewing 15 posts - 1 through 15 (of 18 total)

You must be logged in to reply to this topic.