Before making the switch to AS 2.2, I have the following structure to implement my C
app/src/main/jni/Android.mk
app/src/main/jni/Application.mk
app/src/main/jni/headers/*
app/src/main/jni/cfiles*.cc
in which case everything built fine. However, after upgrading to AS 2.2, I cannot build any apk and always recieve the following error:
Execution failed for task':app:transformNative_libsWithStripDebugSymbolForDebug java.lang.NullPointerException (no error message)
Does anyone know why this is? I cannot seem to find a work around.
You do not need this component if you only plan to use ndk-build. LLDB: the debugger Android Studio uses to debug native code.
I solved this problem in my project ) try to add this into your build.gradle (module)
externalNativeBuild {
ndkBuild {
path 'src/main/jni/Application.mk'
}
}
Link Gradle to your native library
I upgraded to AS 2.2 this morning and had the same error. Upgrading the NDK solved it for me. You can upgrade via SDK Manager now, instructions are here:
https://developer.android.com/studio/projects/add-native-code.html#download-ndk
Also make sure that your "local.properties" file is pointing to the right NDK location. Example Windows local.properties:
ndk.dir=C\:\\Users\\Me\\AppData\\Local\\Android\\sdk\\ndk-bundle
sdk.dir=C\:\\Users\\Me\\AppData\\Local\\Android\\sdk
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With