generator-rn-toolbox icon indicating copy to clipboard operation
generator-rn-toolbox copied to clipboard

Remove splashscreen

Open rizwanahmed19 opened this issue 6 years ago • 10 comments

Is there a way to remove the splashscreen from the project?

rizwanahmed19 avatar Nov 13 '17 14:11 rizwanahmed19

@rizwanahmed19 have you figured out a way to revert it back?

JenSebastian avatar Nov 16 '17 17:11 JenSebastian

Hi @rizwanahmed19 and @JenSebastian,

Why do you guys need to remove the splashscreen? :)

Here's how to do it manually though:

For iOS

Revert what was done here with those 2 steps:

  1. Revert the line ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; in ios/[YOUR_PROJECT_NAME].xcodeproj/project.pbxproj
  2. Remove the assets: rm -rf ios/[YOUR_PROJECT_NAME]/Images.xcassets/LaunchImage.launchimage

For Android

Revert what was done here with those 2 steps:

  1. rm android/app/src/main/res/drawable/launch_screen_bitmap.xml
  2. Remove all the splash assets located in android/app/src/main/res/drawable-*/launch_screen.png

Almouro avatar Nov 17 '17 08:11 Almouro

I'm seeing a glitch in my app, whenever the keyboard opens up I can see the splashscreen in the back. I wanted to remove splashscreen and use react-native-splash-screen to see if the glitch persists. Here's how it looks like: glitch

rizwanahmed19 avatar Nov 17 '17 09:11 rizwanahmed19

@Almouro Few things that are not clear to me related to removal of splashscreen are what do you mean by "Remove what happens here"? There are functions when I visit the link but where can I find those functions in my code? And do you mean Remove the line when you say Revert the line?

rizwanahmed19 avatar Nov 17 '17 09:11 rizwanahmed19

@rizwanahmed19 sorry I was not particularly clear. I just wanted to point to the line in the generator code where all the stuff was added. You only need to run the steps 1 and 2 for each platform

Almouro avatar Nov 17 '17 10:11 Almouro

@Almouro , I am new to react native . I tried the Splash screen , but always stays at background . How to fix that .

Kida007 avatar Nov 18 '17 15:11 Kida007

@Almouro I've performed the steps stated above but I get the error while building android by running react-native run-android. Here it is:

                                                                 :app:processDebugManifest
:app:processDebugResources
D:\Rizwan\RN\BalanceApp\android\app\build\intermediates\res\merged\debug\values\values.xml:296:47-77: AAPT: No resource found that matches the given name (at 'android:windowBackground' with value '@drawable/launch_screen_bitmap').

Failed to generate resource table for split ''
D:\Rizwan\RN\BalanceApp\android\app\build\intermediates\res\merged\debug\values\values.xml:296: error: Error: No resource found that matches the given name (at 'android:windowBackground' with value '@drawable/launch_screen_bitmap').


:app:processDebugResources FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:processDebugResources'.
> com.android.ide.common.process.ProcessException: Failed to execute aapt

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

I can't seem to find a workaround, I've tried deleting <item name="android:windowBackground">@drawable/launch_screen_bitmap</item> in values.xml but it doesn't work.

rizwanahmed19 avatar Nov 22 '17 14:11 rizwanahmed19

@rizwanahmed19 yes, you do need to delete that line. Maybe try to clean cd android && ./gradlew clean et build again.

But to be honest, @rizwanahmed19 @Kida007, if you guys agree, I'd rather we fix the issue for you guys instead of trying to revert the splashscreen :)

The splashscreen on Android is basically the app native background, so that's probably why you see it when opening the keyboard. The best way to prevent that is to create a separate Android activity called SplashActivity with the splash as the background. It would be responsible for launching the MainActivity. Basically, doing what is explained in this article.

Can you guys try that and check if this solves your issue, if you're comfortable enough with Android?

Almouro avatar Nov 26 '17 15:11 Almouro

@Almouro I just ran into the keyboard issue independently as well - it would be great if the readme could make this more clear that there is more too it than just adding the screenshots. Maybe it could include a link to what you linked or this article which helped me in the context of react native set up a separate activity: https://medium.com/handlebar-labs/how-to-add-a-splash-screen-to-a-react-native-app-ios-and-android-30a3cec835ae

zibs avatar Dec 18 '17 21:12 zibs

Hello, we just revamped the generator 😁

For up to date icon and splashscreen generation please use @bam.tech/react-native-make

Your issue comes from the splash screen actually being the entire's app background. The new version is based on react-native-splash-screen and current best practices so it should solve your issue 😉

yleflour avatar Sep 05 '19 14:09 yleflour