Building v1.6.1 with Android Studio Fail

Hi there,

Anyone manage to build a v1.6.1 creator project with Android Studio? I got this error.

FAILURE: Build failed with an exception.

* Where:
Build file '/../myProject/build/jsb-binary/frameworks/runtime-
src/proj.android-studio/app/build.gradle' line: 140

* What went wrong:
A problem occurred configuring project ':myProject'.
> Could not get unknown property 'externalNativeBuildRelease' for project 
':myProject' of type org.gradle.api.Project.

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

BUILD FAILED
1 Like

@slackmoehrle help please

Deleting “externalNativeBuildRelease” part in build.gradle helped me to build normally. Please try.

What did you remove in exact? Could you share it?

These lines:

externalNativeBuildRelease.doLast {
    println ('Copying release .so')
    copySo()
}

I tried your way it doesn’t work. App will crash upon launch. Mind explaining what does removing those lines do?

App crash upon launch means build succeed? Can you show the device log on crash? For me, the first time running always crash but the second time is ok (without any change)

ActivityManager: Start proc 11671:com.helloworld/u0a711 for activity com.helloworld/org.cocos2dx.javascript.AppActivity

AndroidRuntime: java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.helloworld/org.cocos2dx.javascript.AppActivity}: java.lang.ClassNotFoundException: Didn’t find class “org.cocos2dx.javascript.AppActivity” on path: DexPathList[[zip file “/data/app/com.helloworld-1/base.apk”],nativeLibraryDirectories=[/data/app/com.helloworld-1/lib/arm, /data/app/com.helloworld-1/base.apk!/lib/armeabi-v7a, /vendor/lib, /system/lib]]

AndroidRuntime: Caused by: java.lang.ClassNotFoundException: Didn’t find class “org.cocos2dx.javascript.AppActivity” on path: DexPathList[[zip file “/data/app/com.helloworld-1/base.apk”],nativeLibraryDirectories=[/data/app/com.helloworld-1/lib/arm, /data/app/com.helloworld-1/base.apk!/lib/armeabi-v7a, /vendor/lib, /system/lib]]

AndroidRuntime: Suppressed: java.lang.ClassNotFoundException: org.cocos2dx.javascript.AppActivity
09-06 17:10:01.931 1689 3415 W ActivityManager: Force finishing activity com.helloworld/org.cocos2dx.javascript.AppActivity

Did you upgrade your project from older version? Or created new project from CC 1.6.1? Be sure you have org.cocos2dx.javascript.AppActivity in project.

Found commit that fix this issue, in case anyone is interested:

2 Likes