Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 758 Vote(s) - 3.49 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Flutter v2.5.0 Android Splash Screen

#1
I had implemented a native splash screen in my current project and everything was working correctly since I upgraded to v2.5.0 and I am starting to get this deprecation warning on my console:

> A splash screen was provided to Flutter, but this is deprecated. See flutter.dev/go/android-splash-migration for migration steps.

I have checked out the given link (which is not that clear btw) and tells me to remove the `o.flutter.embedding.android.SplashScreenDrawable` API as flutter now automatically displays the splash.

But after running my app without the code no splash screen appears moreover it takes a while to start the app - probably initializing the app without the splash or something.

Am I doing this right or is it an issue with the framework itself?
Reply

#2
It is caused by having the following code in your AndroidManifest.xml, which was included by default in previous versions of Flutter:

<meta-data
android:name="io.flutter.embedding.android.SplashScreenDrawable"
android:resource="@drawable/launch_background"
/>

The solution is to remove the above code.

[Source][1]


[1]:

[To see links please register here]

Reply

#3
Here is one solution that worked in my case.

You have a "drawable" and "drawable-v21" folders on the path "android/app/src/main/res/" and you must open the "launch_background.xml" in "drawable-v21" folder, paste and a little bit refactor my code to provide your image or/and color:

<?xml version="1.0" encoding="utf-8"?>
<!-- Modify this file to customize your launch splash screen -->
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@android:color/your_color" />

<!-- You can insert your own image assets here -->
<item>
<bitmap
android:gravity="center"
android:src="@drawable/your_image" />
</item>
</layer-list>

P.S. The image should be in "drawable" folder, not "drawable-v21". You can try, but in my case that didnt work and throw the error.

P.S.2 I didn't change the "AndroidManifest.xml", "styles.xml" and other files.
Reply

#4
Follow this youtube tutorial on how to correctly Create Splash Screen in Flutter App the Right Way in 2021. Ensure to create the launch_background.xml file in both drawable and drawable-v21 folders inside the android/app/src/main/res folder.

[Create Splash Screen in Flutter App the Right Way in 2021][1]

If you are using Flutter 2.5, remove the following line in your AndroidManifest.xml file since Flutter 2.5 has no need for it anymore as mentioned here --> [android splash migration][2]

<meta-data
android:name="io.flutter.embedding.android.SplashScreenDrawable"
android:resource="@drawable/launch_background"/>


[1]:
[2]:

[To see links please register here]

Reply

#5
Remove the below lines from your AndroidManifest.xml file. In newer versions it's no longer used

<!-- begin snippet: js hide: false console: true babel: false -->

<!-- language: lang-js -->

<meta-data
android:name="io.flutter.embedding.android.NormalTheme"
android:resource="@style/NormalTheme" />

<meta-data
android:name="io.flutter.embedding.android.SplashScreenDrawable"
android:resource="@drawable/launch_background" />

<!-- end snippet -->

Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through