iOS Flutter app opens, but is stuck on splash-screen
Asked Answered
E

8

17

When I built my iOS app, it opened perfectly in the simulator on my Macbook. When I publish the app on the itunes store, the app does not work anymore. The splashscreen is shown, but stays on the screen.

Epigoni answered 10/1, 2019 at 16:53 Comment(0)
E
20

Solution for me:

  1. updated my iOS toolchain with flutter doctor

  2. flutter clean

  3. flutter build ios --release in the terminal

  4. Archive in Xcode

Epigoni answered 10/1, 2019 at 16:53 Comment(1)
I face this problem sometimes in Android. It's weird because it doesn't happen all the times, just a few times.Goldplate
F
3

I fix this by remove project_root/ios/Pods/ & project_root/ios/Podfile.lock and run pod install again after flutter clean & flutter build ios --release

Flory answered 4/7, 2019 at 3:7 Comment(0)
N
1

I tried various solutions. But finally i found out issue was version of my android studio(ide used for development for flutter, in my case). I updated my version to 3.2.1 and then followed instructions to run in xcode and it worked in my case. Hope it helps!

Novak answered 8/5, 2019 at 7:31 Comment(0)
G
1

I added WidgetsFlutterBinding.ensureInitialized()to the main page.

void main() {
  WidgetsFlutterBinding.ensureInitialized();
  runApp(MyApp());
}
Goldplate answered 28/8, 2020 at 22:23 Comment(0)
C
1

I had this problem with an android build of an app that uses multiple flavors, but in the end it turned out I was simply using the wrong APK file.

So the build created 3 apk files eg.

myapp.apk
myapp-test-debug.apk
myapp-test-release.apk

My assumption was to use the test-release.apk which got the app stuck on the splash screen. Using the myapp.apk did not have this problem.

Bit of a facepalm moment for myself but maybe this helps someone else looking for an answer!

Child answered 18/3, 2021 at 16:55 Comment(0)
B
0

I face the same issues, and I finally found that the root of the problem is the setting of workspace of xcode,when i change the workspace settings from legacy build system to new build system,the bug disappear . hope can help you.

Bemock answered 26/6, 2019 at 17:9 Comment(0)
B
0

Maybe Podfile is out of date.

Solution for me:

  1. Remove Pobfile folder and Pobfile.lock direction: "your_flutter_project/ios/"
  2. Run flutter clean
  3. Run flutter pub get
  4. Run flutter build ios

Hope this helpful.

Bluenose answered 17/9, 2020 at 9:12 Comment(0)
S
0

If non of the above solutions work for you on ios, Try this. In xcode under Targets > General. Set Main interface to Main and set luanch screen file to LaunchScreen.

This worked for me on IOS.

Sportsman answered 16/5, 2021 at 21:0 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.