Black screen between SplashScreen and first viewController when using flutter app like module in native iOS app.
- I am creating a module according to this instruction.
- Add it to clear ios project.
- When app starts black screen appear after spashScreen. In debug mode it appears for more than 1 second, in release – for a monent.
- I tried to change “splashScreen” and “splashScreen.storyboard” in info.plist and it didn’t help
flutter doctor -v:
[✓] Flutter (Channel stable, 3.22.1, on macOS 14.4 23E214 darwin-arm64, locale ru-RU)
• Flutter version 3.22.1 on channel stable at /Users/sishemet/development/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision a14f74ff3a (2 weeks ago), 2024-05-22 11:08:21 -0500
• Engine revision 55eae6864b
• Dart version 3.4.1
• DevTools version 2.34.3
[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.2)
• Android SDK at /Users/sishemet/Library/Android/sdk
• Platform android-34, build-tools 33.0.2
• Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
• 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 15.3)
• Xcode at /Applications/Xcode_15_3.app/Contents/Developer
• Build 15E204a
• CocoaPods version 1.15.2
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 2022.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.6+0-17.0.6b802.4-9586694)
[✓] VS Code (version 1.88.1)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.90.0
[✓] Connected device (7 available)
• sdk gphone64 arm64 (mobile) • emulator-5554 • android-arm64 • Android 13 (API 33) (emulator)
• iPhone (2) (mobile) • 00008120-001A44E02238C01E • ios • iOS 17.5.1 21F90
• iPhone 15 Pro (mobile) • 4A597778-D2E0-4B32-8738-8DF40540CF3B • ios • com.apple.CoreSimulator.SimRuntime.iOS-17-2 (simulator)
• iPhone 15 Pro (mobile) • 48C90453-3176-44D2-894B-4DAABCB59B5D • ios • com.apple.CoreSimulator.SimRuntime.iOS-17-4 (simulator)
• macOS (desktop) • macos • darwin-arm64 • macOS 14.4 23E214 darwin-arm64
• Mac Designed for iPad (desktop) • mac-designed-for-ipad • darwin • macOS 14.4 23E214 darwin-arm64
• Chrome (web) • chrome • web-javascript • Google Chrome 125.0.6422.142
[✓] Network resources
• All expected network resources are available.
My appDelegate file:
import Flutter
import FlutterPluginRegistrant
import UIKit
@main
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
let flutterEngine = FlutterEngine(name: "flutter engine")
flutterEngine.run()
GeneratedPluginRegistrant.register(with: flutterEngine)
let flutterVC = FlutterViewController(engine: flutterEngine, nibName: nil, bundle: nil)
window = UIWindow(frame: UIScreen.main.bounds)
window?.rootViewController = flutterVC
window?.makeKeyAndVisible()
return true
}
}
New contributor
Serg is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.