[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
-------------------------------------------------------------------------------
4.关于Eclipse中始终无法编译通过的问题
如果觉得JNI的代码都没有错,就先clean一下项目清下缓存,然后把命令行窗口关闭,重新再打开。再试一下即可。
-------------------------------------------------------------------------------
5.Android NDK: WARNING: APP_PLATFORM android-19 is larger than android:minSdkVersion 8 in ./AndroidManifest.xml
如果.mk文件里没有定义APP_PLATFORM android-19,那么会使用默认的。所以加上后,把project.properties里面也改成target=android-19。AndroidManifest.xml里面android:minSdkVersion可以不改
-------------------------------------------------------------------------------
6.Android NDK: LOCAL_MODULE definition in jni/Android.mk must not contain space
这个问题是因为.mk文件里面有空格字符,你可以把里面的中文注释都去掉,把中文空格都改成英文空格,或者干脆都去掉。
-------------------------------------------------------------------------------
7.
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 ndk] -android studio中编译生成so文件的更多相关文章
- 在visual studio code和visual studio中编写TypeScript文件自动生成JavaScript文件
注:此处的自动生成都为保存ts文件时自动生成js文件 VS CODE 只需要在TypeScript的终端控制台中输入如下命令即可,并注意需要将其中的*换成对应的文件名,此处的*似乎不能作为通用匹配. ...
- Android SDK Android NDK Android Studio 官方下载地址
2016.12 Android Studio Windows Includes Android SDK https://dl.google.com/dl/android/studio/install/ ...
- Android SDK Android NDK Android Studio 官方下载地址<转>
转自:http://www.cnblogs.com/yaotong/archive/2011/01/25/1943615.html 2016.10Android Studio 2.2.1.0https ...
- 关于Visual Studio中的TraceDebugging文件夹
最近一段时间发现C盘莫名其妙的变小了,各种清理各种卸载还是没用,电脑慢的是在无法使用 .最后只能一个文件夹一个文件夹的找,最后针对“C:\Documents and Settings\All User ...
- Android Studio中.9.png文件出错问题
昨天使用别人的.9.png图片放在自己的android studio工程下使用,出现如下错误: :app:preBuild UP-TO-DATE :app:preDebugBuild UP-TO-DA ...
- android studio中编译单个文件
网上搜到比较全的是这个:https://blog.csdn.net/u011368551/article/details/51980678 另外关于gradle如何编译单个文件,参考 https:// ...
- Android studio中修改xml文件无效问题
昨天遇到的这个问题,在修改布局xml文件后保存,但运行时布局却并没有被修改,也就是说我的修改无效,今天参照了这篇文章中的方法终于解决了: https://blog.csdn.net/l_o_s/art ...
- android studio 中 添加.so 文件
传送门: http://jingyan.baidu.com/article/e3c78d644baaf23c4d85f57d.html 注意在Build.gradle中 添加的位置
- Android NDK开发 Jni中打日志LOG(二)
HelloJni.c文件中,加入头文件和函数声明.最终文件如下: #include <jni.h> #include <string.h> #include<androi ...
随机推荐
- 【大视野入门OJ】1099:歌德巴赫猜想
Description 歌德巴赫猜想大家都很熟悉吧?给一个数,能够分解成两个素数的和.现在要给你一个n,6 <= n < 1000000,让你求他会分解成哪两个素数?如果存在多组解,则要求 ...
- 【图论】The Bottom of a Graph
[POJ2553]The Bottom of a Graph Time Limit: 3000MS Memory Limit: 65536K Total Submissions: 11182 ...
- python基础之单例模式
单例模式: 什么是单例模式? 基于某种方法实例化多次得到实例是同一个 实现方法: ip = '1.1.1.1' port = 3306 # 假装来自配置文件 #方法一:定义类方法进行判断 class ...
- mysql错误 Access denied for user 'root'@'xxx.xxx.xxx.xxx' (using password: YES)
mysql -u root -p Aaa111222333 grant all privileges on *.* to root@'%' identified by 'aaa111222333; Q ...
- 【个人专用&入门级】LAMP一键安装包
最近自学了下Shell编程,也算是入门吧!按照如下教程,编译安装了LAMP(Apache-2.4.6 + MySQL-5.5.25 + PHP-5.3.27) CentOS6.3编译安装LAMP(1) ...
- Sys.dm_os_wait_stats Sys.dm_performance_counters
wait_type waiting_tasks_count wait_time_ms max_wait_time_ms signal_wait_time_ms MISCELLANEOUS 0 0 0 ...
- Virtualbox+ubuntu设置共享文件夹
转:http://www.juwends.com/tech/unix_series/virtualbox-ubuntu-sharefolder.html 1. 进入系统,安装增强功能,安装完关闭系统. ...
- SDK里报错[NSConcreteMutableData wbsdk_base64EncodedString]
百度一大堆都说在这个里加个-ObjC,然后加了还是有问题 最近谷歌了下才要加入这个才正常了,国内的开发者只是一知半解的………… 如果错误还没有解决, 下面这个可以帮到你:
- Android疑难杂症之KillProcess 和System.exit 无效
以下所讲,浓缩在 https://github.com/wytings/CrashDemo 首先就这个名字来说,kill了process 或者 system.exit确实已经把APP杀掉了,特别是当你 ...
- DIV强制不换行
一.单个DIV:1.用nobr元素 <html> <head> </head> <body> <div><nobr>不换行不换行 ...