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

[firebase_crashlytics]: Crashlytics build step crashes build of a macOS app - upload-symbols[44583:605681] Unable to get file attributes for dSYM file at path #12990

Closed
1 task done
tpkowastaken opened this issue Jun 23, 2024 · 5 comments
Labels
platform: macos Issues / PRs which are specifically for MacOS. plugin: crashlytics resolution: user This was a user issue, e.g. invalid configuration or code. type: bug Something isn't working

Comments

@tpkowastaken
Copy link

tpkowastaken commented Jun 23, 2024

Is there an existing issue for this?

  • I have searched the existing issues.

Which plugins are affected?

Crashlytics

Which platforms are affected?

macOS

Description

Whenever you want to build macOS (both for debug and release) with crashlytics in it, it just crashes. This is even after a fresh creation of the project.

Expected result:
FlutterFire: "flutterfire upload-crashlytics-symbols" build step uploads the symbols to crashlytics

Actual result:
FlutterFire: "flutterfire upload-crashlytics-symbols" build step doesn't find the dSYM files.

Reproducing the issue

  1. Create a new flutter project with flutter create --org cz.appelevate coreee and a new firebase project
  2. cd into this project - cd coreee
  3. add firebase into this project:
flutter pub add firebase_core
flutterfire configure
  1. add firebase analytics
flutter pub add firebase_analytics
flutterfire configure
  1. add firebase crashlytics
flutter pub add firebase_crashlytics
flutterfire configure
  1. add both to the main.dart file
import 'package:coreee/firebase_options.dart';
import 'package:firebase_core/firebase_core.dart';
import 'package:firebase_crashlytics/firebase_crashlytics.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';

void main() async {
  WidgetsFlutterBinding.ensureInitialized();
  await Firebase.initializeApp(
    options: DefaultFirebaseOptions.currentPlatform,
  );
  FlutterError.onError = (errorDetails) {
    FirebaseCrashlytics.instance.recordFlutterFatalError(errorDetails);
  };
  // Pass all uncaught asynchronous errors that aren't handled by the Flutter framework to Crashlytics
  PlatformDispatcher.instance.onError = (error, stack) {
    FirebaseCrashlytics.instance.recordError(error, stack, fatal: true);
    return true;
  };
  runApp(const MyApp());
}
flutter run -d macos
  1. tadaa you get the error :/

Firebase Core version

3.1.0

Flutter Version

Flutter 3.22.2 • channel stable

FlutterFire Cli Version

1.0.0

Relevant Log Output

Launching lib/main.dart on macOS in debug mode...
Running pod install...                                           1,672ms
--- xcodebuild: WARNING: Using the first of multiple matching destinations:
{ platform:macOS, arch:arm64, id:00006030-000859D11482001C, name:My Mac }
{ platform:macOS, arch:x86_64, id:00006030-000859D11482001C, name:My Mac }
ld: warning: ignoring duplicate libraries: '-lc++'
Unhandled exception:
Exception: 2024-06-23 20:03:52.652 upload-symbols[44583:605681] Unable to get file attributes for dSYM file at path "/Users/tom/programming/appe/oh/coreee/build/macos/Build/Products/Debug/coreee.app.dSYM/Contents/Resources/DWARF"
2024-06-23 20:03:53.658 upload-symbols[44583:605681] Unable to get file attributes for dSYM file at path "/Users/tom/programming/appe/oh/coreee/build/macos/Build/Products/Debug/coreee.app.dSYM/Contents/Resources/DWARF"
2024-06-23 20:03:54.663 upload-symbols[44583:605681] Unable to get file attributes for dSYM file at path "/Users/tom/programming/appe/oh/coreee/build/macos/Build/Products/Debug/coreee.app.dSYM/Contents/Resources/DWARF"
2024-06-23 20:03:55.665 upload-symbols[44583:605681] Unable to get file attributes for dSYM file at path "/Users/tom/programming/appe/oh/coreee/build/macos/Build/Products/Debug/coreee.app.dSYM/Contents/Resources/DWARF"
2024-06-23 20:03:56.667 upload-symbols[44583:605681] Unable to get file attributes for dSYM file at path "/Users/tom/programming/appe/oh/coreee/build/macos/Build/Products/Debug/coreee.app.dSYM/Contents/Resources/DWARF"
2024-06-23 20:03:57.672 upload-symbols[44583:605681] Unable to get file attributes for dSYM file at path "/Users/tom/programming/appe/oh/coreee/build/macos/Build/Products/Debug/coreee.app.dSYM/Contents/Resources/DWARF"
2024-06-23 20:03:58.677 upload-symbols[44583:605681] Unable to get file attributes for dSYM file at path "/Users/tom/programming/appe/oh/coreee/build/macos/Build/Products/Debug/coreee.app.dSYM/Contents/Resources/DWARF"
2024-06-23 20:03:59.682 upload-symbols[44583:605681] Unable to get file attributes for dSYM file at path "/Users/tom/programming/appe/oh/coreee/build/macos/Build/Products/Debug/coreee.app.dSYM/Contents/Resources/DWARF"
2024-06-23 20:04:00.688 upload-symbols[44583:605681] Unable to get file attributes for dSYM file at path "/Users/tom/programming/appe/oh/coreee/build/macos/Build/Products/Debug/coreee.app.dSYM/Contents/Resources/DWARF"
2024-06-23 20:04:01.693 upload-symbols[44583:605681] Unable to get file attributes for dSYM file at path "/Users/tom/programming/appe/oh/coreee/build/macos/Build/Products/Debug/coreee.app.dSYM/Contents/Resources/DWARF"
2024-06-23 20:04:02.694 upload-symbols[44583:605681] Unable to get file attributes for dSYM file at path "/Users/tom/programming/appe/oh/coreee/build/macos/Build/Products/Debug/coreee.app.dSYM/Contents/Resources/DWARF"
2024-06-23 20:04:03.698 upload-symbols[44583:605681] Unable to get file attributes for dSYM file at path "/Users/tom/programming/appe/oh/coreee/build/macos/Build/Products/Debug/coreee.app.dSYM/Contents/Resources/DWARF"
2024-06-23 20:04:04.700 upload-symbols[44583:605681] Unable to get file attributes for dSYM file at path "/Users/tom/programming/appe/oh/coreee/build/macos/Build/Products/Debug/coreee.app.dSYM/Contents/Resources/DWARF"
2024-06-23 20:04:05.706 upload-symbols[44583:605681] Unable to get file attributes for dSYM file at path "/Users/tom/programming/appe/oh/coreee/build/macos/Build/Products/Debug/coreee.app.dSYM/Contents/Resources/DWARF"
2024-06-23 20:04:06.710 upload-symbols[44583:605681] Unable to get file attributes for dSYM file at path "/Users/tom/programming/appe/oh/coreee/build/macos/Build/Products/Debug/coreee.app.dSYM/Contents/Resources/DWARF"
2024-06-23 20:04:07.716 upload-symbols[44583:605681] Unable to get file attributes for dSYM file at path "/Users/tom/programming/appe/oh/coreee/build/macos/Build/Products/Debug/coreee.app.dSYM/Contents/Resources/DWARF"
2024-06-23 20:04:08.721 upload-symbols[44583:605681] Unable to get file attributes for dSYM file at path "/Users/tom/programming/appe/oh/coreee/build/macos/Build/Products/Debug/coreee.app.dSYM/Contents/Resources/DWARF"
2024-06-23 20:04:09.726 upload-symbols[44583:605681] Unable to get file attributes for dSYM file at path "/Users/tom/programming/appe/oh/coreee/build/macos/Build/Products/Debug/coreee.app.dSYM/Contents/Resources/DWARF"
2024-06-23 20:04:10.729 upload-symbols[44583:605681] Unable to get file attributes for dSYM file at path "/Users/tom/programming/appe/oh/coreee/build/macos/Build/Products/Debug/coreee.app.dSYM/Contents/Resources/DWARF"
2024-06-23 20:04:11.735 upload-symbols[44583:605681] Unable to get file attributes for dSYM file at path "/Users/tom/programming/appe/oh/coreee/build/macos/Build/Products/Debug/coreee.app.dSYM/Contents/Resources/DWARF"
2024-06-23 20:04:12.740 upload-symbols[44583:605681] Unable to get file attributes for dSYM file at path "/Users/tom/programming/appe/oh/coreee/build/macos/Build/Products/Debug/coreee.app.dSYM/Contents/Resources/DWARF"
2024-06-23 20:04:13.746 upload-symbols[44583:605681] Unable to get file attributes for dSYM file at path "/Users/tom/programming/appe/oh/coreee/build/macos/Build/Products/Debug/coreee.app.dSYM/Contents/Resources/DWARF"
2024-06-23 20:04:14.751 upload-symbols[44583:605681] Unable to get file attributes for dSYM file at path "/Users/tom/programming/appe/oh/coreee/build/macos/Build/Products/Debug/coreee.app.dSYM/Contents/Resources/DWARF"
2024-06-23 20:04:15.752 upload-symbols[44583:605681] Unable to get file attributes for dSYM file at path "/Users/tom/programming/appe/oh/coreee/build/macos/Build/Products/Debug/coreee.app.dSYM/Contents/Resources/DWARF"
2024-06-23 20:04:16.757 upload-symbols[44583:605681] Unable to get file attributes for dSYM file at path "/Users/tom/programming/appe/oh/coreee/build/macos/Build/Products/Debug/coreee.app.dSYM/Contents/Resources/DWARF"
2024-06-23 20:04:17.763 upload-symbols[44583:605681] Unable to get file attributes for dSYM file at path "/Users/tom/programming/appe/oh/coreee/build/macos/Build/Products/Debug/coreee.app.dSYM/Contents/Resources/DWARF"
2024-06-23 20:04:18.768 upload-symbols[44583:605681] Unable to get file attributes for dSYM file at path "/Users/tom/programming/appe/oh/coreee/build/macos/Build/Products/Debug/coreee.app.dSYM/Contents/Resources/DWARF"
2024-06-23 20:04:19.771 upload-symbols[44583:605681] Unable to get file attributes for dSYM file at path "/Users/tom/programming/appe/oh/coreee/build/macos/Build/Products/Debug/coreee.app.dSYM/Contents/Resources/DWARF"
2024-06-23 20:04:20.774 upload-symbols[44583:605681] Unable to get file attributes for dSYM file at path "/Users/tom/programming/appe/oh/coreee/build/macos/Build/Products/Debug/coreee.app.dSYM/Contents/Resources/DWARF"
2024-06-23 20:04:21.778 upload-symbols[44583:605681] Unable to get file attributes for dSYM file at path "/Users/tom/programming/appe/oh/coreee/build/macos/Build/Products/Debug/coreee.app.dSYM/Contents/Resources/DWARF"
2024-06-23 20:04:22.784 upload-symbols[44583:605681] Unable to get file attributes for dSYM file at path "/Users/tom/programming/appe/oh/coreee/build/macos/Build/Products/Debug/coreee.app.dSYM/Contents/Resources/DWARF"

