在 Android Studio 中运行“生成签名应用程序包”时,不会在
intermediates/merged_native_libs
文件夹或应用程序包中生成本机调试符号。我尝试不在 build.gradle.kts 中指定 ndk 版本,但无济于事。有趣的是,当我使用此实现时,本机调试符号确实会在上面的文件夹中生成,但仍然无法在应用程序包中访问:
implementation("androidx.compose.material:material:1.7.0-alpha01")
我已经安装了 ndk(与下面的 build.gradle.kts 文件中的版本相同)和 cmake
build.gradle.kts:
android {
namespace = "com.myspeechy.myspeechy"
compileSdk = 34
ndkVersion = "22.1.7171670"
defaultConfig {
applicationId = "com.myspeechy.myspeechy"
minSdk = 26
targetSdk = 34
versionCode = 11
versionName = "1.0.11"
testInstrumentationRunner = "com.myspeechy.myspeechy.CustomTestRunner"
vectorDrawables {
useSupportLibrary = true
}
ksp {
arg("room.schemaLocation", "$projectDir/schemas")
}
resourceConfigurations.addAll(listOf("en"))
}
buildTypes {
release {
ndk {
debugSymbolLevel = "FULL"
}
isShrinkResources = true
isMinifyEnabled = true
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
)
}
}
...
implementation("androidx.activity:activity-compose:1.8.2")
implementation("androidx.navigation:navigation-compose:2.7.7")
implementation("androidx.core:core-ktx:1.12.0")
implementation(platform("androidx.compose:compose-bom:2023.08.00"))
implementation("androidx.compose.ui:ui")
implementation("androidx.compose.ui:ui-graphics")
implementation("androidx.compose.ui:ui-tooling-preview")
implementation("androidx.compose.material3:material3")
//this is the line that makes symbols generate
implementation("androidx.compose.material:material:1.7.0-alpha01")
如果未生成 merged_native_libs 意味着 Playstore 也不会显示上传文件(如 armeabi-v7a、arm64-v8a、x86 等)的警告。
无本机库:如果您的项目不使用任何本机库(.so 文件),Android Studio 可能会完全跳过创建 merged_native_libs 文件夹。