将带有jni的Eclipse项目导入AndroidStudio遇到的问题
来源:互联网 发布:webshell教程 编辑:程序博客网 时间:2024/05/16 06:09
当然前提是本地已经配置好了ndk的环境
1. NDK integration is deprecated in the current plugin
首次编译遇到一个错误:
FAILURE: Build failed with an exception.* What went wrong: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 "$USE_DEPRECATED_NDK=true" in gradle.properties to continue using the current NDK integration.
解决
先在module下新建文件,gradle.properties
文件中写上一句 android.useDeprecatedNdk=true
然后重新build就没这个问题了
2. Native C/C++ source code is found, but it seems that NDK option is not configured
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.
build失败在Gradle Console中会打印这个信息
解决
其中一种方法就是,就按他提示的吧,加上
sourceSets { main { jni.srcDirs = [] } }
再次build ,:
BUILD SUCCESSFUL
阅读全文
0 0
- 将带有jni的Eclipse项目导入AndroidStudio遇到的问题
- 向android studio中导入带有jni的eclipse项目
- 将eclipse项目转移到androidstudio后遇到的错误
- 把Eclipse项目转化AndroidStudio项目中遇到的问题
- AndroidStudio导入GitHub项目时遇到的问题
- 导入一个AndroidStudio项目时遇到的gradle问题
- 将Eclipse代码导入到AndroidStudio时的问题汇总
- Android 导入项目时遇到的JNI和NDK问题
- 将eclipse 项目导入到Android studio 遇到的几个问题
- AndroidStudio导入Eclipse项目后的几个问题
- 导入的Eclipse项目到AndroidStudio中
- 导入的Eclipse项目到AndroidStudio中
- AndroidStudio中导入Eclipse的库项目
- 将项目导入AS遇到的问题及解决方法集锦
- AndroidStudio的JNI开发中遇到的一些问题
- AndroidStudio导入Github下载的项目问题
- Mac使用AndroidStudio导入项目遇到的gradle syns failed的问题
- AndroidStudio快速入门一:将Eclipse项目导入AndroidStudio
- Java SE基础及注意点
- 公司最新动态追踪
- 阿里云部署Java web项目初体验
- Android自定义View中padding与wrap_content的问题
- BZOJ 2342: [Shoi2011]双倍回文 manacher
- 将带有jni的Eclipse项目导入AndroidStudio遇到的问题
- 笔记——如何给JTextArea添加滚动条
- YUV格式详解
- 讨论子类和父类之间的关系
- STM32中的常量数组的首地址如何指定FLASH的某一个地址
- Selenium环境搭建
- Android UI系列之仿斗鱼滑动拼图验证码控件
- 编写Java程序,将数组中最小的数输出。
- 使用ab进行压力测试详解