#0      UploadCrashlyticsSymbols.run (package:flutterfire_cli/src/commands/upload_symbols.dart:406:7)
<asynchronous suspension>
#1      CommandRunner.runCommand (package:args/command_runner.dart:212:13)
<asynchronous suspension>
#2      main (file:///Users/tom/.pub-cache/hosted/pub.dev/flutterfire_cli-1.0.0/bin/flutterfire.dart:63:5)
<asynchronous suspension>
Command PhaseScriptExecution failed with a nonzero exit code






/Users/tom/programming/appe/oh/coreee/macos/Pods/Pods.xcodeproj: warning: The macOS deployment target 'MACOSX_DEPLOYMENT_TARGET' is set to 10.11, but the range of supported deployment target versions is 10.13 to 14.5.99. (in target 'nanopb' from project 'Pods')
/Users/tom/programming/appe/oh/coreee/macos/Pods/Pods.xcodeproj: warning: The macOS deployment target 'MACOSX_DEPLOYMENT_TARGET' is set to 10.11, but the range of supported deployment target versions is 10.13 to 14.5.99. (in target 'PromisesObjC' from project 'Pods')
/Users/tom/programming/appe/oh/coreee/macos/Pods/Pods.xcodeproj: warning: The macOS deployment target 'MACOSX_DEPLOYMENT_TARGET' is set to 10.11, but the range of supported deployment target versions is 10.13 to 14.5.99. (in target 'PromisesSwift-Promises_Privacy' from project 'Pods')
/Users/tom/programming/appe/oh/coreee/macos/Pods/Pods.xcodeproj: warning: The macOS deployment target 'MACOSX_DEPLOYMENT_TARGET' is set to 10.11, but the range of supported deployment target versions is 10.13 to 14.5.99. (in target 'PromisesSwift' from project 'Pods')
/Users/tom/programming/appe/oh/coreee/macos/Pods/Pods.xcodeproj: warning: The macOS deployment target 'MACOSX_DEPLOYMENT_TARGET' is set to 10.12, but the range of supported deployment target versions is 10.13 to 14.5.99. (in target 'GoogleDataTransport-GoogleDataTransport_Privacy' from project 'Pods')
/Users/tom/programming/appe/oh/coreee/macos/Pods/Pods.xcodeproj: warning: The macOS deployment target 'MACOSX_DEPLOYMENT_TARGET' is set to 10.12, but the range of supported deployment target versions is 10.13 to 14.5.99. (in target 'GoogleDataTransport' from project 'Pods')
/Users/tom/programming/appe/oh/coreee/macos/Pods/Pods.xcodeproj: warning: The macOS deployment target 'MACOSX_DEPLOYMENT_TARGET' is set to 10.11, but the range of supported deployment target versions is 10.13 to 14.5.99. (in target 'nanopb-nanopb_Privacy' from project 'Pods')
/Users/tom/programming/appe/oh/coreee/macos/Pods/Pods.xcodeproj: warning: The macOS deployment target 'MACOSX_DEPLOYMENT_TARGET' is set to 10.11, but the range of supported deployment target versions is 10.13 to 14.5.99. (in target 'PromisesObjC-FBLPromises_Privacy' from project 'Pods')
/Users/tom/programming/appe/oh/coreee/macos/Pods/Pods.xcodeproj: warning: The macOS deployment target 'MACOSX_DEPLOYMENT_TARGET' is set to 10.12, but the range of supported deployment target versions is 10.13 to 14.5.99. (in target 'GoogleUtilities' from project 'Pods')
/Users/tom/programming/appe/oh/coreee/macos/Pods/Pods.xcodeproj: warning: The macOS deployment target 'MACOSX_DEPLOYMENT_TARGET' is set to 10.12, but the range of supported deployment target versions is 10.13 to 14.5.99. (in target 'GoogleUtilities-GoogleUtilities_Privacy' from project 'Pods')
warning: Run script build phase 'FlutterFire: "flutterfire upload-crashlytics-symbols"' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'Runner' from project 'Runner')
** BUILD FAILED **

Building macOS application...                                           
Error: Build process failed

Flutter dependencies

Expand Flutter dependencies snippet
Dart SDK 3.4.3
Flutter SDK 3.22.2
coreee 1.0.0+1

dependencies:
- cupertino_icons 1.0.8
- firebase_analytics 11.0.1 [firebase_analytics_platform_interface firebase_analytics_web firebase_core firebase_core_platform_interface flutter]
- firebase_core 3.1.0 [firebase_core_platform_interface firebase_core_web flutter meta]
- firebase_crashlytics 4.0.1 [firebase_core firebase_core_platform_interface firebase_crashlytics_platform_interface flutter stack_trace]
- flutter 0.0.0 [characters collection material_color_utilities meta vector_math sky_engine]

dev dependencies:
- flutter_lints 3.0.2 [lints]
- flutter_test 0.0.0 [flutter test_api matcher path fake_async clock stack_trace vector_math leak_tracker_flutter_testing async boolean_selector characters collection leak_tracker leak_tracker_testing material_color_utilities meta source_span stream_channel string_scanner term_glyph vm_service]

transitive dependencies:
- _flutterfire_internals 1.3.37 [collection firebase_core firebase_core_platform_interface flutter meta]
- async 2.11.0 [collection meta]
- boolean_selector 2.1.1 [source_span string_scanner]
- characters 1.3.0
- clock 1.1.1
- collection 1.18.0
- fake_async 1.3.1 [clock collection]
- firebase_analytics_platform_interface 4.0.1 [_flutterfire_internals firebase_core flutter meta plugin_platform_interface]
- firebase_analytics_web 0.5.7+9 [_flutterfire_internals firebase_analytics_platform_interface firebase_core firebase_core_web flutter flutter_web_plugins]
- firebase_core_platform_interface 5.1.0 [collection flutter flutter_test meta plugin_platform_interface]
- firebase_core_web 2.17.2 [firebase_core_platform_interface flutter flutter_web_plugins meta web]
- firebase_crashlytics_platform_interface 3.6.37 [_flutterfire_internals collection firebase_core flutter meta plugin_platform_interface]
- flutter_web_plugins 0.0.0 [flutter characters collection material_color_utilities meta vector_math]
- leak_tracker 10.0.4 [clock collection meta path vm_service]
- leak_tracker_flutter_testing 3.0.3 [flutter leak_tracker leak_tracker_testing matcher meta]
- leak_tracker_testing 3.0.1 [leak_tracker matcher meta]
- lints 3.0.0
- matcher 0.12.16+1 [async meta stack_trace term_glyph test_api]
- material_color_utilities 0.8.0 [collection]
- meta 1.12.0
- path 1.9.0
- plugin_platform_interface 2.1.8 [meta]
- sky_engine 0.0.99
- source_span 1.10.0 [collection path term_glyph]
- stack_trace 1.11.1 [path]
- stream_channel 2.1.2 [async]
- string_scanner 1.2.0 [source_span]
- term_glyph 1.2.1
- test_api 0.7.0 [async boolean_selector collection meta source_span stack_trace stream_channel string_scanner term_glyph]
- vector_math 2.1.4
- vm_service 14.2.1
- web 0.5.1

Additional context and comments

I'm running this on latest macos (14.5 (23F79)) on M3 pro.

