问题描述
我正在尝试将Android应用程序发布到Google Play并收到警告:
This App Bundle contains native code,and you've not uploaded debug symbols.
We recommend you upload a symbol file to make your crashes and ANRs easier to analyze and debug.
我在one documentation中发现,我应该添加
android.buildTypes.release.ndk.debugSymbolLevel = { SYMBOL_TABLE | FULL }
行到build.gradle
文件,在another documentation中,我应该添加
android.defaultConfig.ndk.debugSymbolLevel = 'FULL'
行至build.gradle
文件。
哪个是正确的?
无论如何,都不起作用。
如果我将行(按原样)添加到build.gradle
(实际上是按照文档的说明),则会收到Gradle
错误,找不到ndk
或{{1} }名称。
如果我将行(原样)添加到debugSymbolLevel
,则行无效:gradle.properties
文件的大小相同,并且警告仍然存在。
如何完成?
解决方法
两个选项都可以使用。如果您使用android.defaultConfig.ndk.debugSymbolLevel
,它将应用于所有构建类型(即调试和发布构建)。另一方面,如果您使用android.buildTypes.release.ndk.debugSymbolLevel
,它将仅适用于您的发行版。
这些选项必须添加到您的app/build.gradle
文件中,该文件看起来像这样:
android {
compileSdkVersion 28
defaultConfig {
applicationId 'com.example.foo'
minSdkVersion 23
targetSdkVersion 28
versionCode 42
versionName "4.0.2"
ndk {
debugSymbolLevel 'SYMBOL_TABLE'
}
}
// Rest of the file
}
HTH