diff --git a/.circleci/config.yml b/.circleci/config.yml index 15c4a9f6..57feac09 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -29,6 +29,9 @@ jobs: - store_artifacts: path: build/app/outputs/apk/release/app-release.apk destination: gitjournal.apk + - run: + name: Upload Crashlytics Symbols + command: ./scripts/android_crashlytics.sh - run: name: Publish Beta command: cd android && fastlane betaBuild diff --git a/android/app/build.gradle b/android/app/build.gradle index 6ae5ec80..92f0fcfd 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -108,3 +108,9 @@ dependencies { apply plugin: 'com.google.gms.google-services' apply plugin: 'io.fabric' + +crashlytics { + enableNdk true + androidNdkOut "../../debugSymbols" + androidNdkLibsOut "../../build/app/intermediates/transforms/stripDebugSymbol/release/0/lib" +} \ No newline at end of file diff --git a/scripts/android_crashlytics.sh b/scripts/android_crashlytics.sh new file mode 100755 index 00000000..7ab306a1 --- /dev/null +++ b/scripts/android_crashlytics.sh @@ -0,0 +1,25 @@ +#!/usr/bin/env bash + +set -x +set -eu + +cd "$(dirname "$0")" +cd ../ + +# Copy mergeJniLibs to debugSymbols +cp -R ./build/app/intermediates/transforms/mergeJniLibs/release/0/lib debugSymbols + +# The libflutter.so here is the same as in the artifacts.zip found with symbols.zip +cd debugSymbols/armeabi-v7a + +# Download the corresponding libflutter.so with debug symbols +ENGINE_VERSION=$(cat $FLUTTER_HOME/bin/internal/engine.version) +gsutil cp gs://flutter_infra/flutter/${ENGINE_VERSION}/android-arm-release/symbols.zip . + +# Replace libflutter.so +unzip -o symbols.zip +rm -rf symbols.zip + +# Upload symbols to Crashlytics +cd ../../android +./gradlew crashlyticsUploadSymbolsRelease