0
我正在從Eclipse移植一個項目到Android Studio。Android Studio:未定義引用__system_property_get
我收到錯誤'__system_property_get'的未定義引用。但是,使用Ant和Eclipse構建的舊項目可以很好地完成。
有什麼我需要添加到build.gradle的ndk部分?
我正在從Eclipse移植一個項目到Android Studio。Android Studio:未定義引用__system_property_get
我收到錯誤'__system_property_get'的未定義引用。但是,使用Ant和Eclipse構建的舊項目可以很好地完成。
有什麼我需要添加到build.gradle的ndk部分?
我最終評論了ndk部分並添加了一個ndkBuild任務。
// The normal ndk build (commented out above) is broken because __system_property_get can't be resolved
// by the linker. Doing the build via the ndk-build script is workaround.
task ndkBuild(type: Exec) {
def ndkDir = project.plugins.findPlugin('com.android.library').sdkHandler.getNdkFolder()
commandLine "$ndkDir/ndk-build", '-C', 'src/main/jni',
"NDK_OUT=$buildDir/ndk/obj",
"NDK_APP_DST_DIR=$buildDir/../../../externalLibs"
}
assembleRelease.dependsOn ndkBuild
assembleDebug.dependsOn ndkBuild