Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove splashscreen #144

Open
rizwanahmed19 opened this issue Nov 13, 2017 · 10 comments
Open

Remove splashscreen #144

rizwanahmed19 opened this issue Nov 13, 2017 · 10 comments
Labels

Comments

@rizwanahmed19
Copy link

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

@JenSebastian
Copy link

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

@Almouro
Copy link
Member

Almouro commented Nov 17, 2017

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

@rizwanahmed19
Copy link
Author

rizwanahmed19 commented Nov 17, 2017

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
Copy link
Author

@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?

@Almouro
Copy link
Member

Almouro commented Nov 17, 2017

@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

@Kida007
Copy link

Kida007 commented Nov 18, 2017

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

@rizwanahmed19
Copy link
Author

@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.

@Almouro Almouro added the Assets label Nov 26, 2017
@Almouro
Copy link
Member

Almouro commented Nov 26, 2017

@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?

@zibs
Copy link

zibs commented Dec 18, 2017

@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

@yleflour
Copy link

yleflour commented Sep 5, 2019

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 😉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants