Skip to content

App crash in GeneratedPluginRegistrant, only in TestFlight #175088

Closed

Description

@gvaish

Steps to reproduce

I recently upgraded from 3.32 to 3.35 and started to see crash in TestFlight builds.

  1. Build the IPA
  2. Upload to App Store
  3. Distribute via Test Flight
  4. Start the app

When launching a TestFlight build of a Flutter app from the home screen of iOS, the app will crash when trying to register plugins:

Exception Type:  EXC_BAD_ACCESS (SIGSEGV)
Exception Subtype: KERN_INVALID_ADDRESS at 0x0000000000000000
Exception Codes: 0x0000000000000001, 0x0000000000000000
VM Region Info: 0 is not in any region.  Bytes before following region: 4329668608
      REGION TYPE                 START - END      [ VSIZE] PRT/MAX SHRMOD  REGION DETAIL
      UNUSED SPACE AT START
--->  
      __TEXT (graphics)        102118000-10211c000 [   16K] r-x/r-x SM=COW  /var/containers/Bundle/Application/9C192904-EC43-4277-9D6E-8F26C1F055F6/Runner.app/Runner
Termination Reason: SIGNAL 11 Segmentation fault: 11
Terminating Process: exc handler [24072]

Triggered by Thread:  0


Thread 0 Crashed:
0   libswiftCore.dylib            	0x0000000199b36e54 swift_getObjectType + 40 (SwiftObject.mm:137)
1   auth0_flutter                 	0x0000000102d86b68 0x102d54000 + 207720
2   auth0_flutter                 	0x0000000102d86c84 0x102d54000 + 208004
3   auth0_flutter                 	0x0000000102d85834 0x102d54000 + 202804
4   auth0_flutter                 	0x0000000102d8585c 0x102d54000 + 202844
5   libswiftCore.dylib            	0x000000019981f098 Sequence.forEach(_:) + 752 (Sequence.swift:816)
6   auth0_flutter                 	0x0000000102d857c0 0x102d54000 + 202688
7   auth0_flutter                 	0x0000000102d85934 0x102d54000 + 203060
8   auth0_flutter                 	0x0000000102d58048 0x102d54000 + 16456
9   Runner                        	0x000000010211c074 +[GeneratedPluginRegistrant registerWithRegistry:] + 116 (GeneratedPluginRegistrant.m:90)
10  Runner                        	0x000000010211c538 AppDelegate.application(_:didFinishLaunchingWithOptions:) + 264 (AppDelegate.swift:17)
11  Runner                        	0x000000010211c83c @objc AppDelegate.application(_:didFinishLaunchingWithOptions:) + 220 (/<compiler-generated>:0)

The relevant code in GeneratedPluginRegistrant.m:

+ (void)registerWithRegistry:(NSObject<FlutterPluginRegistry>*)registry {
  [Auth0FlutterPlugin registerWithRegistrar:[registry registrarForPlugin:@"Auth0FlutterPlugin"]]; // <= This is line 90 mentioned in crash log
  [FPPDeviceInfoPlusPlugin registerWithRegistrar:[registry registrarForPlugin:@"FPPDeviceInfoPlusPlugin"]];
  [FirebaseAnalyticsPlugin registerWithRegistrar:[registry registrarForPlugin:@"FirebaseAnalyticsPlugin"]];
}

Maybe related to #149214

Expected results

App should launch

Actual results

App crashes. Reproducible 100%.

Code sample

N/A

Screenshots or Video

N/A

Logs

N/A

Flutter Doctor output

[✓] Flutter (Channel stable, 3.35.3, on macOS 15.5 24F74 darwin-arm64, locale en-US) [325ms]
    • Flutter version 3.35.3 on channel stable at /Users/gvaish/Desktop/all/downloads/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision a402d9a437 (5 days ago), 2025-09-03 14:54:31 -0700
    • Engine revision ddf47dd3ff
    • Dart version 3.9.2
    • DevTools version 2.48.0
    • Feature flags: enable-web, enable-linux-desktop, enable-macos-desktop, enable-windows-desktop, enable-android, enable-ios, cli-animations, enable-lldb-debugging

[✓] Android toolchain - develop for Android devices (Android SDK version 35.0.0) [1,152ms]
    • Android SDK at /Users/gvaish/Library/Android/sdk
    • Emulator version 32.1.14.0 (build_id 10330179) (CL:N/A)
    • Platform android-35, build-tools 35.0.0
    • ANDROID_HOME = /Users/gvaish/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
      This is the JDK bundled with the latest Android Studio installation on this machine.
      To manually set the JDK path, use: `flutter config --jdk-dir="path/to/jdk"`.
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b802.4-9586694)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 16.4) [935ms]
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 16F6
    • CocoaPods version 1.16.2

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

[✓] Android Studio (version 2022.2) [6ms]
    • 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.6+0-17.0.6b802.4-9586694)

[✓] VS Code (version 1.103.2) [5ms]
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.116.0

[✓] Connected device (4 available) [5.9s]
    • 16 Pro x 18.1 (mobile) • 12C5B556-8D83-4060-A447-F30B34F1BF81 • ios            • com.apple.CoreSimulator.SimRuntime.iOS-18-1 (simulator)
    • macOS (desktop)        • macos                                • darwin-arm64   • macOS 15.5 24F74 darwin-arm64
    • Chrome (web)           • chrome                               • web-javascript • Google Chrome 139.0.7258.155
    ! Error: Browsing on the local area network for ARNAB's iPhone 15 Pro. Ensure the device is unlocked and attached with a cable or associated with the same local area network as this
      Mac.
      The device must be opted into Developer Mode to connect wirelessly. (code -27)
    ! Error: Browsing on the local area network for dev-ios. Ensure the device is unlocked and attached with a cable or associated with the same local area network as this Mac.
      The device must be opted into Developer Mode to connect wirelessly. (code -27)

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

• No issues found!

