我明白這被問了很多次,但我在發佈我的查詢之前已經做了徹底的研究。java.lang.UnsatisfiedLinkError:無法從加載器加載dalvik.system.PathClassLoader findLibrary返回null
我已將Android Studio更新至2015年3月2日版本1.1.0的最新版本。我認爲,等級不會自行打包.so文件。
我在/ jni文件夾中寫入了NewNDK.c。運行ndk-build腳本並且.so文件在/ libs中創建。根據其中一篇文章的建議,我將libs修改爲lib。
即使這樣,我得到java.lang.UnsatisfiedLinkError:無法從加載器加載dalvik.system.PathClassLoader findLibrary返回null錯誤。
該帖子沒有說明要修改哪些文件。我是Android新手,請求您的幫助。
我已經將問題縮小爲:1. Gradle不打包2. Gradle腳本應該被修改。
的的build.gradle(模塊:應用程序)是如下:
應用插件: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion "21.1.2"
defaultConfig {
applicationId "com.example.raghu.newndk"
minSdkVersion 17
targetSdkVersion 17
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:21.0.3'
}
的的build.gradle(項目)是如下:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.1.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
請讓我知道缺少的東西。
謝謝!
幫助我,非常感謝 – Chris623 2016-08-22 20:51:26