我的build.gradle如下所述
apply plugin: 'com.android.application'
android {
publishNonDefault true //this line
compileSdkVersion 21
buildToolsVersion "25.0.3"
defaultConfig {
applicationId "lnt.test.com.myapplication"
minSdkVersion 21
targetSdkVersion 21
versionCode 1
versionName "1.0"
ndk {
abiFilters 'x86', 'x86_64', 'armeabi', 'armeabi-v7a','mips','mips64','arm64-v8a'
}
externalNativeBuild {
cmake {
arguments '-DANDROID_ALLOW_UNDEFINED_SYMBOLS=true','-DANDROID_PLATFORM=android-21', "-DANDROID_CPP_FEATURES=rtti exceptions","-DANDROID_ABI=armeabi"
}
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
externalNativeBuild {
cmake {
path "src/main/cpp/CMakeLists.txt"
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:appcompat-v7:21.0.2'
}
我得到以下错误日志dlopen失败:无法找到“/data/app/lnt.test.com.myapplication-1/lib/arm/liblwm2m_client.so”引用的符号“mbedtls_entropy_func”... < / p>
答案 0 :(得分:0)
您的共享库看起来像是与openssl动态链接。你运行readelf -d liblwm2m_client.so | grep NEEDED
时会得到什么?如果它需要libssl.so或libcrypto.so,则可能需要静态链接openssl。