react-native-splash-screen icon indicating copy to clipboard operation
react-native-splash-screen copied to clipboard

Android app crashes on open

Open radjivF opened this issue 8 years ago • 11 comments

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?

radjivF avatar Jul 31 '18 00:07 radjivF

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.

VahidBo avatar Jul 31 '18 04:07 VahidBo

@ 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 avatar Aug 02 '18 10:08 wachidyulio

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

nilaybrahmbhatt avatar Aug 11 '18 18:08 nilaybrahmbhatt

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

WilliamAlexander avatar Aug 14 '18 15:08 WilliamAlexander

@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

aaronshier avatar Aug 16 '18 21:08 aaronshier

@idtechnology hope that you can see something at here https://medium.com/handlebar-labs/how-to-add-a-splash-screen-to-a-react-native-app-ios-and-android-30a3cec835ae

thongnx6 avatar Sep 28 '18 01:09 thongnx6

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

Riant avatar Nov 16 '18 01:11 Riant

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 😄 👍

mepritam avatar Jan 04 '19 12:01 mepritam

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

radjivF avatar Jan 15 '19 01:01 radjivF

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

Thank bro, this worked for me <3

thaitd96 avatar Apr 11 '21 11:04 thaitd96

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

thanks bro. this worked for me

Zeta-DangTam avatar Jan 06 '22 04:01 Zeta-DangTam