'How to remove flutter_native_splash from app?
I used flutter_native_splash: ^1.3.2
for splash screen, i want to remove this splash screen.
Below code is in pubspec.yaml
file.
flutter_native_splash:
color: "#ffffff"
image: assets/images/AppLogo.png
android: true
ios: true
I used flutter pub run flutter_native_splash:remove
command to remove,
And i also remove flutter_native_splash (Above code) dependency from pubspec.yaml
file.
And then i clean my project using flutter clean command.
then get the packages.
So now when i run the app it shows the splash screen which i removed.
so please Help me.
Thank you.
Solution 1:[1]
As you can read in the GitHub issue on how to uninstall the package, this is a generator and you also have to remove the generated files.
So ideally, if you have version control you could just revert you changes when adding the files.
Else you have to manually remove the changes such as the launch_background.xml, styles.xml
etc.
You can get a good hint which files might be affected by scanning the templates of this package.
Solution 2:[2]
iOS has a known caching issue that maintains a splash screen even after it has been removed. If the problem is on iOS, it may be cause by this caching issue.
Solution 3:[3]
for android
go to android/app/src/main/res/drawable
replace
<?xml version="1.0" encoding="utf-8"?> <layer-list
xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<bitmap android:gravity="fill" android:src="@drawable/background"/>
</item>
<item>
<bitmap android:gravity="center" android:src="@drawable/splash"/>
</item> </layer-list>
with
<?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/white" />
<!-- You can insert your own image assets here -->
<!-- <item>
<bitmap
android:gravity="center"
android:src="@mipmap/launch_image" />
</item> -->
</layer-list>
and delete background image
Solution 4:[4]
I had the same issue. It is because of the cache in the device. Once you erase the all cache, the old one will disappears. In iOS simulator, you can do this by selecting menubar => Erase all contents and setting.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | FreshD |
Solution 2 | jon |
Solution 3 | Eng abdulrhman alhamodi |
Solution 4 | Takahiro Fujiwara |