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.

RuntimeException Can't convert to color:type=0x1

See original GitHub issue

Hi! I’ve just updated react-native-splash-screen in my project to the latest version and I’m getting a following RuntimeException:

--------- beginning of crash E/AndroidRuntime( 3926): FATAL EXCEPTION: main E/AndroidRuntime( 3926): Process: com.xxxxxx, PID: 3926 E/AndroidRuntime( 3926): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.xxxxxx/com.xxxxxx.MainActivity}: java.lang.UnsupportedOperationException: Can't convert to color:type=0x1 E/AndroidRuntime( 3926): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2325) E/AndroidRuntime( 3926): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2387) E/AndroidRuntime( 3926): at android.app.ActivityThread.access$800(ActivityThread.java:151) E/AndroidRuntime( 3926): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1303) E/AndroidRuntime( 3926): at android.os.Handler.dispatchMessage(Handler.java:102) E/AndroidRuntime( 3926): at android.os.Looper.loop(Looper.java:135) E/AndroidRuntime( 3926): at android.app.ActivityThread.main(ActivityThread.java:5254) E/AndroidRuntime( 3926): at java.lang.reflect.Method.invoke(Native Method) E/AndroidRuntime( 3926): at java.lang.reflect.Method.invoke(Method.java:372) E/AndroidRuntime( 3926): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903) E/AndroidRuntime( 3926): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698) E/AndroidRuntime( 3926): Caused by: java.lang.UnsupportedOperationException: Can't convert to color: type=0x1 E/AndroidRuntime( 3926): at android.content.res.TypedArray.getColor(TypedArray.java:404) E/AndroidRuntime( 3926): at com.android.internal.policy.impl.PhoneWindow.generateLayout(PhoneWindow.java:3477) E/AndroidRuntime( 3926): at com.android.internal.policy.impl.PhoneWindow.installDecor(PhoneWindow.java:3677) E/AndroidRuntime( 3926): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:368) E/AndroidRuntime( 3926): at android.app.Dialog.setContentView(Dialog.java:490) E/AndroidRuntime( 3926): at org.devio.rn.splashscreen.SplashScreen$1.run(SplashScreen.java:32) E/AndroidRuntime( 3926): at android.app.Activity.runOnUiThread(Activity.java:5293) E/AndroidRuntime( 3926): at org.devio.rn.splashscreen.SplashScreen.show(SplashScreen.java:26) E/AndroidRuntime( 3926): at org.devio.rn.splashscreen.SplashScreen.show(SplashScreen.java:47) E/AndroidRuntime( 3926): at com.xxxxxx.MainActivity.onCreate(MainActivity.java:13) E/AndroidRuntime( 3926): at android.app.Activity.performCreate(Activity.java:5990) E/AndroidRuntime( 3926): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1106) E/AndroidRuntime( 3926): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2278) E/AndroidRuntime( 3926): ... 10 more

I can see SplashScreen references there and latest merges added support for Status Bar color (which I don’t need so I haven’t change my config files). When I disable SplashScreen the exception is gone. What can I do to make it work?

My config: compileSdkVersion 26 buildToolsVersion "26.0.1" defaultConfig { applicationId "xxxxxxx" minSdkVersion 16 targetSdkVersion 26 versionCode 1 versionName "1.0" ndk { abiFilters "armeabi-v7a", "x86" } renderscriptTargetApi 23 renderscriptSupportModeEnabled true }

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6

github_iconTop GitHub Comments

36reactions
zh2120commented, Nov 6, 2017

In andorid, I created android/app/src/main/res/values/colors.xml, and setting content <?xml version="1.0" encoding="utf-8"?> <resources> <color name="primary_dark">#660B0B0B</color> </resources> It’s worked

0reactions
zh2120commented, Nov 11, 2017

@jcharlet I found that this problem only appears in some Android (7.0 or above) system. This problem has been closed, indicating that the author has obtained the problem and is trying to fix it. If you can not wait, you can fork or PR. Cheers!

Read more comments on GitHub >

github_iconTop Results From Across the Web

java.lang.UnsupportedOperationException: Can't convert to ...
<item name="android:textColor">@color/actionbar_text</item> ... I have the same error ( Can't convert value at index 1 to color: type=0x1 ) with this code:
Read more >
Java.lang.UnsupportedOperationException: Can't convert to color ...
UnsupportedOperationException: Can't convert to color: type=0x1. androidandroid-stylesjavaxml. I've been following throught the myfirstapp guide on Android ...
Read more >
componentid:192731+ - Issue Tracker
P TYPE STATUS ID LAST MODIFIED P2 Feature Request Assigned 262284140 Dec 12, 2022 01:53PM P1 Bug Assigned 262271064 Dec 12, 2022 03:52PM P1 Task Assigned...
Read more >
[ROM][10]Android Open Source Illusion Project[Coral][Flame ...
UnsupportedOperationException: Can't convert value at index 0 to color: type=0x1 stacktrace: java.lang.RuntimeException: Unable to start ...
Read more >
Attachment crash - Aqua Mail
RuntimeException : Unable to start activity ... UnsupportedOperationException: Can't convert to color: type=0x1 at android.app.ActivityThread.
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