调试
在项目build.gradle中 buildTypes debug 中添加 jniDebuggable true
buildTypes {
debug {
jniDebuggable true //添加
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
完整配置
android {
compileSdkVersion 29
buildToolsVersion "29.0.2"
defaultConfig {
...
externalNativeBuild {
cmake {
cppFlags "-std=c++11"
}
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
debug {
jniDebuggable true //添加
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
externalNativeBuild {
cmake {
path "src/main/cpp/CMakeLists.txt"
// version "3.10.2" //CMakeLists中的message 不打印
}
}
}
网友评论