Skip to content

Commit 8ce6a6a

Browse files
committed
TF-4268 Fix missing ProGuard Mapping and Debug Symbols file on Sentry dashboard
1 parent 79639ba commit 8ce6a6a

File tree

2 files changed

+13
-25
lines changed

2 files changed

+13
-25
lines changed

.github/workflows/release.yaml

Lines changed: 12 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -93,55 +93,43 @@ jobs:
9393
# --- UPLOAD SENTRY MAPPING AND SYMBOLS FOR ANDROID ---
9494
- name: Upload Android ProGuard Mapping & Dart Debug Symbols to Sentry
9595
if: matrix.os == 'android'
96-
# Run as root to access the build folder and to access pubspec.yaml.
9796
working-directory: .
9897
env:
9998
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
10099
SENTRY_ORG: ${{ secrets.SENTRY_ORG }}
101100
SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }}
102-
GITHUB_SHA: ${{ github.sha }}
103101
run: |
104102
# 1. Install Sentry CLI
105103
curl -sL https://sentry.io/get-cli/ | bash
106104
107-
#2. Get Version from pubspec.yaml
105+
# 2. Get Version from pubspec.yaml
108106
SENTRY_RELEASE=$(grep '^version:' pubspec.yaml | awk '{print $2}')
109107
echo "Processing Sentry Release: $SENTRY_RELEASE"
110108
111-
#3. Create Release
112-
sentry-cli releases new "$SENTRY_RELEASE" --org "$SENTRY_ORG" --project "$SENTRY_PROJECT"
109+
# 3. Create Release
110+
sentry-cli releases new "$SENTRY_RELEASE"
113111
114-
# 4. Upload ProGuard Mapping (mapping.txt) (Java/Kotlin)
115-
# Helps de-obfuscate Android native crashes
116-
# Note: This file is automatically generated during the build release.
117-
# Flutter usually outputs the mapping file at build/app/outputs/mapping/release/mapping.txt
112+
# 4. Upload ProGuard Mapping
118113
MAPPING_FILE="build/app/outputs/mapping/release/mapping.txt"
119114
120115
if [ -f "$MAPPING_FILE" ]; then
121116
echo "Found mapping.txt, uploading ProGuard mapping..."
122-
sentry-cli upload-proguard "$MAPPING_FILE" \
123-
--org "$SENTRY_ORG" \
124-
--project "$SENTRY_PROJECT"
117+
sentry-cli debug-files upload --type proguard "$MAPPING_FILE"
125118
else
126-
echo "::warning::Could not find mapping.txt at $MAPPING_FILE. Ensure your build script does not clean the build folder after deployment."
119+
echo "::error::Could not find mapping.txt at $MAPPING_FILE. Ensure your build script does not clean the build folder after deployment."
120+
exit 1
127121
fi
128122
129123
# 5. Upload Dart Debug Symbols (Native Dart Stacktrace)
130-
# Helps de-obfuscate Flutter/Dart crashes
131-
# Requires: --split-debug-info=build/app/outputs/symbols in your build command
132-
# This file was created by the --split-debug-info command in Fastfile.
133124
SYMBOLS_DIR="build/app/outputs/symbols"
125+
134126
if [ -d "$SYMBOLS_DIR" ]; then
135127
echo "Uploading Dart debug symbols from $SYMBOLS_DIR..."
136-
# This command will find the .symbol files and upload them to Sentry.
137-
sentry-cli debug-files upload "$SYMBOLS_DIR" \
138-
--org "$SENTRY_ORG" \
139-
--project "$SENTRY_PROJECT" \
140-
--auth-token "$SENTRY_AUTH_TOKEN" \
141-
--log-level info
128+
sentry-cli debug-files upload "$SYMBOLS_DIR"
142129
else
143-
echo "::warning::Symbols directory not found at $SYMBOLS_DIR. Did you add --split-debug-info to your build command? Check your Fastfile build arguments."
130+
echo "::error::Symbols directory not found at $SYMBOLS_DIR. Check your Fastfile build arguments."
131+
exit 1
144132
fi
145133
146134
# 6. Finalize
147-
sentry-cli releases finalize "$SENTRY_RELEASE" --org "$SENTRY_ORG" --project "$SENTRY_PROJECT"
135+
sentry-cli releases finalize "$SENTRY_RELEASE"

android/fastlane/Fastfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ platform :android do
3333
build_name = last_git_tag.gsub("v", "")
3434
# Add: --obfuscate --split-debug-info=../build/app/outputs/symbols
3535
# Note: The path starts with ../ because Fastlane runs in the android/ directory.
36-
sh "flutter build appbundle --verbose --release --obfuscate --split-debug-info=../build/app/outputs/symbols --dart-define=SERVER_URL=$SERVER_URL --build-number=#{latest_build_number+1} --build-name=#{build_name}"
36+
sh "cd .. && flutter build appbundle --verbose --release --obfuscate --split-debug-info=build/app/outputs/symbols --dart-define=SERVER_URL=$SERVER_URL --build-number=#{latest_build_number+1} --build-name=#{build_name}"
3737
upload_to_play_store(
3838
json_key_data: ENV["PLAY_STORE_CONFIG_JSON"],
3939
track: track,

0 commit comments

Comments
 (0)