问题:
Eclipse项目迁移到android studio中后,出现报错问题:
1.
UnsatisfiedLinkError .
2.
Error:(197, 0) NDK integration is deprecated in the current plugin.
<a href="http://tools.android.com/tech-docs/new-build-system/gradle-experimental">
Consider trying the new experimental plugin</a><br><a href="useDeprecatedNdk">
Set "android.useDeprecatedNdk=true" in gradle.properties to continue using the current NDK integration
</a>
第一个问题有四种方法可以解决:
http://blog.youkuaiyun.com/wuqilianga/article/details/53709726
第二个问题:
通过追加gradle 选择armeabi适配所有
具体例子配置:
第一步,根目录,gradle.properties下追加:
#so文件加载 不同手机CPU型号不同,市场上大体上有7种,使用NDK进行JNILIB配置,在gradle需要配置
android.useDeprecatedNdk=true
第二步:module的gradle下配置
android{
defaultConfig{
//so文件加载 不同手机CPU型号不同,市场上大体上有7种,使用NDK进行JNILIB配置,在gradle需要配置
ndk {
abiFilters 'armeabi','x86'
}
}
}
第三步:配置so文件加载路径:
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
resources.srcDirs = ['src']
aidl.srcDirs = ['src']
renderscript.srcDirs = ['src']
res.srcDirs = ['res']
assets.srcDirs = ['assets']
jniLibs.srcDirs = ['libs']// so文件加载路径配置!!!!
}
// Move the tests to tests/java, tests/res, etc...
instrumentTest.setRoot('tests')
// Move the build types to build-types/<type>
// For instance, build-types/debug/java, build-types/debug/AndroidManifest.xml, ...
// This moves them out of them default location under src/<type>/... which would
// conflict with src/ being used by the main source set.
// Adding new build types or product flavors should be accompanied
// by a similar customization.
debug.setRoot('build-types/debug')
release.setRoot('build-types/release')
}
全文完,希望有对你们有帮助,我的荣幸!!!!!!!!
.
.
.
.
.
.
.
.