Reputation: 1428
I am developing one Cross-platform app with flutter support. I Integrated firebase Crashlytics for crash reports. before I need to check report one error message comes
Upload 1 missing dSYM required to process 4 crashes
for that, I tried firebase docs
Get deobfuscated crash reports
also, I followed steps to build iOS Archive with flutter
Preparing an iOS App for Release
Still, There is the same issue on firebase portal
Upload 1 missing dSYM required to process 4 crashes
I tried this many times but still not done yet.
If someone has Idea then please help me to fix this issue.
Thanks, Community
Upvotes: 40
Views: 27324
Reputation: 15457
After building an Archive of your Flutter app (using Xcode), you can run the following command from your Flutter App's ios
directory (using Firebase's upload tool):
Pods/FirebaseCrashlytics/upload-symbols -gsp /path/to/GoogleService-Info.plist -p ios /path/to/Runner.xcarchive/dSYMs
Change the above command line to point to the correct Firebase plist file. the -p
flag specifies platform (which can be ios
, mac
, or tvos
). The above command will also look for the App's archive file Runner.xcarchive
.
Upvotes: 10
Reputation: 41
Preparing a dSYM file
In most cases when you are working in Crashlytics in Firebase, you are required to upload a dSYM file. Here's how you can prepare the dSYM file.
In your Flutter project navigate to your iOS file from command-line.
type cd/ios
and open Runner.xcworkspace
. This will launch Xcode.
Select Runner from the left side and navigate to Debug Information Format inside Build Settings.
Change everything to DWARF with dSYM File.
Archive the project and select the recent archive inside Organizer.
Left click the recent archive and choose Show in Finder option.
Left click again and pick Show Package Contents.
Compress all the dSYM file into one zip file and upload it in Firebase.
Note: You will need a Mac to do all of the above.
Upvotes: 4
Reputation: 11
I had this issue and none of the above worked for me. I'm using flutter 3.24.1 and firebase_crashlytics 3.5.7 with firebase_core 2.24.2.
What worked for me was to create the following script as the last script to run on build phases in XCode. So try using the following steps:
Create a new script on build phases (XCode>targets>runner>Build Phases> + )
Copy and paste the following as-is in the shell space:
"${PODS_ROOT}/FirebaseCrashlytics/upload-symbols" -gsp "${PROJECT_DIR}/Runner/GoogleService-Info.plist" -p ios "${DWARF_DSYM_FOLDER_PATH}/${DWARF_DSYM_FILE_NAME}"
${DWARF_DSYM_FOLDER_PATH}/${DWARF_DSYM_FILE_NAME} ${DWARF_DSYM_FOLDER_PATH}/${DWARF_DSYM_FILE_NAME}/Contents/Resources/DWARF/${PRODUCT_NAME} ${DWARF_DSYM_FOLDER_PATH}/${DWARF_DSYM_FILE_NAME}/Contents/Info.plist $(BUILT_PRODUCTS_DIR)/$(UNLOCALIZED_RESOURCES_FOLDER_PATH)/GoogleService-Info.plist $(BUILT_PRODUCTS_DIR)/$(EXECUTABLE_PATH)
Upvotes: 1
Reputation: 1573
With recent version of flutter/crashlytics, adding
-ai "[App ID]"
into
Runner -> Build Phases -> [firebase_crashlytics] Crashlytics Upload Symbols
was the only thing that was needed in my case.
Full line looks like this:
"$PODS_ROOT/FirebaseCrashlytics/upload-symbols" --flutter-project "$PROJECT_DIR/firebase_app_id_file.json" -ai "1:my_apple_app_id"
Flutter 3.16.5
firebase_crashlytics: ^3.4.9
Docs: https://firebase.google.com/docs/crashlytics/get-deobfuscated-reports?platform=flutter
Upvotes: 0
Reputation: 1167
OPTION 1
I use this Run Script to automate the process
if [ "${CONFIGURATION}" = "Release" ]; then
GOOGLESERVICE_INFO_PLIST=GoogleService-Info.plist
GOOGLESERVICE_INFO_FILE="/path/to/GoogleService-Info.plist"
# (Usually "${PROJECT_DIR}/Runner/GoogleService-Info.plist")
if [ -f "$GOOGLESERVICE_INFO_FILE" ]; then
echo "Using GoogleService-Info.plist from ${GOOGLESERVICE_INFO_FILE}"
# Get GOOGLE_APP_ID from GoogleService-Info.plist file
APP_ID="$(grep -A1 GOOGLE_APP_ID ${GOOGLESERVICE_INFO_FILE} | tail -n1 | sed -e 's/.*\<string\>\(.*\)\<\/string\>/\1/')"
# Run scripts to upload dSYMs to Firebase crashlytics
"$PODS_ROOT/FirebaseCrashlytics/run" -ai "${APP_ID}"
"$PODS_ROOT/FirebaseCrashlytics/upload-symbols" --build-phase --validate -ai "${APP_ID}"
"$PODS_ROOT/FirebaseCrashlytics/upload-symbols" --build-phase -ai "${APP_ID}"
"$PODS_ROOT/FirebaseCrashlytics/upload-symbols" -gsp "${GOOGLESERVICE_INFO_FILE}" -p ios "${DWARF_DSYM_FOLDER_PATH}/${DWARF_DSYM_FILE_NAME}" -ai "${APP_ID}"
echo "Successfully uploaded dSYMs to Firebase Crashlytics!"
else
echo "GoogleService-Info.plist not found in ${GOOGLESERVICE_INFO_FILE}"
fi
fi
OPTION 2
However, if you're like me and you have build schemes for your app (like Release-dev, Release-prod, Release-beta); then do this instead,
Ensure you have setup your build schemes correctly, else the next steps will probably not work for you. PS: I use this medium post.
Ensure you have GoogleService-Info.plist for each scheme in separate folders; IMPORTANT: Your folder structure should look something like this:
config
|
|
--- dev -- GoogleService-Info.plist
|
|
--- beta -- GoogleService-Info.plist
|
|
--- prod -- GoogleService-Info.plist
DWARF with dSYM File
Then add a Run Script with name [firebase_crashlytics] Upload dSYMs to Firebase Crashlytics
(or whatever).
Copy & paste the below in the script section:
if [ "${CONFIGURATION}" = "Release" ]; then
environment="default"
# Set the current build environment / scheme
if [[ $CONFIGURATION =~ -([^-]*)$ ]]; then
environment=${BASH_REMATCH[1]}
fi
GOOGLESERVICE_INFO_PLIST=GoogleService-Info.plist
# And here you can see why that folder structure is important.
GOOGLESERVICE_INFO_FILE=${PROJECT_DIR}/config/${environment}/${GOOGLESERVICE_INFO_PLIST}
if [ -f "$GOOGLESERVICE_INFO_FILE" ]; then
echo "Using GoogleService-Info.plist from ${GOOGLESERVICE_INFO_FILE}"
# Get GOOGLE_APP_ID from GoogleService-Info.plist file
APP_ID="$(grep -A1 GOOGLE_APP_ID ${GOOGLESERVICE_INFO_FILE} | tail -n1 | sed -e 's/.*\<string\>\(.*\)\<\/string\>/\1/')"
# Run scripts to upload dSYMs to Firebase crashlytics
"${PODS_ROOT}/FirebaseCrashlytics/run" -ai "${APP_ID}"
"$PODS_ROOT/FirebaseCrashlytics/upload-symbols" --build-phase --validate -ai "${APP_ID}"
"$PODS_ROOT/FirebaseCrashlytics/upload-symbols" --build-phase -ai "${APP_ID}"
"${PODS_ROOT}/FirebaseCrashlytics/upload-symbols" -gsp "${GOOGLESERVICE_INFO_FILE}" -p ios "${DWARF_DSYM_FOLDER_PATH}/${DWARF_DSYM_FILE_NAME}" -ai "${APP_ID}"
echo "Successfully uploaded dSYMs to Firebase Crashlytics!"
else
echo "GoogleService-Info.plist not found in ${GOOGLESERVICE_INFO_FILE}"
fi
fi
${DWARF_DSYM_FOLDER_PATH}/${DWARF_DSYM_FILE_NAME}/Contents/Resources/DWARF/${TARGET_NAME}
$(SRCROOT)/$(BUILT_PRODUCTS_DIR)/$(INFOPLIST_PATH)
See the Firebase docs for more info
That's all!
Upvotes: 5
Reputation: 32529
Currently, a recommended approach is to add a Run Script Phase that uploads dSYMs to Crashlytics on every build.
$PODS_ROOT/FirebaseCrashlytics/upload-symbols --build-phase --validate -ai <googleAppId>
$PODS_ROOT/FirebaseCrashlytics/upload-symbols --build-phase -ai <googleAppId>
Retrieve your <googleAppId>
from your generated DefaultFirebaseOptions file (appId) or from the Firebase Console -> Project Settings -> Your apps.
Taken from here
Upvotes: 3
Reputation: 7985
I. Open Xcode > Targets > MyProjectName > Build phases
Add two scripts (using + sign) consisting of each of these
"${PODS_ROOT}/FirebaseCrashlytics/run"
"${PODS_ROOT}/FirebaseCrashlytics/upload-symbols" -gsp "${PROJECT_DIR}/MyProjectName/GoogleService-Info.plist" -p ios "${DWARF_DSYM_FOLDER_PATH}/${DWARF_DSYM_FILE_NAME}"
Important: Make sure to replace
MyProjectName
with your project name but leave rest as it is.
II. Also make sure to check these options in Targets > MyProjectName > Build settings
Set Debug information format to DWARF with dSYM file
Upvotes: 43
Reputation: 9755
you can use Fastlane
to automate also this as part of release process.
here's an example that can go into your Fastfile
platform :ios do
desc "Upload symbols to Crashlytics"
lane :toCrashlytics do
upload_symbols_to_crashlytics
end
end
then you can run fastlane ios toCrashlytics
to run it.
see this link for more details.
Upvotes: 9
Reputation: 731
When preparing my app for release I take these steps to export, upload, and get the dSYM's:
Upvotes: 26