React-native-splash-screen: Android app crashes on open

Created on 31 Jul 2018  路  9Comments  路  Source: crazycodeboy/react-native-splash-screen

i got this error:

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':app'.
> Could not resolve all dependencies for configuration ':app:_debugApk'.
   > A problem occurred configuring project ':react-native-splash-screen'.
      > Could not resolve all dependencies for configuration ':react-native-splash-screen:_debugPublishCopy'.
         > Could not find com.android.support:appcompat-v7:26.1.0.

Any idea, what I could have done wrong?

Most helpful comment

@
Goto node_modules -> react-native-splash-screen -> build.gradle
Change

compileSdkVersion 26
buildToolsVersion "26.1.0"
to
compileSdkVersion 23
buildToolsVersion "23.0.1"

and

compile "com.android.support:appcompat-v7:26.1.0"
to
compile "com.android.support:appcompat-v7:23.0.1"

And then make sure your build.gradle on android -> app -> build.gradle has the same version

compileSdkVersion 23
buildToolsVersion "23.0.1"

and

compile "com.android.support:appcompat-v7:23.0.1"

All 9 comments

My app crashes at start, When I run my app on the android devices that use android 8. I got the full error log and I found the following error:

AndroidRuntime: java.lang.RuntimeException: Unable to start activity ComponentInfo{myAppPackage/myAppPackage.MainActivity}: java.lang.IllegalStateException: Only fullscreen opaque activities can request orientation

This error is because of setting android orientation.
And I test my app on a android device with android version 6 and my app works properly.

@
Goto node_modules -> react-native-splash-screen -> build.gradle
Change

compileSdkVersion 26
buildToolsVersion "26.1.0"
to
compileSdkVersion 23
buildToolsVersion "23.0.1"

and

compile "com.android.support:appcompat-v7:26.1.0"
to
compile "com.android.support:appcompat-v7:23.0.1"

And then make sure your build.gradle on android -> app -> build.gradle has the same version

compileSdkVersion 23
buildToolsVersion "23.0.1"

and

compile "com.android.support:appcompat-v7:23.0.1"

@wachidyulio but whats the solution for 26.0.1 ? having same problem.

Do not change the compileSdkVersion to 23.
Google are beginning to only accept apk files that are >=26

@VahidBo to fix Unable to start activity ComponentInfo I had to do what is described in this step:
https://github.com/crazycodeboy/react-native-splash-screen#getting-started

@VahidBo I removed the style line
<item name="android:windowIsTranslucent">true</item>
then it wokrs fine on Android 8.0

On your android/app/src/main/res/values/colors.xml add this line
<color name="primary_dark">#4F6D7A</color>

This line solved my app crash after open problem.

This is my full colors.xml code
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="blue">#4F6D7A</color>
<color name="primary_dark">#4F6D7A</color>
</resources>

Try this it may works for you 馃槃 馃憤

thx guys I think we can close it now, the @mepritam work for me

Was this page helpful?
0 / 5 - 0 ratings