Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Black screen on startup after updating flutter

Tags:

flutter

I recently updated the flutter. For running flutter project I am using android via usb. And after updating every project on startup shows black screen. Previous version worked fine. I tried to change launch splash screen(drawable/launch_background.xml) in android to white but black screen shows after splash screen. This is the simple code I am trying to run

void main()=> runApp(MyApp());
class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context){
    return MaterialApp(
        home:MyHomePage(),      
    );
  }
}

So how can I remove black screen on startup?

The black screen like here. As I said black screen shows after updating flutter to a new version. And I downgraded the flutter version to old and black screen disappeared.

like image 896
KOrra Avatar asked Dec 17 '19 10:12

KOrra


1 Answers

I had the same problem when I switched to beta channel of flutter.
I noticed there is another launch_background.xml file in drawable-v21 folder.

so I copied the content of launch_background.xml in drawable folder to launch_background.xml in drawable-v21 and it worked.

like image 64
Mahdi Arabpour Avatar answered Nov 15 '22 11:11

Mahdi Arabpour