Status Update
Comments
as...@google.com <as...@google.com>
as...@google.com <as...@google.com> #2
Hi, was this a regression after you upgrade your NDK or upgrade your Android Studio?
as...@google.com <as...@google.com> #3
Neither of them. There were no change to AS (4.1-RC1) nor NDK versions.
I just changed my old scripts in build.gradle to the android recommended method i.e.
externalNativeBuild { ndkBuild { path file('jni/Android.mk') } }
If I reverted the change to my old script, everything is working again. The old scripts uses
ndk.dir=/opt/android/android-sdk/ndk-bundle
as defined in local.properties file
The source.properties files indicate the version as:
Pkg.Desc = Android NDK Pkg.Revision = 21.3.6528147
al...@google.com <al...@google.com> #4
Hi, the problem is that when Android Gradle Plugin executes ndk-build, it is missing the '-C' + projectDir + '/jni'
part in your custom task. Therefore, the current working directory is the module root (parent of the jni
directory). Hence the error.
The fix is to add the following to your build.gradle
android {
...
defaultConfig {
...
externalNativeBuild {
ndkBuild {
arguments "-Cjni"
}
}
}
}
Please reopen the bug if you have further issues. Thanks!
ch...@google.com <ch...@google.com> #5
Please provide the full syntax for the externalNativeBuild scripts. gradle sync throws the following error message when I added the recommended argument statement to the script (or change to arguments('-Cjni'))
A problem occurred evaluating project ':aTalk'.
No signature of method: build_6xrerbyg3j4aatiomvrbavr6i.android() is applicable for argument types: (build_6xrerbyg3j4aatiomvrbavr6i$_run_closure4) values: [build_6xrerbyg3j4aatiomvrbavr6i$_run_closure4@497bb461]
externalNativeBuild {
ndkBuild {
path file('jni/Android.mk')
arguments "-Cjni"
}
}
as...@google.com <as...@google.com> #6
There are actually two different types of exteranlNativeBuild
blocks. The block in #4 needs to be put inside defaultConfig
android {
...
defaultConfig {
...
externalNativeBuild {
ndkBuild {
arguments "-Cjni"
}
}
}
...
externalNativeBuild {
ndkBuild {
path file('jni/Android.mk')
}
}
}
Description
Steps to Reproduce or Code Sample to Reproduce:
Run the
CrashMe()
composable below:Stack trace (if applicable):