There is also no firebase_app_id_file.json in macos directory.

If you check the "For install builds only" it only moves the problem to the upload to playstore build.

Flutter doctor -v:

[✓] Flutter (Channel stable, 3.22.2, on macOS 14.5 23F79 darwin-arm64, locale en-US)
    • Flutter version 3.22.2 on channel stable at /Users/tom/development/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 761747bfc5 (3 weeks ago), 2024-06-05 22:15:13 +0200
    • Engine revision edd8546116
    • Dart version 3.4.3
    • DevTools version 2.34.3

[✓] Android toolchain - develop for Android devices (Android SDK version 35.0.0)
    • Android SDK at /Users/tom/Library/Android/sdk
    • Platform android-35, build-tools 35.0.0
    • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 17.0.10+0-17.0.10b1087.21-11609105)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 15.4)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 15F31d
    • CocoaPods version 1.15.2

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

[✓] Android Studio (version 2024.1)
    • 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 17.0.10+0-17.0.10b1087.21-11609105)

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

[✓] Connected device (5 available)
-     **hiden for privacy reasons**

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

• No issues found!
@tpkowastaken tpkowastaken added Needs Attention This issue needs maintainer attention. type: bug Something isn't working labels Jun 23, 2024
@tpkowastaken
Copy link
Author

tpkowastaken commented Jun 23, 2024

The fix is to simply Click the allow install builds only in xcode for the FlutterFire: "flutterfire upload-crashlytics-symbols" build step. Please add that to the flutterfire cli
image

edit: this only moves the problem to the release build state.

A temporary workaround is to use the legacy script:

"$PODS_ROOT/FirebaseCrashlytics/upload-symbols" --flutter-project "$PROJECT_DIR/firebase_app_id_file.json" 

and add input files:

"${DWARF_DSYM_FOLDER_PATH}/${DWARF_DSYM_FILE_NAME}"
"${DWARF_DSYM_FOLDER_PATH}/${DWARF_DSYM_FILE_NAME}/Contents/"
"${DWARF_DSYM_FOLDER_PATH}/${DWARF_DSYM_FILE_NAME}/Contents/Info.plist"
"$(TARGET_BUILD_DIR)/$(EXECUTABLE_PATH)"
"$(PROJECT_DIR)/firebase_app_id_file.json"

and check the For install build only

It should now look like this:
image

Now you need to create the firebase_app_id_file.json in the macos/firebase_app_id_file.json:

{
  "file_generated_by": "FlutterFire CLI",
  "purpose": "FirebaseAppID & ProjectID for this Firebase app in this directory",
  "GOOGLE_APP_ID": "[ios project id]",
  "FIREBASE_PROJECT_ID": "app-elevate-core",
  "GCM_SENDER_ID": "[GCM sender id]"
}

*You can find the values in [] in your GoogleService-Info.plist

PS: this is just a temporary workaround. Everytime you run flutterfire configure this gets reset. My way of keeping the changes is reverting macos/Runner.xcodeproj/project.pbxproj file back using git every time i run flutterfire configure.

Edit: I just tried it again and even this doesn't work. I still can't figure out why. I'm going to leave this to maintainers of flutterfire cli

@TarekkMA
Copy link
Contributor

TarekkMA commented Jun 25, 2024

@tpkowastaken Thank you for reporting this issue, and I'm glad that you found a solution for it. I've informed the team about updating the CLI docs to avoid any issues in the future.

@TarekkMA TarekkMA added plugin: crashlytics platform: macos Issues / PRs which are specifically for MacOS. resolution: user This was a user issue, e.g. invalid configuration or code. and removed Needs Attention This issue needs maintainer attention. labels Jun 25, 2024
@tpkowastaken
Copy link
Author

tpkowastaken commented Jun 25, 2024

@TarekkMA
Thank you for your answer I appreciate the quick response.
Hovewer shouldn't you forward it to the dev team instead? It shouldn't take too long to fix this. I believe it's just a simple edit of the Runner.xcworkspace that the flutterfire cli is already editing to put the bugged task in there already.
I wish you luck with resolving the issue internally and thank you for your effort.

@TarekkMA
Copy link
Contributor

@tpkowastaken Can you open this issue again in https://github.com/invertase/flutterfire_cli

@tpkowastaken
Copy link
Author

My bad I haven't tested releasing the app yet. The script crashes even after that change when you try to release it. There is hovewer an issue already created - invertase/flutterfire_cli#314. I'm going to move the conversation there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
platform: macos Issues / PRs which are specifically for MacOS. plugin: crashlytics resolution: user This was a user issue, e.g. invalid configuration or code. type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants