关于Android Studio 的NDK环境
2015-12-15 15:53
357 查看
需要使用一个Lib:tess-two,用于图片的OCR识别,但该项目调用了一些底层的东西,在NDK平台上开发。
使用Android Studio 时就提示NDK路径无法识别。
没办法,本人菜鸟,从网上down了一个NDK的windows包android-ndk-r10e-windows-x86.exe,解压到sdk的父级目录,在项目包的local.properties中添加NDK的路径信息:
ndk下载路径http://developer.android.com/intl/zh-cn/ndk/downloads/index.html
重新打开Android Studio,加载项目有仍然报错:
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.
最后在app的build.gradle中加入以下代码编译通过
另外,题外话:tess-two需要从官网下载相应的tessdata库,不同语言有不同库需要下载
https://code.google.com/p/tesseract-ocr/downloads/detail?name=tesseract-ocr-3.02.eng.tar.gz&can=2&q=
使用Android Studio 时就提示NDK路径无法识别。
没办法,本人菜鸟,从网上down了一个NDK的windows包android-ndk-r10e-windows-x86.exe,解压到sdk的父级目录,在项目包的local.properties中添加NDK的路径信息:
ndk下载路径http://developer.android.com/intl/zh-cn/ndk/downloads/index.html
sdk.dir=C\:\\Users\\Administrator\\AppData\\Local\\Android\\sdk ndk.dir=C\:\\Users\\Administrator\\AppData\\Local\\Android\\android-ndk-r10e
重新打开Android Studio,加载项目有仍然报错:
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.
最后在app的build.gradle中加入以下代码编译通过
sourceSets.main { jni.srcDirs = [] }
另外,题外话:tess-two需要从官网下载相应的tessdata库,不同语言有不同库需要下载
https://code.google.com/p/tesseract-ocr/downloads/detail?name=tesseract-ocr-3.02.eng.tar.gz&can=2&q=
相关文章推荐
- Android 计算平台简介
- android的armeabi和armeabi-v7a
- android推送解决方案
- [Exception Android 19] - android.widget.HeaderViewListAdapter.isEnabled
- Android中string.xml,动态改变数据方法
- [Android]官网《Testing Support Library》中文翻译
- 【Android测试】【随笔】搜狗、腾讯技术交流会心得
- AndroidAutoLayout--屏幕适配终结者
- 切换界面之后 SwipeRefreshLayout 动画效果暂停,以及不消失的解决方案
- Android初识-创建项目时注意事项
- android开发经验谈(java)
- Handler消息传递机制
- android中xml tools属性详解
- Android Wifi模块 ScanResult类源码分析
- 修改拖动条的外观
- 解决Android6.0蓝牙无法扫描设备或闪退
- Android横竖屏切换小结
- Android代码内存优化建议-Java官方篇
- android对象实现序列化传输
- [转]Android 导入v7包常见错误,以及项目引用v7包错误解决