Android target is not built

About Monkey 2 Forums Monkey 2 Development Android target is not built

This topic contains 1 reply, has 1 voice, and was last updated by  ArtemKuchin 2 years, 5 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #5199

    ArtemKuchin
    Participant

    Just installed latest Monkey2 + android studio + NDK.

    NDK example from android studio build fine.

    Then i changes path to NDK and rebuilt all modules. Not problem.

     

    Then i open rendertoimage example and try to build it for android.

    Result:

    Mx2cc version 1.1.01

    ***** Building app ‘C:/Monkey2-v1.1.01/bananas/rendertoimage/rendertoimage.monkey2’ *****

    Parsing…
    Semanting…
    Translating…
    Compiling…
    [armeabi-v7a] Compile++ thumb: mx2_main <= rendertoimage_rendertoimage.cpp
    [armeabi-v7a] SharedLibrary  : libmx2_main.so
    [armeabi-v7a] Install        : libmx2_main.so => libs/armeabi-v7a/libmx2_main.so
    [armeabi-v7a] Install        : libopenal.so => libs/armeabi-v7a/libopenal.so
    Application built:

    Done.

     

    And no apk in  bananas\rendertoimage\rendertoimage.products\Android

    What am i doing wrong?

     

    If it is important then

    running gradlew.bat  manually gives

    C:\Monkey2-v1.1.01\bananas\rendertoimage\rendertoimage.products\Android>”C:\Program Files\Java\jdk1.8.0/bin/java.exe”    “-Dorg.gradle.appname
    =gradlew” -classpath “C:\Monkey2-v1.1.01\bananas\rendertoimage\rendertoimage.products\Android\\gradle\wrapper\gradle-wrapper.jar” org.gradle.w
    rapper.GradleWrapperMain
    Error: Could not find or load main class org.gradle.wrapper.GradleWrapperMain

     

    But there is no directory \rendertoimage\rendertoimage.products\Android\\gradle\

    how gradle should get there?

    I copied gradle there then i get

    C:\Monkey2-v1.1.01\bananas\rendertoimage\rendertoimage.products\Android>”C:\Program Files\Java\jdk1.8.0/bin/java.exe”    “-Dorg.gradle.appname
    =gradlew” -classpath “C:\Monkey2-v1.1.01\bananas\rendertoimage\rendertoimage.products\Android\\gradle\wrapper\gradle-wrapper.jar” org.gradle.w
    rapper.GradleWrapperMain

    FAILURE: Build failed with an exception.

    * Where:
    Build file ‘C:\Monkey2-v1.1.01\bananas\rendertoimage\rendertoimage.products\Android\build.gradle’ line: 5

    * What went wrong:
    A problem occurred evaluating root project ‘Android’.
    > Could not find method jcenter() for arguments [] on repository container.

    * Try:
    Run with –stacktrace option to get the stack trace. Run with –info or –debug option to get more log output.

    BUILD FAILED

     

    after some experimenting with version of gradle and plugin I managed to get it past this and now i get

     

    C:\Monkey2-v1.1.01\bananas\rendertoimage\rendertoimage.products\Android>”C:\Program Files\Java\jdk1.8.0/bin/java.exe”    “-Dorg.gradle.appname
    =gradlew” -classpath “C:\Monkey2-v1.1.01\bananas\rendertoimage\rendertoimage.products\Android\\gradle\wrapper\gradle-wrapper.jar” org.gradle.w
    rapper.GradleWrapperMain

    FAILURE: Build failed with an exception.

    * What went wrong:
    A problem occurred configuring project ‘:app’.
    > SDK location not found. Define location with sdk.dir in the local.properties file or with an ANDROID_HOME environment variable.

     

    I added local.properties  and now i get

     

    Ran lint on variant release: 29 issues found
    Ran lint on variant debug: 29 issues found
    Wrote HTML report to file:///C:/Monkey2-v1.1.01/bananas/rendertoimage/rendertoimage.products/Android/app/build/outputs/lint-results-debug.html

    Wrote XML report to file:///C:/Monkey2-v1.1.01/bananas/rendertoimage/rendertoimage.products/Android/app/build/outputs/lint-results-debug.xml
    :app:lint FAILED

    FAILURE: Build failed with an exception.

    * What went wrong:
    Execution failed for task ‘:app:lint’.
    > Lint found errors in the project; aborting build.

    Fix the issues identified by lint, or add the following to your build script to proceed with errors:

    android {
    lintOptions {
    abortOnError false
    }
    }

     

    But i get APK and it work on my phone.

     

    Is building for android supposed to be so manual or i am missing something?

    #5203

    ArtemKuchin
    Participant

    And final. The error was about min SDK version. The default gradle.build has level 10, while some calls are from level 12. I put level 12 into  min version and now it build without error. But still. very very manual.

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.