[android ndk] -android studio中编译生成so文件
1.android.useDeprecatedNdk=true
Error:Execution failed for task ':app:compileDebugNdk'.
> Error: NDK integration is deprecated in the current plugin. Consider trying the new experimental plugin. For details, see http://tools.android.com/tech-docs/new-build-system/gradle-experimental. Set "android.useDeprecatedNdk=true" in gradle.properties to continue using the current NDK integration.
该问题是需要在工程目录下的gradle.properties文件下,加上android.useDeprecatedNdk=true即可
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
2.build.gradle少了配置
Warning:Native C/C++ source code is found, but it seems that NDK option is not configured. Note that if you have an Android.mk, it is not used for compilation. The recommended workaround is to remove the default jni source code directory by adding:
android {
sourceSets {
main {
jni.srcDirs = []
}
}
}
to build.gradle, manually compile the code with ndk-build, and then place the resulting shared object in src/main/jniLibs.
make.exe: *** No rule to make target `E:\as_workspaces\IntentDemo\app\build\intermediates\ndk\debug\obj/local/armeabi-v7a/objs/app/E_\as_workspaces\IntentDemo\app\src\main\jni', needed by `E:\as_workspaces\IntentDemo\app\build\intermediates\ndk\debug\obj/local/armeabi-v7a/objs/app/E_\as_workspaces\IntentDemo\app\src\main\jni\JNI_Demo.o'. Stop.
:app:compileDebugNdk FAILED
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
3.
make.exe: *** No rule to make target `E:\as_workspaces\IntentDemo\app\build\intermediates\ndk\debug\obj/local/armeabi-v7a/objs/JNI_Demo/E_\as_workspaces\IntentDemo\app\src\main\jni', needed by `E:\as_workspaces\IntentDemo\app\build\intermediates\ndk\debug\obj/local/armeabi-v7a/objs/JNI_Demo/E_\as_workspaces\IntentDemo\app\src\main\jni\JNI_Demo.o'. Stop.
Error:Execution failed for task ':app:compileDebugNdk'.
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'D:\Android\android-ndk-r10\ndk-build.cmd'' finished with non-zero exit value 2
-------------------------------------------------------------------------------
http://www.th7.cn/Program/Android/201509/550864.shtml
http://blog.csdn.net/lamp_zy/article/details/48976737
http://blog.k-res.net/archives/1788.html
http://www.cnblogs.com/flyme/p/4431762.html
http://blog.k-res.net/archives/1788.html
更多相关文章
- Android中各类.mk文件的编写
- android 在标题栏加上按钮
- 《Pro Android(安卓)Graphics》读书笔记之第四节
- Android:ADB各类错误
- android 按钮按下时改变字体颜色
- 设置android:elevation无效
- Android(安卓)webview与js交互
- android 背景圆角以及图片圆角处理
- Android(安卓)JetPack——DataBinding