英文:
Crashlytics upload symbols- "java command failed with args" -how fix it?
问题
I have a Flutter app, and I'm working on a Mac. I've obfuscated my app bundle. However, the logs I'm receiving from Crashlytics are in an unreadable form. I've discovered that it's necessary to load symbols on Crashlytics (Firebase).
I've installed the Firebase CLI and obtained my app ID. I ran the following command:
firebase crashlytics:symbols:upload --app myId debug-info/app.android-arm64.symbols
But I encountered an error. Here are the logs:
i Generating symbols for debug-info-droid/app.android-arm64.symbols
i Generated symbols for debug-info-droid/app.android-arm64.symbols
......
i Uploading all generated symbols...
[CRASHLYTICS LOG DEBUG] PUT headers:
[CRASHLYTICS LOG DEBUG] User-Agent = firebase-cli;crashlytics-buildtools/2.9.2
[CRASHLYTICS LOG DEBUG] X-CRASHLYTICS-API-CLIENT-TYPE = firebase-cli;crashlytics-buildtools
[CRASHLYTICS LOG DEBUG] X-CRASHLYTICS-API-CLIENT-VERSION = 2.9.2
[CRASHLYTICS LOG DEBUG] PUT response: [reqId=null] 400
......
response: 400 HTTP/1.1 400 Bad Request]
at com.google.firebase.crashlytics.buildtools.api.RestfulWebApi.sendFile(RestfulWebApi.java:109)
at com.google.firebase.crashlytics.buildtools.api.RestfulWebApi.uploadFile(RestfulWebApi.java:119)
at com.google.firebase.crashlytics.buildtools.api.FirebaseSymbolFileService.uploadNativeSymbolFile(FirebaseSymbolFileService.java:35)
at com.google.firebase.crashlytics.buildtools.Buildtools.uploadNativeSymbolFiles(Buildtools.java:301)
at com.google.firebase.crashlytics.buildtools.CommandLineHelper.executeUploadSymbols(CommandLineHelper.java:194)
at com.google.firebase.crashlytics.buildtools.CommandLineHelper.executeCommand(CommandLineHelper.java:120)
at com.google.firebase.crashlytics.buildtools.CommandLineHelper.main(CommandLineHelper.java:65)
at com.google.firebase.crashlytics.buildtools.Buildtools.main(Buildtools.java:111)
Error: java command failed with args: -jar,/Users/rockstar/.cache/firebase/crashlytics/buildtools/crashlytics-buildtools-2.9.2.jar,-symbolGenerator,breakpad,-symbolFileCacheDir,/var/folders/jg/../nativeSymbols/.../breakpad,-verbose,-uploadNativeSymbols,-googleAppId,myId,-clientName,
firebase-cli;crashlytics-buildtools
How can I fix this problem? Is it related to Java settings on my Mac? Maybe I can use another solution for uploading symbols?
英文:
I have flutter app. I working on mac. I used obfuscation for my appbundle. I get logs for Crashlytics in unreadable form. I found that it is necessary to load symbols on Crashlytics(Firebase).
I installed Firebase cli and got my app id. I run it command:
firebase crashlytics:symbols:upload --app myId debug-info/app.android-arm64.symbols
But I have error, This is logs:
i Generating symbols for debug-info-droid/app.android-arm64.symbols
i Generated symbols for debug-info-droid/app.android-arm64.symbols
.......
i Uploading all generated symbols...
[CRASHLYTICS LOG DEBUG] PUT headers:
[CRASHLYTICS LOG DEBUG] User-Agent = firebase-cli;crashlytics-buildtools/2.9.2
[CRASHLYTICS LOG DEBUG] X-CRASHLYTICS-API-CLIENT-TYPE = firebase-cli;crashlytics-buildtools
[CRASHLYTICS LOG DEBUG] X-CRASHLYTICS-API-CLIENT-VERSION = 2.9.2
[CRASHLYTICS LOG DEBUG] PUT response: [reqId=null] 400
......
response: 400 HTTP/1.1 400 Bad Request]
at com.google.firebase.crashlytics.buildtools.api.RestfulWebApi.sendFile(RestfulWebApi.java:109)
at com.google.firebase.crashlytics.buildtools.api.RestfulWebApi.uploadFile(RestfulWebApi.java:119)
at com.google.firebase.crashlytics.buildtools.api.FirebaseSymbolFileService.uploadNativeSymbolFile(FirebaseSymbolFileService.java:35)
at com.google.firebase.crashlytics.buildtools.Buildtools.uploadNativeSymbolFiles(Buildtools.java:301)
at com.google.firebase.crashlytics.buildtools.CommandLineHelper.executeUploadSymbols(CommandLineHelper.java:194)
at com.google.firebase.crashlytics.buildtools.CommandLineHelper.executeCommand(CommandLineHelper.java:120)
at com.google.firebase.crashlytics.buildtools.CommandLineHelper.main(CommandLineHelper.java:65)
at com.google.firebase.crashlytics.buildtools.Buildtools.main(Buildtools.java:111)
Error: java command failed with args: -jar,/Users/rockstar/.cache/firebase/crashlytics/buildtools/crashlytics-buildtools-2.9.2.jar,-symbolGenerator,breakpad,-symbolFileCacheDir,/var/folders/jg/../nativeSymbols/.../breakpad,-verbose,-uploadNativeSymbols,-googleAppId,myId,-clientName,
firebase-cli;crashlytics-buildtools
how can i fix this problem?
is it related to java settings on my mac?
maybe i can use another solution to uploading symbols?
答案1
得分: 2
"我也花了好几周的时间!"
"根据 https://firebase.google.com/docs/crashlytics/get-started?platform=flutter#add-sdk,命令是:"
"firebase crashlytics:symbols:upload --app=APP_ID PATH/TO/symbols"
"你提供的 'APP_ID' 似乎格式错误,所以你收到了 '[reqId=null] 错误'。"
"不要使用类似 'com.myflutterapp' 格式的应用ID。"
"在 Firebase 控制台的项目设置页面中找到你的 'app id',它应该是类似 '1:xxxxx:android:xxxxabc...' 格式的。"
"不要忘记为 Android 和 iOS 应用分别上传符号,替换它们的 'APP_ID'。"
"此外,始终根据构建号来组织你的反混淆符号。否则,'你将无法执行任何操作',上传符号以期望反混淆其他构建的 Crashlytics 日志。"
"Firebase Crashlytics 日志始终显示与之相关的构建ID。例如:"
"Fatal Exception: io.flutter.plugins.firebase.crashlytics.FlutterError: Null check operator used on a null value. Error thrown Instance of 'CD'."
"BuildId: tyb30glke21t763gs87gbbz9dvvs69869vs6"
"当你上传符号时,构建ID会出现在调试日志中,因此你可以检查它是否正在上传到正确的构建。"
英文:
I also spent weeks on that!
As per https://firebase.google.com/docs/crashlytics/get-started?platform=flutter#add-sdk, the command is:
firebase crashlytics:symbols:upload --app=APP_ID PATH/TO/symbols
It seems the APP_ID
you provided is malformed, so you get a "[reqId=null] error".
Do not use your app id formatted like "com.myflutterapp".
Find your app_id in the Firebase console's project settings page.
The "app id" should be the one formatted like 1:xxxxx:android:xxxxabc...
.
Do not forget to upload the symbols for both Android and iOS apps, respectively replacing their APP_IDs.
Moreover, keep always your deobfuscation symbols organized by build number. If not, "you'll do nothing" uploading the symbols from a build expecting to deobfuscate other build's Crashlytics logs.
The Firebase crashlytics logs always show which build id that's related for. Example:
Fatal Exception: io.flutter.plugins.firebase.crashlytics.FlutterError: Null check operator used on a null value. Error thrown Instance of 'CD'.
BuildId: tyb30glke21t763gs87gbbz9dvvs69869vs6
When you upload the symbols, the build id appears in the debug logs so you can check it is being uploading for the right build.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论