Skip to content
This repository has been archived by the owner on Jan 18, 2024. It is now read-only.

[configure-splash-screen] Incorrect call for SplashScreen.show in MainActivity #2586

Closed
rodrigorm opened this issue Sep 5, 2020 · 5 comments · Fixed by #2698
Closed

[configure-splash-screen] Incorrect call for SplashScreen.show in MainActivity #2586

rodrigorm opened this issue Sep 5, 2020 · 5 comments · Fixed by #2698
Assignees
Labels

Comments

@rodrigorm
Copy link

I have ejected my projected and the configure-splash-screen generate the following invalid code:

SplashScreen.show(this, SplashScreenImageResizeMode.CONTAIN, false);

The correct code should be:

SplashScreen.show(this, SplashScreenImageResizeMode.CONTAIN, ReactRootView.class, false);

I am using:

expo: 38.0.3
expo-cli: 3.26.2
expo-splash-screen: 0.3.1

@byCedric byCedric added the bug Something isn't working label Sep 24, 2020
@byCedric
Copy link
Member

byCedric commented Sep 24, 2020

Hi @rodrigorm! Sorry for the delay, and thanks for writing in. I can confirm this is happening when ejecting on SDK 39 as well. I marked it as bug, we will get to this asap! (cc @EvanBacon)

For context, It's located in the MainActivity and here is the exact error on Android:

<path>/background-location-bare/android/app/src/main/java/com/bycedric/backgroundlocation/MainActivity.java:19: error: no suitable method found for show(MainActivity,SplashScreenImageResizeMode,boolean)
    SplashScreen.show(this, SplashScreenImageResizeMode.CONTAIN, false);
                ^
    method SplashScreen.show(Activity,SplashScreenViewProvider,Class<? extends ViewGroup>,boolean,Function0<Unit>,Function1<? super String,Unit>) is not applicable
      (actual and formal argument lists differ in length)
    method SplashScreen.show(Activity,SplashScreenViewProvider,Class<? extends ViewGroup>,boolean,Function0<Unit>) is not applicable
      (actual and formal argument lists differ in length)
    method SplashScreen.show(Activity,SplashScreenViewProvider,Class<? extends ViewGroup>,boolean) is not applicable
      (actual and formal argument lists differ in length)
    method SplashScreen.show(Activity,SplashScreenImageResizeMode,Class<? extends ViewGroup>,boolean,SplashScreenViewProvider,Function0<Unit>,Function1<? super String,Unit>) is not applicable
      (actual and formal argument lists differ in length)
    method SplashScreen.show(Activity,SplashScreenImageResizeMode,Class<? extends ViewGroup>,boolean,SplashScreenViewProvider,Function0<Unit>) is not applicable
      (actual and formal argument lists differ in length)
    method SplashScreen.show(Activity,SplashScreenImageResizeMode,Class<? extends ViewGroup>,boolean,SplashScreenViewProvider) is not applicable
      (actual and formal argument lists differ in length)
    method SplashScreen.show(Activity,SplashScreenImageResizeMode,Class<? extends ViewGroup>,boolean) is not applicable
      (actual and formal argument lists differ in length)

@basvdheijden
Copy link

Has there already been an update to fix this? As this issue is closed, I suppose there's a way (other than changing the ejected code manually) to resolve the issue?

@basvdheijden
Copy link

I'm using:

Expo: 39.0.3
Expo-splash-screen: 0.6.2
Expo-cli: 3.27.14

@bbarthec
Copy link
Contributor

bbarthec commented Oct 13, 2020

@basvdheijden, I've just confirmed that having a managed SDK-39 project and then ejecting is providing you with the correct version of the commands.
To be more precise I've did the following:

  • expo init, selected managed workflow
  • expo eject
  • yarn expo-splash-screen ...params...
  • obtained a valid MainActivity with the correct SplashScreen.show(this, SplashScreenImageResizeMode.CONTAIN, ReactRootView.class, false); signature.

My advice for you is to remove all the node_modules and reinstall the dependencies.
LMK if there's something that I'm missing in reproducing your case? 🤔

@basvdheijden
Copy link

It works now! :-) Thanks.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
4 participants