question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[expo-splash-screen] expo install expo-splash-screen will install old version of package and lead to compilation error

See original GitHub issue

🐛 Bug Report

Summary of Issue

Following the tutorial for expo-splash-screen installation on bare react native projects will lead to compilation errors https://github.com/expo/expo/tree/master/packages/expo-splash-screen#-installation-in-bare-react-native-projects

expo install expo-splash-screen will execute yarn add expo-splash-screen@^0.3.1

Then when running “yarn android” it will throw

MainActivity.java:19: error: incompatible types: boolean cannot be converted to Class<? extends ViewGroup>
    SplashScreen.show(this, SplashScreenImageResizeMode.CONTAIN, false);

If i manually update to the latest 0.4.0 yarn add expo-splash-screen@~0.4.0 the issue is resolved.

Environment - output of expo diagnostics & the platform(s) you’re targeting

  Expo CLI 3.22.3 environment info:
    System:
      OS: Windows 10 10.0.18362
    Binaries:
      Node: 14.4.0 - C:\Program Files\nodejs\node.EXE
      Yarn: 1.22.4 - C:\Users\Myself\AppData\Roaming\npm\yarn.CMD
      npm: 6.14.4 - C:\Program Files\nodejs\npm.CMD
    npmPackages:
      expo: ~38.0.1 => 38.0.8
      react: ~16.11.0 => 16.11.0
      react-dom: ~16.11.0 => 16.11.0
      react-native: ~0.62.2 => 0.62.2
      react-native-web: ~0.11.7 => 0.11.7

Android

Reproducible Demo

Steps to Reproduce

expo init test -t bare-minimum cd test expo install expo-splash-screen react-native run-android

Expected Behavior vs Actual Behavior

The expected behavior is for compilation to succeed.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
commodditycommented, Aug 31, 2020

Is there any way to use old version 0.3.1? Expo has it own bundled version 0.5 and running pod-install installs the higher version. Splash screen methods like preventAutoHideAsync and hideAsync only work in 0.3.1.

@gabrielbezerra81 I was having the same issue and I was able to solve it via the following steps:

  • Install 'expo-splash-screen" at 0.3.1 in package.json
  • Update Podfile as per unimodules instructions to exclude the included version of ‘expo-splash-screen’ by updating the line use_unimodules! to use_unimodules!(exclude: ['expo-splash-screen'])
  • Manually install the expo-splash-screen pods from Podfile with the line
pod 'EXSplashScreen', :path => '../node_modules/expo-splash-screen/ios'
  • Keep the AppDelegate.m file as before

After doing this and running a fresh pod install I was able to use the SplashScreen.preventAutoHideAsync and SplashScreen.hideAsync methods with their desired functionality.

2reactions
brentvatnecommented, Aug 31, 2020

This repo says 0.5.0:

you’re looking at the master branch, you should check the sdk-* branch bundledNativeModules.json when looking for the required dependency.


that said, i just published a release of the expo package to point to expo-splash-screen@^0.5.0 in bundledNativeModules for sdk 38. this will fix the warning that users see when installing expo-splash-screen alongside the expo package. the original topic of this issue was resolved previously but the fix resulted in this aforementioned warning, and that is now resolved in expo@38.0.10.

@gabrielbezerra81 @Commoddity - let’s track the issue you’re encountering in https://github.com/expo/expo/issues/9286. i pinged @bbarthec about it

Read more comments on GitHub >

github_iconTop Results From Across the Web

SplashScreen - Expo Documentation
The SplashScreen module from the expo-splash-screen library is used to tell the splash screen to remain visible until it has been explicitly told...
Read more >
Execution failed for task ':expo-splash-screen ... - Stack Overflow
Task :expo-splash-screen:compileDebugKotlin FAILED w: Runtime JAR files in the classpath should have the same version.
Read more >
@expo/configure-splash-screen | Yarn - Package Manager
This package provides CLI command that helps you configure expo-splash-screen module. You can use it to configure your native iOS and Android project ......
Read more >
expo-splash-screen - npm
Provides a module to allow keeping the native Splash Screen visible until you choose to hide it.. Latest version: 0.17.5, last published: a ......
Read more >
Expo SDK 38 is now available - DEV Community ‍ ‍
Today, we're announcing our summer 2020 release, ☀️ Expo SDK 38 ... can run expo client:install:ios and expo client:install:android .
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found