Activity

  1. added
    in triage
    on Sep 9, 2025
  2. darshankawar commented on Sep 9, 2025

    @darshankawar
    Member

    Maybe related to #149214

    This does look like similar to your issue and considering that it is open so could be affecting your case as well, so I suggest you to follow-up in it for further updates as the root-cause seems to be same, only the plugin is different which in your case is auth0_flutter. If you disagree, write in comments and I'll reopen it.

  3. added
    r: duplicate
    and removed
    in triage
    on Sep 9, 2025
  4. gvaish commented on Sep 9, 2025

    @gvaish
    Author

    @darshankawar I don't know if it's an exact duplicate.

    The app works perfect when running locally - flutter run but fails only when the binary is uploaded and then installed via TestFlight (before pushing to app store release).

  5. darshankawar commented on Sep 10, 2025

    @darshankawar
    Member

    Ok, thanks for the feedback. Reopening and labeling for team's tracking.

  6. added
    in triage
    platform-ios
    c: crash
    team-ios
    tool
    and removed
    r: duplicate
    in triage
    on Sep 10, 2025
  7. gvaish commented on Sep 10, 2025

    @gvaish
    Author

    @darshankawar I'm trying a few things to find the root cause. From the stack trace I don't know if the culprit is flutter code or the underlying plugin.

    I want to play with the GeneratedPluginRegistrant but it's generated automatically at each build. Is it possible to disable regeneration / overwrite (using CLI option and/or temporarily with some other config)?

  8. darshankawar commented on Sep 11, 2025

    @darshankawar
    Member

    Is it possible to disable regeneration / overwrite (using CLI option and/or temporarily with some other config)?

    @gvaish Maybe you can try to manually register the plugin or create a test plugin and then register it manually to check if that helps further ?

  9. gvaish commented on Sep 12, 2025

    @gvaish
    Author

    I tried differently. I copied over the GeneratedPluginRegistrant to XGeneratedPluginRegistrant and then changed the order.

    Now, it's not always failing on the first entry. But if it fails, it fails consistently on that specific plugin. So, some plugins are not being registered in the registry. So,

    [registry registrarForPlugin:@"{WhateverPlugin}"]
    

    returns a nil that crashes the app.

    FWIW, being a Xoogler and in Bay Area, I can drive over and can pair up for debugging. Maybe faster that way. WDYT?

    We are blocked on release the app to the store. Delayed by about a week for now...

  10. gvaish commented on Sep 18, 2025

    @gvaish
    Author

    @darshankawar I can confirm that it is definitely a codegen issue. Which plugin it fails with, won't know ahead of time. But if it fails, it fails consistently on that plugin.

    I cleaned up and reinstalled everything but it fails still.

  11. okorohelijah commented on Sep 18, 2025

    @okorohelijah
    Contributor

    cc @vashworth from triage-meeting

  12. gvaish commented on Sep 19, 2025

    @gvaish
    Author

    Trying to debug issue by building on a clean system

    I don't know if it'll crash or not, but I'm trying to set it up on a hosted CI platform and debug so that I can confirm it's not a local / my machine issue but truly a flutter issue.

    Did the following:

    1. flutter build [... other options] --no-codesign
    2. xcodebuild [... options] archive
    3. xcodebuild [... other options] -exportArchive

    Steps (1) and (2) work great. Final binary build at (3) fails with the error on provisioning profile requirement (not mistmatch or missing):

    error: exportArchive FirebaseCore.framework does not support provisioning profiles.
    ... [for all the deps / pods]
    

    The Podfile post-install hook is as below:

    post_install do |installer|
      installer.pods_project.targets.each do |target|
        flutter_additional_ios_build_settings(target)
        target.build_configurations.each do |config|
          config.build_settings.delete 'IPHONEOS_DEPLOYMENT_TARGET'
          config.build_settings['EXPANDED_CODE_SIGN_IDENTITY'] = ''
          config.build_settings['CODE_SIGN_IDENTITY'] = ''
          config.build_settings['CODE_SIGNING_REQUIRED'] = 'NO'
          config.build_settings['CODE_SIGNING_ALLOWED'] = 'NO'
          config.build_settings['PROVISIONING_PROFILE_SPECIFIER'] = ''
        end
      end
    end
    

    Do you know how to fix this part?

  13. gvaish commented on Sep 19, 2025

    @gvaish
    Author

    Verified that this is indeed a flutter issue

    • Create a new app (flutter create)
    • Added a plugin (auth0_flutter in my case)
    • Integrate plugin in the sample app created.

    I added a simple Login/Logout button:

    FilledButton(
      onPressed: () async {
        debugPrint("onPressed, loggedIn?: $_loggedIn");
        if (!_loggedIn) {
          debugPrint("Logging in...");
          await widget.auth0
              .webAuthentication(scheme: "<scheme>")
              .login(
                useEphemeralSession: false,
                audience: "<audience>",
              );
        } else {
          debugPrint("Logging out...");
          await widget.auth0
              .webAuthentication(scheme: "<scheme>")
              .logout();
        }
        setState(() {
          debugPrint("Switching from: $_loggedIn");
          _loggedIn = !_loggedIn;
        });
      },
      child: Text(_loggedIn ? "Logout" : "Login"),
    ),
    

    And the app crashes on launch.
    Waiting for the crashreport to come up.

  14. gvaish commented on Sep 21, 2025

    @gvaish
    Author

    When trying to debug the testflight version, I added get-task-allow flag.

    <key>get-task-allow</key>
    <true />
    

    The app didn't crash. But once I removed / disabled it, the app crashed again.

    So, my hunch is that a debug vs release variant code in Flutter is causing the issue, and making it harder to debug.

  15. LouiseHsu commented on Sep 25, 2025

    @LouiseHsu
    Contributor

    Since the crash is happening inside auth0_flutter, and this crash cannot be reproed with any other plugin, I'm going to close this, and recommend you file an issue with auth0_flutter instead since they probably will have more insight. :)

  16. added
    r: solved
    on Sep 26, 2025
  17. gvaish commented on Sep 27, 2025

    @gvaish
    Author

    This is ridiculous. @LouiseHsu - the crash happens on the first plugin. If I remove auth0_flutter, it crashes on the next plugin.

    This is a flutter issue.

  18. github-actions commented on Oct 11, 2025

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  19. locked as resolved and limited conversation to collaborators on Oct 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    c: crashplatform-iosr: solvedteam-iostool

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions