flutter / flutter

Flutter makes it easy and fast to build beautiful apps for mobile and beyond
https://flutter.dev
BSD 3-Clause "New" or "Revised" License
161.85k stars 26.57k forks source link

App store rejection due to crashes on 17.4.1 after upgrading to Flutter 3.19.5 #145929

Closed rahuloak closed 3 weeks ago

rahuloak commented 1 month ago

Steps to reproduce

Unfortunately, I can't reproduce this locally - I'm able to run my App on the simulator and actual device, but I get rejected by the App store because they can't build: Attaching crash logs below from Apple

Archive.zip

Expected results

It shouldn't crash!

(The exact same code got approved on the Android Play Store)

Actual results

Crashes and points to this line when I load the .crash file in XCode:

@UIApplicationMain @objc class AppDelegate: FlutterAppDelegate { override func application( _ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? ) -> Bool { GeneratedPluginRegistrant.register(with: self) return super.application(application, didFinishLaunchingWithOptions: launchOptions) } }

This tells me that the crash happens before it even gets to execute my Flutter code

I've seen a couple of other issues since updating to the latest version of XCode, but this is serious because it's causing my App to get rejected in the store.

Code sample

This is where it fails:

import UIKit import Flutter

@UIApplicationMain @objc class AppDelegate: FlutterAppDelegate { override func application( _ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? ) -> Bool { GeneratedPluginRegistrant.register(with: self) return super.application(application, didFinishLaunchingWithOptions: launchOptions) } }

From App review: "Guideline 2.1 - Performance - App Completeness

We were unable to review your app as it crashed on launch. We have attached detailed crash logs to help troubleshoot this issue.

Review device details:

Archive.zip

Screenshots or Video

Screenshot 2024-03-28 at 1 39 40 PM

Logs

Please see attached crash logs pasted above

Flutter Doctor output

flutter doctor -v [✓] Flutter (Channel stable, 3.19.5, on macOS 14.3.1 23D60 darwin-arm64, locale en-US) • Flutter version 3.19.5 on channel stable at /Users/rahuloak/Flutter/flutter • Upstream repository https://github.com/flutter/flutter.git • Framework revision 300451adae (18 hours ago), 2024-03-27 21:54:07 -0500 • Engine revision e76c956498 • Dart version 3.3.3 • DevTools version 2.31.1

[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0) • Android SDK at /Users/rahuloak/Library/Android/sdk • Platform android-34, build-tools 33.0.0 • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java • Java version OpenJDK Runtime Environment (build 17.0.9+0-17.0.9b1087.7-11185874) • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 15.3) • Xcode at /Applications/Xcode.app/Contents/Developer • Build 15E204a • CocoaPods version 1.14.3

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

[✓] Android Studio (version 2023.2) • 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.9+0-17.0.9b1087.7-11185874)

[✓] VS Code (version 1.74.3) • VS Code at /Users/rahuloak/Downloads/Visual Studio Code.app/Contents • Flutter extension version 3.60.0

[✓] Connected device (2 available) • macOS (desktop) • macos • darwin-arm64 • macOS 14.3.1 23D60 darwin-arm64 • Chrome (web) • chrome • web-javascript • Google Chrome 123.0.6312.87

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

• No issues found!

tomoyanakano commented 1 month ago

Hello,

I encountered the same issue, and my application was also rejected for the same reason. In my case, I discovered that the problem stemmed from Firebase Analytics.

If your application utilizes the Firebase Analytics package, the following thread may be of assistance:

https://github.com/firebase/flutterfire/issues/12442#issuecomment-1983446986

huycozy commented 1 month ago

@rahuloak We recently also received https://github.com/flutter/flutter/issues/145593 which could be caused by flutterfire plugin. You can check the link above to see if it helps.

rahuloak commented 1 month ago

Ok - I'll update the libraries as mentioned in that thread and see if that does it.

@tomoyanakano Thanks a ton for the mention. Were you able to reproduce locally?

tomoyanakano commented 4 weeks ago

@rahuloak No, I was unable to reproduce the issue locally in my environment (although the launch speed is quite slow). This error is triggered by the start of a Firebase Analytics session. The error would happen for few of iOS 17.4 users (depend on device)

rahuloak commented 3 weeks ago

Upgraded firebase_core library to 2.27.2 and that seems to have done the job for me! The App got approved on the App store.

I was able to reproduce, but only while pointing to my dev environment (still haven't figured out why it didn't happen when I connected to prod; likely due to some config difference, but I didn't spend time on it).

Thanks a ton to everyone for your help, especially @tomoyanakano. Closing this issue.

github-actions[bot] commented 1 week ago

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.