From ef396931710b9ddf95ce935c40a295b7daf122d8 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Tue, 25 Nov 2025 20:16:31 +0000 Subject: [PATCH 01/10] feat: Add Sentry size analysis GitHub workflow This commit introduces a new GitHub Actions workflow to perform size analysis for Android and iOS builds using Sentry. The workflow is triggered on push to main/release branches and pull requests. It builds the app bundles/archives, uploads them to Sentry, and includes information about the commit SHA, repository, and branch for comparison. Co-authored-by: giancarlo.buenaflor --- .github/workflows/size-analysis.yml | 186 ++++++++++++++++++++++++++++ 1 file changed, 186 insertions(+) create mode 100644 .github/workflows/size-analysis.yml diff --git a/.github/workflows/size-analysis.yml b/.github/workflows/size-analysis.yml new file mode 100644 index 0000000000..f906b482b4 --- /dev/null +++ b/.github/workflows/size-analysis.yml @@ -0,0 +1,186 @@ +name: Size Analysis + +on: + push: + branches: + - main + - release/** + paths: + - '.github/workflows/size-analysis.yml' + - 'packages/dart/**' + - 'packages/flutter/**' + - '!**/*.md' + pull_request: + paths: + - '.github/workflows/size-analysis.yml' + - 'packages/dart/**' + - 'packages/flutter/**' + - '!**/*.md' + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +env: + SENTRY_ORG: sentry-sdks + SENTRY_PROJECT: sentry-flutter + SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} + +jobs: + size-analysis-android: + name: Android Size Analysis + runs-on: ubuntu-latest + timeout-minutes: 30 + defaults: + run: + working-directory: packages/flutter/example + + steps: + - uses: actions/checkout@v5 + with: + fetch-depth: 0 + + - name: Read configured Flutter SDK version + id: conf + run: | + version=$(grep "version" ../../../metrics/flutter.properties | cut -d'=' -f2 | xargs) + echo "flutter=$version" >> "$GITHUB_OUTPUT" + + - name: Install Flutter v${{ steps.conf.outputs.flutter }} + uses: subosito/flutter-action@fd55f4c5af5b953cc57a2be44cb082c8f6635e8e # pin@v2.21.0 + with: + flutter-version: ${{ steps.conf.outputs.flutter }} + + - uses: actions/setup-java@v5 + with: + java-version: '17' + distribution: 'adopt' + + - name: Build Android App Bundle (Release) + run: | + flutter pub get + flutter build appbundle --release + + - name: Install Sentry CLI + if: env.SENTRY_AUTH_TOKEN != '' + run: curl -sL https://sentry.io/get-cli/ | sh + + - name: Get merge base SHA + id: merge-base + if: env.SENTRY_AUTH_TOKEN != '' + run: | + if [ "${{ github.event_name }}" == "pull_request" ]; then + BASE_SHA="${{ github.event.pull_request.base.sha }}" + else + BASE_SHA=$(git merge-base HEAD origin/main || echo "${{ github.event.before }}") + fi + echo "sha=$BASE_SHA" >> "$GITHUB_OUTPUT" + + - name: Upload Android AAB to Sentry Size Analysis + if: env.SENTRY_AUTH_TOKEN != '' + run: | + UPLOAD_ARGS=( + "build/app/outputs/bundle/release/app-release.aab" + "--org" "${{ env.SENTRY_ORG }}" + "--project" "${{ env.SENTRY_PROJECT }}" + "--build-configuration" "Release" + "--head-sha" "${{ github.event.pull_request.head.sha || github.sha }}" + "--head-repo-name" "${{ github.repository }}" + "--head-ref" "${{ github.head_ref || github.ref_name }}" + "--base-ref" "${{ github.base_ref || 'main' }}" + ) + + if [ -n "${{ steps.merge-base.outputs.sha }}" ]; then + UPLOAD_ARGS+=("--base-sha" "${{ steps.merge-base.outputs.sha }}") + fi + + if [ -n "${{ github.event.pull_request.number }}" ]; then + UPLOAD_ARGS+=("--pr-number" "${{ github.event.pull_request.number }}") + fi + + sentry-cli build upload "${UPLOAD_ARGS[@]}" + + size-analysis-ios: + name: iOS Size Analysis + runs-on: macos-15 + timeout-minutes: 45 + defaults: + run: + working-directory: packages/flutter/example + + steps: + - uses: actions/checkout@v5 + with: + fetch-depth: 0 + + - name: Read configured Flutter SDK version + id: conf + run: | + version=$(grep "version" ../../../metrics/flutter.properties | cut -d'=' -f2 | xargs) + echo "flutter=$version" >> "$GITHUB_OUTPUT" + + - name: Install Flutter v${{ steps.conf.outputs.flutter }} + uses: subosito/flutter-action@fd55f4c5af5b953cc57a2be44cb082c8f6635e8e # pin@v2.21.0 + with: + flutter-version: ${{ steps.conf.outputs.flutter }} + + # QuickFix for failing iOS 18.0 builds https://github.com/actions/runner-images/issues/12758#issuecomment-3187115656 + - name: Switch to Xcode 16.4 for iOS 18.5 + run: sudo xcode-select --switch /Applications/Xcode_16.4.app + + - name: Build Flutter iOS (no codesign) + run: | + flutter pub get + flutter build ios --release --no-codesign + + - name: Create XCArchive + working-directory: packages/flutter/example/ios + run: | + xcodebuild archive \ + -workspace Runner.xcworkspace \ + -scheme Runner \ + -configuration Release \ + -archivePath "${{ runner.temp }}/sentry_flutter_example.xcarchive" \ + CODE_SIGN_IDENTITY="" \ + CODE_SIGNING_REQUIRED=NO \ + CODE_SIGNING_ALLOWED=NO \ + -quiet + + - name: Install Sentry CLI + if: env.SENTRY_AUTH_TOKEN != '' + run: curl -sL https://sentry.io/get-cli/ | sh + + - name: Get merge base SHA + id: merge-base + if: env.SENTRY_AUTH_TOKEN != '' + run: | + if [ "${{ github.event_name }}" == "pull_request" ]; then + BASE_SHA="${{ github.event.pull_request.base.sha }}" + else + BASE_SHA=$(git merge-base HEAD origin/main || echo "${{ github.event.before }}") + fi + echo "sha=$BASE_SHA" >> "$GITHUB_OUTPUT" + + - name: Upload iOS XCArchive to Sentry Size Analysis + if: env.SENTRY_AUTH_TOKEN != '' + run: | + UPLOAD_ARGS=( + "${{ runner.temp }}/sentry_flutter_example.xcarchive" + "--org" "${{ env.SENTRY_ORG }}" + "--project" "${{ env.SENTRY_PROJECT }}" + "--build-configuration" "Release" + "--head-sha" "${{ github.event.pull_request.head.sha || github.sha }}" + "--head-repo-name" "${{ github.repository }}" + "--head-ref" "${{ github.head_ref || github.ref_name }}" + "--base-ref" "${{ github.base_ref || 'main' }}" + ) + + if [ -n "${{ steps.merge-base.outputs.sha }}" ]; then + UPLOAD_ARGS+=("--base-sha" "${{ steps.merge-base.outputs.sha }}") + fi + + if [ -n "${{ github.event.pull_request.number }}" ]; then + UPLOAD_ARGS+=("--pr-number" "${{ github.event.pull_request.number }}") + fi + + sentry-cli build upload "${UPLOAD_ARGS[@]}" From 8425109c40841a3045ee53a463fc56b46f7e68ae Mon Sep 17 00:00:00 2001 From: Giancarlo Buenaflor Date: Tue, 25 Nov 2025 21:44:10 +0100 Subject: [PATCH 02/10] Update --- .github/workflows/size-analysis.yml | 46 +++++++---------------------- 1 file changed, 11 insertions(+), 35 deletions(-) diff --git a/.github/workflows/size-analysis.yml b/.github/workflows/size-analysis.yml index f906b482b4..3f332020de 100644 --- a/.github/workflows/size-analysis.yml +++ b/.github/workflows/size-analysis.yml @@ -4,18 +4,7 @@ on: push: branches: - main - - release/** - paths: - - '.github/workflows/size-analysis.yml' - - 'packages/dart/**' - - 'packages/flutter/**' - - '!**/*.md' pull_request: - paths: - - '.github/workflows/size-analysis.yml' - - 'packages/dart/**' - - 'packages/flutter/**' - - '!**/*.md' concurrency: group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} @@ -40,6 +29,11 @@ jobs: with: fetch-depth: 0 + - uses: actions/setup-java@v5 + with: + distribution: 'adopt' + java-version: '17' + - name: Read configured Flutter SDK version id: conf run: | @@ -51,19 +45,14 @@ jobs: with: flutter-version: ${{ steps.conf.outputs.flutter }} - - uses: actions/setup-java@v5 - with: - java-version: '17' - distribution: 'adopt' - - - name: Build Android App Bundle (Release) + - name: Build Android App Bundle run: | flutter pub get flutter build appbundle --release - name: Install Sentry CLI if: env.SENTRY_AUTH_TOKEN != '' - run: curl -sL https://sentry.io/get-cli/ | sh + run: curl -sL https://sentry.io/get-cli/ | SENTRY_CLI_VERSION=2.58.2 sh - name: Get merge base SHA id: merge-base @@ -128,27 +117,14 @@ jobs: - name: Switch to Xcode 16.4 for iOS 18.5 run: sudo xcode-select --switch /Applications/Xcode_16.4.app - - name: Build Flutter iOS (no codesign) + - name: Build Flutter iOS run: | flutter pub get - flutter build ios --release --no-codesign - - - name: Create XCArchive - working-directory: packages/flutter/example/ios - run: | - xcodebuild archive \ - -workspace Runner.xcworkspace \ - -scheme Runner \ - -configuration Release \ - -archivePath "${{ runner.temp }}/sentry_flutter_example.xcarchive" \ - CODE_SIGN_IDENTITY="" \ - CODE_SIGNING_REQUIRED=NO \ - CODE_SIGNING_ALLOWED=NO \ - -quiet + flutter build ipa --release --no-codesign - name: Install Sentry CLI if: env.SENTRY_AUTH_TOKEN != '' - run: curl -sL https://sentry.io/get-cli/ | sh + run: curl -sL https://sentry.io/get-cli/ | SENTRY_CLI_VERSION=2.58.2 sh - name: Get merge base SHA id: merge-base @@ -165,7 +141,7 @@ jobs: if: env.SENTRY_AUTH_TOKEN != '' run: | UPLOAD_ARGS=( - "${{ runner.temp }}/sentry_flutter_example.xcarchive" + "build/ios/archive/Runner.xcarchive" "--org" "${{ env.SENTRY_ORG }}" "--project" "${{ env.SENTRY_PROJECT }}" "--build-configuration" "Release" From 83b9a610cb17666ff1a97b4d2983b2bb12363697 Mon Sep 17 00:00:00 2001 From: Giancarlo Buenaflor Date: Tue, 25 Nov 2025 23:37:06 +0100 Subject: [PATCH 03/10] Update --- .github/workflows/size-analysis.yml | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/.github/workflows/size-analysis.yml b/.github/workflows/size-analysis.yml index 3f332020de..0996ef889f 100644 --- a/.github/workflows/size-analysis.yml +++ b/.github/workflows/size-analysis.yml @@ -45,11 +45,6 @@ jobs: with: flutter-version: ${{ steps.conf.outputs.flutter }} - - name: Build Android App Bundle - run: | - flutter pub get - flutter build appbundle --release - - name: Install Sentry CLI if: env.SENTRY_AUTH_TOKEN != '' run: curl -sL https://sentry.io/get-cli/ | SENTRY_CLI_VERSION=2.58.2 sh @@ -65,11 +60,15 @@ jobs: fi echo "sha=$BASE_SHA" >> "$GITHUB_OUTPUT" - - name: Upload Android AAB to Sentry Size Analysis + - name: Build Android APK + run: | + flutter build apk --release + + - name: Upload Android APK to Sentry Size Analysis if: env.SENTRY_AUTH_TOKEN != '' run: | UPLOAD_ARGS=( - "build/app/outputs/bundle/release/app-release.aab" + "build/app/outputs/flutter-apk/app-release.apk" "--org" "${{ env.SENTRY_ORG }}" "--project" "${{ env.SENTRY_PROJECT }}" "--build-configuration" "Release" @@ -113,19 +112,18 @@ jobs: with: flutter-version: ${{ steps.conf.outputs.flutter }} + - name: Install Sentry CLI + if: env.SENTRY_AUTH_TOKEN != '' + run: curl -sL https://sentry.io/get-cli/ | SENTRY_CLI_VERSION=2.58.2 sh + # QuickFix for failing iOS 18.0 builds https://github.com/actions/runner-images/issues/12758#issuecomment-3187115656 - name: Switch to Xcode 16.4 for iOS 18.5 run: sudo xcode-select --switch /Applications/Xcode_16.4.app - name: Build Flutter iOS run: | - flutter pub get flutter build ipa --release --no-codesign - - name: Install Sentry CLI - if: env.SENTRY_AUTH_TOKEN != '' - run: curl -sL https://sentry.io/get-cli/ | SENTRY_CLI_VERSION=2.58.2 sh - - name: Get merge base SHA id: merge-base if: env.SENTRY_AUTH_TOKEN != '' From e3a5a4723947bee92869bb55c88f77889d78a708 Mon Sep 17 00:00:00 2001 From: Giancarlo Buenaflor Date: Wed, 26 Nov 2025 02:55:15 +0100 Subject: [PATCH 04/10] Update --- .github/workflows/size-analysis.yml | 36 +++++++++++++++++++++++++++-- 1 file changed, 34 insertions(+), 2 deletions(-) diff --git a/.github/workflows/size-analysis.yml b/.github/workflows/size-analysis.yml index 0996ef889f..67cae714e8 100644 --- a/.github/workflows/size-analysis.yml +++ b/.github/workflows/size-analysis.yml @@ -49,6 +49,19 @@ jobs: if: env.SENTRY_AUTH_TOKEN != '' run: curl -sL https://sentry.io/get-cli/ | SENTRY_CLI_VERSION=2.58.2 sh + - name: Determine build version + run: | + cd packages/flutter/example + version_line=$(grep '^version:' pubspec.yaml | awk '{print $2}') + build_name=${version_line%%+*} + build_number=${version_line##*+} + if [ "$build_number" = "$build_name" ]; then + build_number=1 + fi + sanitized_build_name=$(echo "$build_name" | sed 's/[^0-9.].*$//') + echo "SIZE_VERSION=$sanitized_build_name" >> "$GITHUB_ENV" + echo "SIZE_BUILD=$build_number" >> "$GITHUB_ENV" + - name: Get merge base SHA id: merge-base if: env.SENTRY_AUTH_TOKEN != '' @@ -62,7 +75,10 @@ jobs: - name: Build Android APK run: | - flutter build apk --release + flutter pub get + flutter build apk --release \ + --build-name "$SIZE_VERSION" \ + --build-number "$SIZE_BUILD" - name: Upload Android APK to Sentry Size Analysis if: env.SENTRY_AUTH_TOKEN != '' @@ -116,13 +132,29 @@ jobs: if: env.SENTRY_AUTH_TOKEN != '' run: curl -sL https://sentry.io/get-cli/ | SENTRY_CLI_VERSION=2.58.2 sh + - name: Determine build version + run: | + cd packages/flutter/example + version_line=$(grep '^version:' pubspec.yaml | awk '{print $2}') + build_name=${version_line%%+*} + build_number=${version_line##*+} + if [ "$build_number" = "$build_name" ]; then + build_number=1 + fi + sanitized_build_name=$(echo "$build_name" | sed 's/[^0-9.].*$//') + echo "SIZE_VERSION=$sanitized_build_name" >> "$GITHUB_ENV" + echo "SIZE_BUILD=$build_number" >> "$GITHUB_ENV" + # QuickFix for failing iOS 18.0 builds https://github.com/actions/runner-images/issues/12758#issuecomment-3187115656 - name: Switch to Xcode 16.4 for iOS 18.5 run: sudo xcode-select --switch /Applications/Xcode_16.4.app - name: Build Flutter iOS run: | - flutter build ipa --release --no-codesign + flutter pub get + flutter build ipa --release --no-codesign \ + --build-name "$SIZE_VERSION" \ + --build-number "$SIZE_BUILD" - name: Get merge base SHA id: merge-base From b7ef08011e0983139231de20dec7f5d19a35ac81 Mon Sep 17 00:00:00 2001 From: Giancarlo Buenaflor Date: Wed, 26 Nov 2025 02:57:56 +0100 Subject: [PATCH 05/10] Update --- .github/workflows/size-analysis.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/size-analysis.yml b/.github/workflows/size-analysis.yml index 67cae714e8..2bed17eb6c 100644 --- a/.github/workflows/size-analysis.yml +++ b/.github/workflows/size-analysis.yml @@ -51,7 +51,6 @@ jobs: - name: Determine build version run: | - cd packages/flutter/example version_line=$(grep '^version:' pubspec.yaml | awk '{print $2}') build_name=${version_line%%+*} build_number=${version_line##*+} @@ -134,7 +133,6 @@ jobs: - name: Determine build version run: | - cd packages/flutter/example version_line=$(grep '^version:' pubspec.yaml | awk '{print $2}') build_name=${version_line%%+*} build_number=${version_line##*+} From 9872f0765256ac3e5bba65145b6b32d3b38467ef Mon Sep 17 00:00:00 2001 From: Giancarlo Buenaflor Date: Wed, 26 Nov 2025 17:05:05 +0100 Subject: [PATCH 06/10] Change APK build step to Appbundle in workflow --- .github/workflows/size-analysis.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/size-analysis.yml b/.github/workflows/size-analysis.yml index 2bed17eb6c..6fc36ca063 100644 --- a/.github/workflows/size-analysis.yml +++ b/.github/workflows/size-analysis.yml @@ -72,10 +72,10 @@ jobs: fi echo "sha=$BASE_SHA" >> "$GITHUB_OUTPUT" - - name: Build Android APK + - name: Build Android Appbundle run: | flutter pub get - flutter build apk --release \ + flutter build appbundle --release \ --build-name "$SIZE_VERSION" \ --build-number "$SIZE_BUILD" @@ -83,7 +83,7 @@ jobs: if: env.SENTRY_AUTH_TOKEN != '' run: | UPLOAD_ARGS=( - "build/app/outputs/flutter-apk/app-release.apk" + "build/app/outputs/bundle/release/app-release.aab" "--org" "${{ env.SENTRY_ORG }}" "--project" "${{ env.SENTRY_PROJECT }}" "--build-configuration" "Release" From ac4fd0336e3caccb749ebf4be03311d544b3fb7f Mon Sep 17 00:00:00 2001 From: Giancarlo Buenaflor Date: Wed, 26 Nov 2025 17:05:34 +0100 Subject: [PATCH 07/10] Rename upload step for Android bundle in workflow --- .github/workflows/size-analysis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/size-analysis.yml b/.github/workflows/size-analysis.yml index 6fc36ca063..18d9600d95 100644 --- a/.github/workflows/size-analysis.yml +++ b/.github/workflows/size-analysis.yml @@ -79,7 +79,7 @@ jobs: --build-name "$SIZE_VERSION" \ --build-number "$SIZE_BUILD" - - name: Upload Android APK to Sentry Size Analysis + - name: Upload Android Bundle to Sentry Size Analysis if: env.SENTRY_AUTH_TOKEN != '' run: | UPLOAD_ARGS=( From 9b0ab2f3ef52cfc7eb8c2fe7c93b540da5404bbf Mon Sep 17 00:00:00 2001 From: Giancarlo Buenaflor Date: Thu, 27 Nov 2025 15:49:26 +0100 Subject: [PATCH 08/10] Update --- packages/flutter/example/android/app/build.gradle | 4 ++-- packages/flutter/example/android/app/proguard-rules.pro | 2 +- .../example/android/app/src/main/AndroidManifest.xml | 2 +- .../main/kotlin/io/sentry/samples/flutter/MainActivity.kt | 2 +- .../example/integration_test/integration_test.dart | 4 +--- .../android_platform_exception_event_processor_test.dart | 6 +++--- packages/flutter/test/jvm/jvm_exception_test.dart | 8 ++++---- packages/flutter/test/jvm/jvm_frame_test.dart | 4 ++-- 8 files changed, 15 insertions(+), 17 deletions(-) diff --git a/packages/flutter/example/android/app/build.gradle b/packages/flutter/example/android/app/build.gradle index 5f9c0798ee..56d97c4b13 100644 --- a/packages/flutter/example/android/app/build.gradle +++ b/packages/flutter/example/android/app/build.gradle @@ -27,7 +27,7 @@ if (flutterVersionName == null) { } android { - namespace = "io.sentry.samples.flutter" + namespace = "io.sentry.flutter.sample" compileOptions { sourceCompatibility = JavaVersion.VERSION_1_8 targetCompatibility = JavaVersion.VERSION_1_8 @@ -44,7 +44,7 @@ android { } defaultConfig { - applicationId "io.sentry.samples.flutter" + applicationId "io.sentry.flutter.sample" minSdkVersion flutter.minSdkVersion targetSdkVersion 35 versionCode flutterVersionCode.toInteger() diff --git a/packages/flutter/example/android/app/proguard-rules.pro b/packages/flutter/example/android/app/proguard-rules.pro index 446433a465..fb7b68f4d3 100644 --- a/packages/flutter/example/android/app/proguard-rules.pro +++ b/packages/flutter/example/android/app/proguard-rules.pro @@ -1 +1 @@ --keep class io.sentry.samples.flutter.** { *; } +-keep class io.sentry.flutter.sample.** { *; } diff --git a/packages/flutter/example/android/app/src/main/AndroidManifest.xml b/packages/flutter/example/android/app/src/main/AndroidManifest.xml index 800fb96d4c..be05427d0a 100644 --- a/packages/flutter/example/android/app/src/main/AndroidManifest.xml +++ b/packages/flutter/example/android/app/src/main/AndroidManifest.xml @@ -1,5 +1,5 @@ + package="io.sentry.flutter.sample"> diff --git a/packages/flutter/example/android/app/src/main/kotlin/io/sentry/samples/flutter/MainActivity.kt b/packages/flutter/example/android/app/src/main/kotlin/io/sentry/samples/flutter/MainActivity.kt index 8338d96048..4386fca56b 100644 --- a/packages/flutter/example/android/app/src/main/kotlin/io/sentry/samples/flutter/MainActivity.kt +++ b/packages/flutter/example/android/app/src/main/kotlin/io/sentry/samples/flutter/MainActivity.kt @@ -1,4 +1,4 @@ -package io.sentry.samples.flutter +package io.sentry.flutter.sample import android.os.Handler import io.flutter.embedding.android.FlutterActivity diff --git a/packages/flutter/example/integration_test/integration_test.dart b/packages/flutter/example/integration_test/integration_test.dart index 0e0ecc058a..b89e6751c7 100644 --- a/packages/flutter/example/integration_test/integration_test.dart +++ b/packages/flutter/example/integration_test/integration_test.dart @@ -362,9 +362,7 @@ void main() { final contexts = await SentryFlutter.native?.loadContexts(); final appPackageInfo = await PackageInfo.fromPlatform(); - final expectedAppId = Platform.isAndroid - ? 'io.sentry.samples.flutter' - : 'io.sentry.flutter.sample'; + const expectedAppId = 'io.sentry.flutter.sample'; final expectedSdkName = Platform.isAndroid ? 'maven:sentry-android' : 'cocoapods:sentry-cocoa'; final expectedVersion = appPackageInfo.version; diff --git a/packages/flutter/test/android_platform_exception_event_processor_test.dart b/packages/flutter/test/android_platform_exception_event_processor_test.dart index 477a384ad9..e8692469e8 100644 --- a/packages/flutter/test/android_platform_exception_event_processor_test.dart +++ b/packages/flutter/test/android_platform_exception_event_processor_test.dart @@ -243,9 +243,9 @@ const _jvmStackTrace = at io.flutter.plugin.common.StandardMessageCodec.writeValue(StandardMessageCodec.java:292) at io.flutter.plugin.common.StandardMethodCodec.encodeSuccessEnvelope(StandardMethodCodec.java:59) at io.flutter.plugin.common.MethodChannel\$IncomingMethodCallHandler\$1.success(MethodChannel.java:267) - at io.sentry.samples.flutter.MainActivity.configureFlutterEngine\$lambda-0(MainActivity.kt:40) - at io.sentry.samples.flutter.MainActivity.lambda\$TiSaAm1LIEmKLVswI4BlR_5sw5Y(Unknown Source:0) - at io.sentry.samples.flutter.-\$\$Lambda\$MainActivity\$TiSaAm1LIEmKLVswI4BlR_5sw5Y.onMethodCall(Unknown Source:2) + at io.sentry.flutter.sample.MainActivity.configureFlutterEngine\$lambda-0(MainActivity.kt:40) + at io.sentry.flutter.sample.MainActivity.lambda\$TiSaAm1LIEmKLVswI4BlR_5sw5Y(Unknown Source:0) + at io.sentry.flutter.sample.-\$\$Lambda\$MainActivity\$TiSaAm1LIEmKLVswI4BlR_5sw5Y.onMethodCall(Unknown Source:2) at io.flutter.plugin.common.MethodChannel\$IncomingMethodCallHandler.onMessage(MethodChannel.java:262) at io.flutter.embedding.engine.dart.DartMessenger.invokeHandler(DartMessenger.java:296) at io.flutter.embedding.engine.dart.DartMessenger.lambda\$dispatchMessageToQueue\$0\$DartMessenger(DartMessenger.java:320) diff --git a/packages/flutter/test/jvm/jvm_exception_test.dart b/packages/flutter/test/jvm/jvm_exception_test.dart index 9f3f0d2ef9..4723e12b65 100644 --- a/packages/flutter/test/jvm/jvm_exception_test.dart +++ b/packages/flutter/test/jvm/jvm_exception_test.dart @@ -208,9 +208,9 @@ java.lang.IllegalArgumentException: Unsupported value: '[Ljava.lang.StackTraceEl at io.flutter.plugin.common.StandardMessageCodec.writeValue(StandardMessageCodec.java:292) at io.flutter.plugin.common.StandardMethodCodec.encodeSuccessEnvelope(StandardMethodCodec.java:59) at io.flutter.plugin.common.MethodChannel\$IncomingMethodCallHandler\$1.success(MethodChannel.java:267) - at io.sentry.samples.flutter.MainActivity.configureFlutterEngine\$lambda-0(MainActivity.kt:40) - at io.sentry.samples.flutter.MainActivity.lambda\$TiSaAm1LIEmKLVswI4BlR_5sw5Y(Unknown Source:0) - at io.sentry.samples.flutter.-\$\$Lambda\$MainActivity\$TiSaAm1LIEmKLVswI4BlR_5sw5Y.onMethodCall(Unknown Source:2) + at io.sentry.flutter.sample.MainActivity.configureFlutterEngine\$lambda-0(MainActivity.kt:40) + at io.sentry.flutter.sample.MainActivity.lambda\$TiSaAm1LIEmKLVswI4BlR_5sw5Y(Unknown Source:0) + at io.sentry.flutter.sample.-\$\$Lambda\$MainActivity\$TiSaAm1LIEmKLVswI4BlR_5sw5Y.onMethodCall(Unknown Source:2) at io.flutter.plugin.common.MethodChannel\$IncomingMethodCallHandler.onMessage(MethodChannel.java:262) at io.flutter.embedding.engine.dart.DartMessenger.invokeHandler(DartMessenger.java:296) at io.flutter.embedding.engine.dart.DartMessenger.lambda\$dispatchMessageToQueue\$0\$DartMessenger(DartMessenger.java:320) @@ -248,7 +248,7 @@ android.content.res.Resources\$NotFoundException: Unable to find resource ID #0x const platformExceptionWithEmptyStackFrames = ''' java.lang.RuntimeException: Catch this platform exception! - at io.sentry.samples.flutter.MainActivity\$configureFlutterEngine\$1.onMethodCall(MainActivity.kt:40) + at io.sentry.flutter.sample.MainActivity\$configureFlutterEngine\$1.onMethodCall(MainActivity.kt:40) at io.flutter.plugin.common.MethodChannel\$IncomingMethodCallHandler.onMessage(MethodChannel.java:258) at io.flutter.embedding.engine.dart.DartMessenger.invokeHandler(DartMessenger.java:295) at io.flutter.embedding.engine.dart.DartMessenger.lambda\$dispatchMessageToQueue\$0\$io-flutter-embedding-engine-dart-DartMessenger(DartMessenger.java:322) diff --git a/packages/flutter/test/jvm/jvm_frame_test.dart b/packages/flutter/test/jvm/jvm_frame_test.dart index ca6a056aa2..56e717a1fd 100644 --- a/packages/flutter/test/jvm/jvm_frame_test.dart +++ b/packages/flutter/test/jvm/jvm_frame_test.dart @@ -68,14 +68,14 @@ void main() { test('parses frame with lambda and unknown source', () { final frame = JvmFrame.parse( - 'at io.sentry.samples.flutter.-\$\$Lambda\$MainActivity\$TiSaAm1LIEmKLVswI4BlR_5sw5Y.onMethodCall(Unknown Source:2)', + 'at io.sentry.flutter.sample.-\$\$Lambda\$MainActivity\$TiSaAm1LIEmKLVswI4BlR_5sw5Y.onMethodCall(Unknown Source:2)', ); expect(frame.fileName, 'Unknown Source'); expect(frame.lineNumber, 2); expect(frame.method, 'onMethodCall'); expect( frame.className, - 'io.sentry.samples.flutter.-\$\$Lambda\$MainActivity\$TiSaAm1LIEmKLVswI4BlR_5sw5Y', + 'io.sentry.flutter.sample.-\$\$Lambda\$MainActivity\$TiSaAm1LIEmKLVswI4BlR_5sw5Y', ); expect(frame.skippedFrames, null); expect(frame.isNativeMethod, false); From 806dd0bee9d96f7c9c3081232c3ea6e6bad6e6c3 Mon Sep 17 00:00:00 2001 From: Giancarlo Buenaflor Date: Fri, 28 Nov 2025 13:33:06 +0100 Subject: [PATCH 09/10] Update --- .github/workflows/size-analysis.yml | 48 ++++++++++++++++++++--------- 1 file changed, 34 insertions(+), 14 deletions(-) diff --git a/.github/workflows/size-analysis.yml b/.github/workflows/size-analysis.yml index 18d9600d95..3f0e571c3b 100644 --- a/.github/workflows/size-analysis.yml +++ b/.github/workflows/size-analysis.yml @@ -16,8 +16,8 @@ env: SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} jobs: - size-analysis-android: - name: Android Size Analysis + android: + name: Android runs-on: ubuntu-latest timeout-minutes: 30 defaults: @@ -52,13 +52,23 @@ jobs: - name: Determine build version run: | version_line=$(grep '^version:' pubspec.yaml | awk '{print $2}') - build_name=${version_line%%+*} - build_number=${version_line##*+} - if [ "$build_number" = "$build_name" ]; then + # Remove any + suffix first (for pubspec.yaml versions like 1.2.3+4) + version=${version_line%%+*} + + # Parse version: x.y.z-suffix.n → build_name=x.y.z-suffix, build_number=n + # Supports: x.y.z, x.y.z-alpha.n, x.y.z-beta.n, x.y.z-rc.n, etc. + if [[ $version =~ ^([0-9]+\.[0-9]+\.[0-9]+-[a-zA-Z]+)\.([0-9]+)$ ]]; then + build_name="${BASH_REMATCH[1]}" + build_number="${BASH_REMATCH[2]}" + elif [[ $version =~ ^([0-9]+\.[0-9]+\.[0-9]+)$ ]]; then + build_name="${BASH_REMATCH[1]}" + build_number=1 + else + build_name="$version" build_number=1 fi - sanitized_build_name=$(echo "$build_name" | sed 's/[^0-9.].*$//') - echo "SIZE_VERSION=$sanitized_build_name" >> "$GITHUB_ENV" + + echo "SIZE_VERSION=$build_name" >> "$GITHUB_ENV" echo "SIZE_BUILD=$build_number" >> "$GITHUB_ENV" - name: Get merge base SHA @@ -103,8 +113,8 @@ jobs: sentry-cli build upload "${UPLOAD_ARGS[@]}" - size-analysis-ios: - name: iOS Size Analysis + ios: + name: iOS runs-on: macos-15 timeout-minutes: 45 defaults: @@ -134,13 +144,23 @@ jobs: - name: Determine build version run: | version_line=$(grep '^version:' pubspec.yaml | awk '{print $2}') - build_name=${version_line%%+*} - build_number=${version_line##*+} - if [ "$build_number" = "$build_name" ]; then + # Remove any + suffix first (for pubspec.yaml versions like 1.2.3+4) + version=${version_line%%+*} + + # Parse version: x.y.z-suffix.n → build_name=x.y.z-suffix, build_number=n + # Supports: x.y.z, x.y.z-alpha.n, x.y.z-beta.n, x.y.z-rc.n, etc. + if [[ $version =~ ^([0-9]+\.[0-9]+\.[0-9]+-[a-zA-Z]+)\.([0-9]+)$ ]]; then + build_name="${BASH_REMATCH[1]}" + build_number="${BASH_REMATCH[2]}" + elif [[ $version =~ ^([0-9]+\.[0-9]+\.[0-9]+)$ ]]; then + build_name="${BASH_REMATCH[1]}" + build_number=1 + else + build_name="$version" build_number=1 fi - sanitized_build_name=$(echo "$build_name" | sed 's/[^0-9.].*$//') - echo "SIZE_VERSION=$sanitized_build_name" >> "$GITHUB_ENV" + + echo "SIZE_VERSION=$build_name" >> "$GITHUB_ENV" echo "SIZE_BUILD=$build_number" >> "$GITHUB_ENV" # QuickFix for failing iOS 18.0 builds https://github.com/actions/runner-images/issues/12758#issuecomment-3187115656 From 1b4527838e85421c2d581d34164e70de2b8d4912 Mon Sep 17 00:00:00 2001 From: Giancarlo Buenaflor Date: Fri, 28 Nov 2025 15:05:00 +0100 Subject: [PATCH 10/10] Update --- .github/workflows/size-analysis.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/size-analysis.yml b/.github/workflows/size-analysis.yml index 3f0e571c3b..c5de654d27 100644 --- a/.github/workflows/size-analysis.yml +++ b/.github/workflows/size-analysis.yml @@ -55,9 +55,10 @@ jobs: # Remove any + suffix first (for pubspec.yaml versions like 1.2.3+4) version=${version_line%%+*} - # Parse version: x.y.z-suffix.n → build_name=x.y.z-suffix, build_number=n + # Parse version: x.y.z-suffix.n → build_name=x.y.z, build_number=n # Supports: x.y.z, x.y.z-alpha.n, x.y.z-beta.n, x.y.z-rc.n, etc. - if [[ $version =~ ^([0-9]+\.[0-9]+\.[0-9]+-[a-zA-Z]+)\.([0-9]+)$ ]]; then + # Note: build_name is x.y.z only (plist/Android compatibility) + if [[ $version =~ ^([0-9]+\.[0-9]+\.[0-9]+)-[a-zA-Z]+\.([0-9]+)$ ]]; then build_name="${BASH_REMATCH[1]}" build_number="${BASH_REMATCH[2]}" elif [[ $version =~ ^([0-9]+\.[0-9]+\.[0-9]+)$ ]]; then @@ -147,9 +148,10 @@ jobs: # Remove any + suffix first (for pubspec.yaml versions like 1.2.3+4) version=${version_line%%+*} - # Parse version: x.y.z-suffix.n → build_name=x.y.z-suffix, build_number=n + # Parse version: x.y.z-suffix.n → build_name=x.y.z, build_number=n # Supports: x.y.z, x.y.z-alpha.n, x.y.z-beta.n, x.y.z-rc.n, etc. - if [[ $version =~ ^([0-9]+\.[0-9]+\.[0-9]+-[a-zA-Z]+)\.([0-9]+)$ ]]; then + # Note: build_name is x.y.z only (plist/Android compatibility) + if [[ $version =~ ^([0-9]+\.[0-9]+\.[0-9]+)-[a-zA-Z]+\.([0-9]+)$ ]]; then build_name="${BASH_REMATCH[1]}" build_number="${BASH_REMATCH[2]}" elif [[ $version =~ ^([0-9]+\.[0-9]+\.[0-9]+)$ ]]; then