提问人:Jaden Lorenc 提问时间:2/19/2022 更新时间:9/1/2022 访问量:6206
Flutter 不包括原生调试符号
Flutter does not include Native Debug Symbols
问:
在 android studio 上使用 flutter 构建我的应用程序,当我上传我的应用程序包(通过 制作)时,会弹出消息:flutter build appbundle
Warning
This App Bundle contains native code, and youve not uploaded debug symbols. We recommend you upload a symbol file to make your crashes and ANRs easier to analyze and debug. Learn More
我已经尝试了目前在线的所有解决方案来解决这个问题。以下各项的组合:这些解决方案:
- https://github.com/flutter/flutter/issues/60240#issuecomment-894683946
- https://github.com/flutter/flutter/issues/60240#issuecomment-917321657
- https://stackoverflow.com/a/63436935/5229301
- https://stackoverflow.com/a/64729294/5229301
- https://stackoverflow.com/a/70337587/5229301
升级到 Flutter 2.10.0
升级到 Android Studio Bumblebee |2021.1.1 补丁 1 并单击检查更新,它响应
尝试检查 gradle 插件版本,但它已打包到 android studio 中,我看不到版本或升级选项。
将 Android SDK 构建工具升级到 33-rc1。通过 SDK 管理器 通过 SDK 管理器安装 NDK(并行) 通过 SDK 管理器
安装 CMake 添加到 local.properties 文件,即使它显然已被弃用。
添加到我的 app/build.gradle 的底部。
从 app/build.gradle:You already have the latest version of Android Studio and plugins installed.
ndk.dir=/home/jaden/Android/Sdk/ndk/23.1.7779620
android.buildTypes.release.ndk.debugSymbolLevel = 'SYMBOL_TABLE'
android {
compileSdkVersion 31
...
defaultConfig {
applicationId "app.(myapp)"
minSdkVersion 23
targetSdkVersion 31
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
}
ndkVersion "23.1.7779620"
buildTypes {
...
release {
signingConfig signingConfigs.release
ndk {
debugSymbolLevel 'SYMBOL_TABLE'
}
}
}
}
颤动医生:
flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 2.10.0, on Manjaro Linux 5.13.19-2-MANJARO, locale en_US.UTF-8)
[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
[✗] Chrome - develop for the web (Cannot find Chrome executable at google-chrome)
! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.
[✓] Android Studio (version 2021.1)
[!] Connected device
! No devices available
[✓] HTTP Host Availability
! Doctor found issues in 2 categories.
最后一行:flutter build appbundle -v
[ ] > Task :package_info_plus:generateReleaseBuildConfig UP-TO-DATE
[ ] > Task :package_info_plus:parseReleaseLocalResources UP-TO-DATE
[ ] > Task :package_info_plus:generateReleaseRFile UP-TO-DATE
[ ] > Task :package_info_plus:javaPreCompileRelease UP-TO-DATE
[ ] > Task :package_info_plus:compileReleaseJavaWithJavac UP-TO-DATE
[ ] > Task :package_info_plus:mergeReleaseGeneratedProguardFiles UP-TO-DATE
[ ] > Task :package_info_plus:exportReleaseConsumerProguardFiles UP-TO-DATE
[ ] > Task :fluttertoast:compileReleaseAidl NO-SOURCE
[ ] > Task :fluttertoast:generateReleaseBuildConfig UP-TO-DATE
[ ] > Task :fluttertoast:parseReleaseLocalResources UP-TO-DATE
[ ] > Task :fluttertoast:generateReleaseRFile UP-TO-DATE
[ ] > Task :fluttertoast:compileReleaseKotlin UP-TO-DATE
[ ] > Task :fluttertoast:javaPreCompileRelease UP-TO-DATE
[ ] > Task :fluttertoast:compileReleaseJavaWithJavac UP-TO-DATE
[ +97 ms] > Task :fluttertoast:mergeReleaseGeneratedProguardFiles UP-TO-DATE
[ ] > Task :fluttertoast:exportReleaseConsumerProguardFiles UP-TO-DATE
[ ] > Task :permission_handler:compileReleaseAidl NO-SOURCE
[ ] > Task :permission_handler:generateReleaseBuildConfig UP-TO-DATE
[ ] > Task :permission_handler:parseReleaseLocalResources UP-TO-DATE
[ ] > Task :permission_handler:generateReleaseRFile UP-TO-DATE
[ ] > Task :permission_handler:javaPreCompileRelease UP-TO-DATE
[ ] > Task :permission_handler:compileReleaseJavaWithJavac UP-TO-DATE
[ ] > Task :permission_handler:mergeReleaseGeneratedProguardFiles UP-TO-DATE
[ ] > Task :permission_handler:exportReleaseConsumerProguardFiles UP-TO-DATE
[ ] > Task :app:buildKotlinToolingMetadata UP-TO-DATE
[ ] > Task :app:checkReleaseDuplicateClasses UP-TO-DATE
[ ] > Task :app:compileReleaseAidl NO-SOURCE
[ ] > Task :app:generateReleaseBuildConfig UP-TO-DATE
[ ] > Task :cloud_firestore:writeReleaseAarMetadata UP-TO-DATE
[ ] > Task :file_picker:writeReleaseAarMetadata UP-TO-DATE
[ ] > Task :firebase_auth:writeReleaseAarMetadata UP-TO-DATE
[ ] > Task :firebase_core:writeReleaseAarMetadata UP-TO-DATE
[ ] > Task :flutter_fimber:writeReleaseAarMetadata UP-TO-DATE
[ ] > Task :flutter_inappwebview:writeReleaseAarMetadata UP-TO-DATE
[ ] > Task :flutter_keyboard_visibility:writeReleaseAarMetadata UP-TO-DATE
[ ] > Task :flutter_plugin_android_lifecycle:writeReleaseAarMetadata UP-TO-DATE
[ ] > Task :fluttertoast:writeReleaseAarMetadata UP-TO-DATE
[ ] > Task :image_picker:writeReleaseAarMetadata UP-TO-DATE
[ ] > Task :package_info_plus:writeReleaseAarMetadata UP-TO-DATE
[ ] > Task :path_provider_android:writeReleaseAarMetadata UP-TO-DATE
[ ] > Task :permission_handler:writeReleaseAarMetadata UP-TO-DATE
[ ] > Task :share_plus:writeReleaseAarMetadata UP-TO-DATE
[ ] > Task :shared_preferences_android:writeReleaseAarMetadata UP-TO-DATE
[ ] > Task :url_launcher_android:writeReleaseAarMetadata UP-TO-DATE
[ ] > Task :webview_flutter_android:writeReleaseAarMetadata UP-TO-DATE
[ ] > Task :app:checkReleaseAarMetadata UP-TO-DATE
[ +495 ms] > Task :app:copyFlutterAssetsRelease
[ ] > Task :app:processReleaseManifestForPackage UP-TO-DATE
[ ] > Task :app:processReleaseResources UP-TO-DATE
[ ] > Task :cloud_firestore:bundleLibCompileToJarRelease UP-TO-DATE
[ ] > Task :file_picker:bundleLibCompileToJarRelease UP-TO-DATE
[ ] > Task :firebase_auth:bundleLibCompileToJarRelease UP-TO-DATE
[ ] > Task :flutter_fimber:bundleLibCompileToJarRelease UP-TO-DATE
[ ] > Task :flutter_inappwebview:bundleLibCompileToJarRelease UP-TO-DATE
[ ] > Task :flutter_keyboard_visibility:bundleLibCompileToJarRelease UP-TO-DATE
[ ] > Task :fluttertoast:bundleLibCompileToJarRelease UP-TO-DATE
[ ] > Task :image_picker:bundleLibCompileToJarRelease UP-TO-DATE
[ ] > Task :package_info_plus:bundleLibCompileToJarRelease UP-TO-DATE
[ ] > Task :path_provider_android:bundleLibCompileToJarRelease UP-TO-DATE
[ ] > Task :permission_handler:bundleLibCompileToJarRelease UP-TO-DATE
[ ] > Task :share_plus:bundleLibCompileToJarRelease UP-TO-DATE
[ ] > Task :shared_preferences_android:bundleLibCompileToJarRelease UP-TO-DATE
[ ] > Task :url_launcher_android:bundleLibCompileToJarRelease UP-TO-DATE
[ ] > Task :webview_flutter_android:bundleLibCompileToJarRelease UP-TO-DATE
[ +96 ms] > Task :app:compileReleaseKotlin UP-TO-DATE
[ ] > Task :app:javaPreCompileRelease UP-TO-DATE
[ ] > Task :app:compileReleaseJavaWithJavac UP-TO-DATE
[ ] > Task :app:extractProguardFiles UP-TO-DATE
[ ] > Task :app:mergeReleaseGeneratedProguardFiles UP-TO-DATE
[ ] > Task :app:processReleaseJavaRes NO-SOURCE
[ ] > Task :cloud_firestore:processReleaseJavaRes NO-SOURCE
[ ] > Task :cloud_firestore:bundleLibResRelease NO-SOURCE
[ ] > Task :file_picker:processReleaseJavaRes NO-SOURCE
[ ] > Task :file_picker:bundleLibResRelease NO-SOURCE
[ ] > Task :firebase_auth:processReleaseJavaRes NO-SOURCE
[ ] > Task :firebase_auth:bundleLibResRelease NO-SOURCE
[ ] > Task :firebase_core:processReleaseJavaRes NO-SOURCE
[ ] > Task :firebase_core:bundleLibResRelease NO-SOURCE
[ ] > Task :flutter_fimber:processReleaseJavaRes NO-SOURCE
[ ] > Task :flutter_fimber:bundleLibResRelease UP-TO-DATE
[ ] > Task :flutter_inappwebview:processReleaseJavaRes NO-SOURCE
[ ] > Task :flutter_inappwebview:bundleLibResRelease NO-SOURCE
[ ] > Task :flutter_keyboard_visibility:processReleaseJavaRes NO-SOURCE
[ ] > Task :flutter_keyboard_visibility:bundleLibResRelease NO-SOURCE
[ ] > Task :flutter_plugin_android_lifecycle:processReleaseJavaRes NO-SOURCE
[ ] > Task :flutter_plugin_android_lifecycle:bundleLibResRelease NO-SOURCE
[ ] > Task :fluttertoast:processReleaseJavaRes NO-SOURCE
[ ] > Task :fluttertoast:bundleLibResRelease UP-TO-DATE
[ ] > Task :image_picker:processReleaseJavaRes NO-SOURCE
[ ] > Task :image_picker:bundleLibResRelease NO-SOURCE
[ ] > Task :package_info_plus:processReleaseJavaRes NO-SOURCE
[ ] > Task :package_info_plus:bundleLibResRelease NO-SOURCE
[ ] > Task :path_provider_android:processReleaseJavaRes NO-SOURCE
[ ] > Task :path_provider_android:bundleLibResRelease NO-SOURCE
[ ] > Task :permission_handler:processReleaseJavaRes NO-SOURCE
[ ] > Task :permission_handler:bundleLibResRelease NO-SOURCE
[ ] > Task :share_plus:processReleaseJavaRes NO-SOURCE
[ ] > Task :share_plus:bundleLibResRelease NO-SOURCE
[ ] > Task :shared_preferences_android:processReleaseJavaRes NO-SOURCE
[ ] > Task :shared_preferences_android:bundleLibResRelease NO-SOURCE
[ ] > Task :url_launcher_android:processReleaseJavaRes NO-SOURCE
[ ] > Task :url_launcher_android:bundleLibResRelease NO-SOURCE
[ ] > Task :webview_flutter_android:processReleaseJavaRes NO-SOURCE
[ ] > Task :webview_flutter_android:bundleLibResRelease NO-SOURCE
[ ] > Task :app:mergeReleaseJavaResource UP-TO-DATE
[ ] > Task :cloud_firestore:bundleLibRuntimeToJarRelease UP-TO-DATE
[ ] > Task :file_picker:bundleLibRuntimeToJarRelease UP-TO-DATE
[ ] > Task :firebase_auth:bundleLibRuntimeToJarRelease UP-TO-DATE
[ ] > Task :firebase_core:bundleLibRuntimeToJarRelease UP-TO-DATE
[ ] > Task :flutter_fimber:bundleLibRuntimeToJarRelease UP-TO-DATE
[ ] > Task :flutter_inappwebview:bundleLibRuntimeToJarRelease UP-TO-DATE
[ ] > Task :flutter_keyboard_visibility:bundleLibRuntimeToJarRelease UP-TO-DATE
[ ] > Task :flutter_plugin_android_lifecycle:bundleLibRuntimeToJarRelease UP-TO-DATE
[ ] > Task :fluttertoast:bundleLibRuntimeToJarRelease UP-TO-DATE
[ ] > Task :image_picker:bundleLibRuntimeToJarRelease UP-TO-DATE
[ ] > Task :package_info_plus:bundleLibRuntimeToJarRelease UP-TO-DATE
[ ] > Task :path_provider_android:bundleLibRuntimeToJarRelease UP-TO-DATE
[ ] > Task :permission_handler:bundleLibRuntimeToJarRelease UP-TO-DATE
[ ] > Task :share_plus:bundleLibRuntimeToJarRelease UP-TO-DATE
[ ] > Task :shared_preferences_android:bundleLibRuntimeToJarRelease UP-TO-DATE
[ ] > Task :url_launcher_android:bundleLibRuntimeToJarRelease UP-TO-DATE
[ ] > Task :webview_flutter_android:bundleLibRuntimeToJarRelease UP-TO-DATE
[ +172 ms] > Task :app:minifyReleaseWithR8 UP-TO-DATE
[ ] > Task :app:mergeReleaseJniLibFolders UP-TO-DATE
[ ] > Task :cloud_firestore:mergeReleaseJniLibFolders UP-TO-DATE
[ ] > Task :cloud_firestore:mergeReleaseNativeLibs NO-SOURCE
[ ] > Task :cloud_firestore:copyReleaseJniLibsProjectOnly UP-TO-DATE
[ ] > Task :file_picker:mergeReleaseJniLibFolders UP-TO-DATE
[ ] > Task :file_picker:mergeReleaseNativeLibs NO-SOURCE
[ ] > Task :file_picker:copyReleaseJniLibsProjectOnly UP-TO-DATE
[ ] > Task :firebase_auth:mergeReleaseJniLibFolders UP-TO-DATE
[ ] > Task :firebase_auth:mergeReleaseNativeLibs NO-SOURCE
[ ] > Task :firebase_auth:copyReleaseJniLibsProjectOnly UP-TO-DATE
[ ] > Task :firebase_core:mergeReleaseJniLibFolders UP-TO-DATE
[ ] > Task :firebase_core:mergeReleaseNativeLibs NO-SOURCE
[ ] > Task :firebase_core:copyReleaseJniLibsProjectOnly UP-TO-DATE
[ ] > Task :flutter_fimber:mergeReleaseJniLibFolders UP-TO-DATE
[ ] > Task :flutter_fimber:mergeReleaseNativeLibs NO-SOURCE
[ ] > Task :flutter_fimber:copyReleaseJniLibsProjectOnly UP-TO-DATE
[ ] > Task :flutter_inappwebview:mergeReleaseJniLibFolders UP-TO-DATE
[ ] > Task :flutter_inappwebview:mergeReleaseNativeLibs NO-SOURCE
[ ] > Task :flutter_inappwebview:copyReleaseJniLibsProjectOnly UP-TO-DATE
[ ] > Task :flutter_keyboard_visibility:mergeReleaseJniLibFolders UP-TO-DATE
[ ] > Task :flutter_keyboard_visibility:mergeReleaseNativeLibs NO-SOURCE
[ ] > Task :flutter_keyboard_visibility:copyReleaseJniLibsProjectOnly UP-TO-DATE
[ ] > Task :flutter_plugin_android_lifecycle:mergeReleaseJniLibFolders UP-TO-DATE
[ ] > Task :flutter_plugin_android_lifecycle:mergeReleaseNativeLibs NO-SOURCE
[ ] > Task :flutter_plugin_android_lifecycle:copyReleaseJniLibsProjectOnly UP-TO-DATE
[ ] > Task :fluttertoast:mergeReleaseJniLibFolders UP-TO-DATE
[ ] > Task :fluttertoast:mergeReleaseNativeLibs NO-SOURCE
[ ] > Task :fluttertoast:copyReleaseJniLibsProjectOnly UP-TO-DATE
[ +16 ms] > Task :image_picker:mergeReleaseJniLibFolders UP-TO-DATE
[ ] > Task :image_picker:mergeReleaseNativeLibs NO-SOURCE
[ ] > Task :image_picker:copyReleaseJniLibsProjectOnly UP-TO-DATE
[ ] > Task :package_info_plus:mergeReleaseJniLibFolders UP-TO-DATE
[ ] > Task :package_info_plus:mergeReleaseNativeLibs NO-SOURCE
[ ] > Task :package_info_plus:copyReleaseJniLibsProjectOnly UP-TO-DATE
[ ] > Task :path_provider_android:mergeReleaseJniLibFolders UP-TO-DATE
[ ] > Task :path_provider_android:mergeReleaseNativeLibs NO-SOURCE
[ ] > Task :path_provider_android:copyReleaseJniLibsProjectOnly UP-TO-DATE
[ +98 ms] > Task :permission_handler:mergeReleaseJniLibFolders UP-TO-DATE
[ ] > Task :permission_handler:mergeReleaseNativeLibs NO-SOURCE
[ ] > Task :permission_handler:copyReleaseJniLibsProjectOnly UP-TO-DATE
[ ] > Task :share_plus:mergeReleaseJniLibFolders UP-TO-DATE
[ ] > Task :share_plus:mergeReleaseNativeLibs NO-SOURCE
[ ] > Task :share_plus:copyReleaseJniLibsProjectOnly UP-TO-DATE
[ ] > Task :shared_preferences_android:mergeReleaseJniLibFolders UP-TO-DATE
[ ] > Task :shared_preferences_android:mergeReleaseNativeLibs NO-SOURCE
[ ] > Task :shared_preferences_android:copyReleaseJniLibsProjectOnly UP-TO-DATE
[ ] > Task :url_launcher_android:mergeReleaseJniLibFolders UP-TO-DATE
[ ] > Task :url_launcher_android:mergeReleaseNativeLibs NO-SOURCE
[ ] > Task :url_launcher_android:copyReleaseJniLibsProjectOnly UP-TO-DATE
[ ] > Task :webview_flutter_android:mergeReleaseJniLibFolders UP-TO-DATE
[ ] > Task :webview_flutter_android:mergeReleaseNativeLibs NO-SOURCE
[ +98 ms] > Task :webview_flutter_android:copyReleaseJniLibsProjectOnly UP-TO-DATE
[ ] > Task :app:mergeReleaseNativeLibs UP-TO-DATE
[ ] > Task :app:stripReleaseDebugSymbols UP-TO-DATE
[+2799 ms] > Task :app:buildReleasePreBundle
[ ] > Task :cloud_firestore:prepareReleaseArtProfile UP-TO-DATE
[ ] > Task :file_picker:prepareReleaseArtProfile UP-TO-DATE
[ ] > Task :firebase_auth:prepareReleaseArtProfile UP-TO-DATE
[ ] > Task :firebase_core:prepareReleaseArtProfile UP-TO-DATE
[ ] > Task :flutter_fimber:prepareReleaseArtProfile UP-TO-DATE
[ ] > Task :flutter_inappwebview:prepareReleaseArtProfile UP-TO-DATE
[ ] > Task :flutter_keyboard_visibility:prepareReleaseArtProfile UP-TO-DATE
[ ] > Task :flutter_plugin_android_lifecycle:prepareReleaseArtProfile UP-TO-DATE
[ ] > Task :fluttertoast:prepareReleaseArtProfile UP-TO-DATE
[ ] > Task :image_picker:prepareReleaseArtProfile UP-TO-DATE
[ ] > Task :package_info_plus:prepareReleaseArtProfile UP-TO-DATE
[ ] > Task :path_provider_android:prepareReleaseArtProfile UP-TO-DATE
[ ] > Task :permission_handler:prepareReleaseArtProfile UP-TO-DATE
[ ] > Task :share_plus:prepareReleaseArtProfile UP-TO-DATE
[ ] > Task :shared_preferences_android:prepareReleaseArtProfile UP-TO-DATE
[ ] > Task :url_launcher_android:prepareReleaseArtProfile UP-TO-DATE
[ ] > Task :webview_flutter_android:prepareReleaseArtProfile UP-TO-DATE
[ ] > Task :app:mergeReleaseArtProfile UP-TO-DATE
[ ] > Task :app:compileReleaseArtProfile UP-TO-DATE
[ ] > Task :app:collectReleaseDependencies UP-TO-DATE
[ ] > Task :app:configureReleaseDependencies UP-TO-DATE
[ ] > Task :app:extractReleaseNativeSymbolTables UP-TO-DATE
[ ] > Task :app:parseReleaseIntegrityConfig UP-TO-DATE
[ ] > Task :app:writeReleaseAppMetadata UP-TO-DATE
[ ] > Task :app:validateSigningRelease UP-TO-DATE
[+3397 ms] > Task :app:packageReleaseBundle
[+4398 ms] > Task :app:shrinkBundleReleaseResources
[+5699 ms] > Task :app:signReleaseBundle
[ ] > Task :app:produceReleaseBundleIdeListingFile
[ ] > Task :app:createReleaseBundleListingFileRedirect
[ ] > Task :app:bundleRelease
[ +96 ms] Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.
[ ] You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
[ ] See https://docs.gradle.org/7.4/userguide/command_line_interface.html#sec:command_line_warnings
[ ] BUILD SUCCESSFUL in 36s
[ ] 375 actionable tasks: 11 executed, 364 up-to-date
[ +397 ms] Running Gradle task 'bundleRelease'... (completed in 37.5s)
[ +30 ms] ✓ Built build/app/outputs/bundle/release/app-release.aab (68.2MB).
[ +5 ms] "flutter appbundle" took 39,072ms.
[ +235 ms] ensureAnalyticsSent: 224ms
[ +5 ms] Running shutdown hooks
[ +1 ms] Shutdown hooks complete
[ +3 ms] exiting with code 0
疯狂的是,用于构建和发布 android 应用程序的 flutter 文档完全没有提到包含原生调试符号。这让我相信,出于某种原因,flutter 应该已经将它们包含在 app bundle 中,但事实并非如此。它与混淆我的代码有什么关系吗?我没有混淆我的,但我是否需要使用其中描述的解决方案来提取本机调试符号?
这甚至受支持吗?我应该在没有该功能的情况下按原样上传应用程序吗?当我收到难以理解的崩溃报告时,我该怎么办?
答:
事实证明,由于某种原因,由于我使用了 gradle 插件 7.1.1,因此出现了问题。更改为“classpath 'com.android.tools.build:gradle:4.1.3''解决了我的问题。Google Play 管理中心可识别 app bundle 中的原生调试符号。目前尚不清楚为什么,除了在 app bundle 中,目录 BUNDLE-METADATA 包含以下目录:
使用 7.1.1:classpath 'com.android.tools.build:gradle:7.1.1'
com.android.tools.build.gradle
com.android.tools.build.libraries
com.android.tools.build.obfuscation
使用 4.1.3:
com.android.tools.build.debugsymbols
com.android.tools.build.libraries
com.android.tools.build.obfuscation
我已经尝试了多个版本的android gradle插件,我可以说问题发生在android gradle插件版本4.1.3之后。所以我现在的解决方法是让:android/build.gradle
buildscript {
...
dependencies {
classpath 'com.android.tools.build:gradle:4.1.3'
...
}
}
该插件的下一个版本 4.2.0 省略了原生调试文件,尽管 app/build.gradle 中包含了这些文件:
android {
...
packagingOptions {
dex {
useLegacyPackaging true
}
jniLibs {
useLegacyPackaging true
}
}
}
评论
很抱歉迟到了,但我现在遇到了这个问题。
我将 ndk 从 21.4.7075529 升级到 22.1.7171670,现在我得到了调试符号。从这个 SO 帖子 https://stackoverflow.com/a/68230873/3080858 得到了线索。我也在使用 com.android.tools.build:gradle:7.1.1 顺便说一句。
我还从这个 SO 帖子 https://stackoverflow.com/a/70569808/3080858 得到了帮助,以在 aab-file 中找到调试信息。
评论