Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug]: flutterfire upload-crashlytics-symbols not working for multi-environment setup #249

Closed
1 task done
stilus-tayyipguzel opened this issue Dec 21, 2023 · 23 comments · Fixed by #260
Closed
1 task done
Labels
bug Something isn't working

Comments

@stilus-tayyipguzel
Copy link

Is there an existing issue for this?

  • I have searched the existing issues.

CLI Version

0.3.0-dev.19

Firebase Tools version

13.0.2

Flutter Doctor Output

fvm flutter doctor -v
[✓] Flutter (Channel stable, 3.13.6, on macOS 13.3.1 22E261 darwin-arm64, locale en-TR)
• Flutter version 3.13.6 on channel stable at /Users/tayyipguzel/fvm/versions/3.13.6
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision ead455963c (3 months ago), 2023-09-26 18:28:17 -0700
• Engine revision a794cf2681
• Dart version 3.1.3
• DevTools version 2.25.0

[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.2)
• Android SDK at /Users/tayyipguzel/Library/Android/sdk
• Platform android-34, build-tools 33.0.2
• ANDROID_HOME = /Users/tayyipguzel/Library/Android/sdk
• Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 11.0.12+0-b1504.28-7817840)
• All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 14.3.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Build 14E300c
• CocoaPods version 1.13.0

[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2021.2)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 11.0.12+0-b1504.28-7817840)

[✓] VS Code (version 1.85.1)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.78.0

[✓] Connected device (3 available)
• sdk gphone arm64 (mobile) • emulator-5554 • android-arm64 • Android 11 (API 30) (emulator)
• macOS (desktop) • macos • darwin-arm64 • macOS 13.3.1 22E261 darwin-arm64
• Chrome (web) • chrome • web-javascript • Google Chrome 120.0.6099.109

[✓] Network resources
• All expected network resources are available.

• No issues found!

Description

I create a new project in flutter version 3.13.6, run the flutterfire configure command and make the necessary installations. Missing dsym files issue seen in firebase. When I check Xcode, I can see the FlutterFire: "flutterfire upload-crashlytics-symbols" script.

#!/bin/bash
PATH=${PATH}:$FLUTTER_ROOT/bin:$HOME/.pub-cache/bin
flutterfire upload-crashlytics-symbols --upload-symbols-script-path=$PODS_ROOT/FirebaseCrashlytics/upload-symbols --platform=ios --apple-project-path=${SRCROOT} --env-platform-name=${PLATFORM_NAME} --env-configuration=${CONFIGURATION} --env-project-dir=${PROJECT_DIR} --env-built-products-dir=${BUILT_PRODUCTS_DIR} --env-dwarf-dsym-folder-path=${DWARF_DSYM_FOLDER_PATH} --env-dwarf-dsym-file-name=${DWARF_DSYM_FILE_NAME} --env-infoplist-path=${INFOPLIST_PATH} --default-config=default

Steps to reproduce

create new flutter project 3.13.6
run flutterfire configure
dsym files not uploaded

Expected behavior

dsym files should be loaded successfully.

Screenshots

Screenshot 2023-12-21 at 11 56 02

Additional context and comments

Android is running successfully.

@stilus-tayyipguzel stilus-tayyipguzel added bug Something isn't working triage labels Dec 21, 2023
@stilus-tayyipguzel
Copy link
Author

@russellwheatley
Copy link
Member

@stilus-tayyipguzel - I tested this on two different projects. Can I see the relevant build logs, please? i.e. flutter run --verbose | tee build.log and pipe the output into a file called build.log and show here. If you wish, you can just find the relevant output by searching for upload-symbols.

@russellwheatley russellwheatley added question Further information is requested triage and removed triage labels Dec 27, 2023
@stilus-tayyipguzel
Copy link
Author

stilus-tayyipguzel commented Dec 28, 2023

@russellwheatley - build-ios.log

  • I see warning bellow.
Warning: firebase_app_id_file.json file does not exist. This may cause issues in upload-symbols. If this error is unexpected, try running flutterfire configure again.
  • There was no change after the flutterfire configure command again.

@russellwheatley
Copy link
Member

russellwheatley commented Dec 28, 2023

You also have the correct logs from you build that show symbols were uploaded:

Running upload-symbols in Build Phase mode
            Validating build environment for Crashlytics...
            Processing dSYMs...
            Successfully submitted symbols for architecture arm64 with UUID 881d2fa256783e798b21869a95eab860 in dSYM: /Users/tayyipguzel/Desktop/crashapp/build/ios/Debug-iphonesimulator/Runner.app.dSYM
            �[32mSuccessfully uploaded Crashlytics build event and symbols�[0m
            Running upload-symbols in Build Phase mode
            Validating build environment for Crashlytics...
            Processing dSYMs...
            Successfully submitted symbols for architecture arm64 with UUID 881d2fa256783e798b21869a95eab860 in dSYM: /Users/tayyipguzel/Desktop/crashapp/build/ios/Debug-iphonesimulator/Runner.app.dSYM
            �[32mSuccessfully uploaded Crashlytics build event and symbols�[0m

Not sure what is going wrong then 🤔. Seems your dSYMs are uploaded.

What does it say in Firebase console when you click on dSYMs tab in Crashlytics?

@stilus-tayyipguzel
Copy link
Author

Screenshot 2023-12-28 at 14 10 22 (2)
Screenshot 2023-12-28 at 14 10 01 (2)

@russellwheatley
Copy link
Member

hmmmm, I wonder if it is a difference between debug build and release build? When I was testing, I was using release builds via flutter build ios --obfuscate --split-debug-info=./ios-build. Could you try this and see if this changes anything?

@stilus-tayyipguzel
Copy link
Author

@russellwheatley When I ran the project via Xcode after running the command you gave, the dsym files were loaded successfully.
Screenshot 2023-12-28 at 15 22 21

@russellwheatley
Copy link
Member

did you run it in debug or release mode?

@stilus-tayyipguzel
Copy link
Author

I have never used the flutter build ios command before, I ran it directly via Xcode after the command. It runs in debug mode by default.

@stilus-tayyipguzel
Copy link
Author

I skipped this step, I dragged and dropped the Runner.app created with the command you gave into the simulator and tried to open it there, but it did not open.

@russellwheatley
Copy link
Member

@stilus-tayyipguzel Does this mean the upload worked when you built your app through Xcode and not via flutter run command? Seems a bit odd to me as my testing was purely through the flutter command in VS code terminal.

I am glad it worked for you eventually, just not quite sure why it didn't happen when you built the app via the terminal particularly as your logs show successful upload of symbols.

@stilus-tayyipguzel
Copy link
Author

@russellwheatley I have a question, what exactly should I do after running the flutter build ios --obfuscate --split-debug-info=./ios-buildcommand you mentioned in the comment? Runner.app file was created. later? I will test again whether the problem is solved when running with Xcode.

@stilus-tayyipguzel
Copy link
Author

@russellwheatley I repeated my previous steps and first ran it in debug mode via vscode. I ran it in debug mode from xcode. Dsym files are not loading at all in my current try. I'm trying by creating a new flutter project and firebase project. You said you tested 2 projects. What steps do you follow when running it?

@russellwheatley
Copy link
Member

@russellwheatley I have a question, what exactly should I do after running the flutter build ios --obfuscate --split-debug-info=./ios-buildcommand you mentioned in the comment? Runner.app file was created. later? I will test again whether the problem is solved when running with Xcode.

You need to flutter install to iPhone device.

@russellwheatley
Copy link
Member

@russellwheatley I repeated my previous steps and first ran it in debug mode via vscode. I ran it in debug mode from xcode. Dsym files are not loading at all in my current try. I'm trying by creating a new flutter project and firebase project. You said you tested 2 projects. What steps do you follow when running it?

  1. flutter create project
  2. flutter pub add firebase_core firebase_crashlytics
  3. Copy/paste the main.dart file from Flutterfire firebase crashlytics example.
  4. Run flutterfire configure --yes --project=project-id --platforms=ios
  5. Run flutter build ios --obfuscate --split-debug-info=./ios-build
  6. Run flutter install on device.
  7. Run app and press buttons for non-fatal and fatal crashes
  8. Viewed deobfuscated crash reports on the Firebase console

@russellwheatley russellwheatley added bug Something isn't working question Further information is requested and removed bug Something isn't working question Further information is requested labels Jan 10, 2024
@tyypgzl
Copy link

tyypgzl commented Feb 20, 2024

@russellwheatley

  • When I follow the steps, there is no problem. But after changing the version from 0.1.0 to 0.2.0 in pubspec.yaml, following the steps and installing the build, the DSYM warning appears again. (When I build with the same version for the second time, the DSYM status changes from missing to uploaded).
Screenshot 2024-02-20 at 17 51 19
  • I also receive a DSYM warning when working in Debug mode.

@RCVZ
Copy link

RCVZ commented Feb 23, 2024

@russellwheatley I encountered the same problem, which seems to be related to the use of flavors. When I turn off the flavors, the uploaded symbols display the correct version and the stacktraces are deobfuscated.

firebase/flutterfire#12283

@AhmedLSayed9
Copy link
Contributor

AhmedLSayed9 commented Feb 23, 2024

I've also encountered the same issue when using flavors as @RCVZ. I've tried building the app on 2 different devices but still no luck.

@techouse
Copy link

Same here. Flavors break it for some reason :(

@russellwheatley
Copy link
Member

@AhmedLSayed9 @RCVZ @techouse

Hey folks,I will look into this but could you tell me about your environments? E.g. are you using the predefined build configurations on flutter or do you have something custom like VGV CLI?

@AhmedLSayed9
Copy link
Contributor

Hey folks,I will look into this but could you tell me about your environments? E.g. are you using the predefined build configurations on flutter or do you have something custom like VGV CLI?

I'm using the predefined build configurations as following:

flutterfire config \
--project=project-id \
--platforms=android,ios \
--out=lib/firebase_options_prod.dart \
--android-package-name=com.example.app \
--ios-bundle-id=com.example.app \
--android-out=/android/app/src/prod/ \
--ios-build-config=Debug-prod \
--ios-out=ios/config/prod/ \
--overwrite-firebase-options \
--yes

@russellwheatley russellwheatley changed the title [bug]: flutterfire upload-crashlytics-symbols not working, missing dsym files issues seen dashboard [bug]: flutterfire upload-crashlytics-symbols not working for multi-environment setup Feb 27, 2024
@russellwheatley
Copy link
Member

I was able to reproduce, I have created a repo which demonstrates the problem here: https://github.com/russellwheatley/crashlytics-symbols

Going to elevate this issue as I don't see what is different to the way we handle the default app configuration. I'll let you know if I have any updates 🙏

@russellwheatley russellwheatley added bug Something isn't working and removed question Further information is requested labels Feb 27, 2024
@tyypgzl
Copy link

tyypgzl commented Feb 27, 2024

@russellwheatley i dont use multi environment. It happens debug mode and when i increase version and create new ipa. I dont understand if it is related to the error I mentioned.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
6 participants