React-native-splash-screen: Caused by: java.lang.UnsupportedOperationException: Can't convert value at index 35 to color: type=0x1

Created on 16 Dec 2017  Â·  9Comments  Â·  Source: crazycodeboy/react-native-splash-screen

Caused by: java.lang.UnsupportedOperationException: Can't convert value at index 35 to color: type=0x1
@override
protected void onCreate(Bundle savedInstanceState) {
SplashScreen.show(this); // error is just right here
super.onCreate(savedInstanceState);
}

without putting these file it wont run



Most helpful comment

@rizwan92 not cool at all to take shots at an OSS library, especially on their site. That's very impolite. Please keep it positive.

Regarding this issue, as @basudz365, add a res/values/colors.xml file with something like

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <!-- this is referenced by react-native-splash-screen and will throw an error if not defined.  its value does nothing, just here to avoid a runtime error. -->
    <color name="primary_dark">#000000</color>
</resources>

All 9 comments

Got the same trouble - did you fix it? Not understanding...

I used react-native-smart-splash-screen better than this library https://github.com/react-native-component/react-native-smart-splash-screen

@nmorozov solution here is the fix for this.

This library has a reference to a color called primary_dark that needs to exist in your project, even if you don't use it.
Without having it set in your project, the newer support libraries, 24/25 and above cause a crash. Maybe lower versions as well but that is what I have noticed.
Adding in a value for primary_dark in your colors.xml file fixes the issue. The color value can be anything you want.

@rizwan92 not cool at all to take shots at an OSS library, especially on their site. That's very impolite. Please keep it positive.

Regarding this issue, as @basudz365, add a res/values/colors.xml file with something like

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <!-- this is referenced by react-native-splash-screen and will throw an error if not defined.  its value does nothing, just here to avoid a runtime error. -->
    <color name="primary_dark">#000000</color>
</resources>

@StevePotter sir i dont understand, what do you mean by not cool at all to take shots at an OSS library, especially on their site. is there anything i have done wrong?

@rizwan92 He is referring to your post about using a different library and saying that it is better. That is not appropriate given that the author has taken his personal time to develop and share it. Many people use this library and very much appreciate the efforts taken to create it for us.

These pages are to discuss problems that we encounter, to help each other, and to improve these libraries for the good of the community.

@StevePotter @basudz365 i am really sorry for that, I am new to gihub. i had no idea we should not recommend another library like this in issue post. sorry again my mistake.

No big deal, just trying to keep things positive.

On Thu, Dec 21, 2017 at 10:26 AM, MD. Rizwan Raza notifications@github.com
wrote:

@StevePotter https://github.com/stevepotter @basudz365
https://github.com/basudz365 i am really sorry for that, I am new to
gihub. i had no idea we should not recommend another library like this in
issue post. sorry again my mistake.

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/crazycodeboy/react-native-splash-screen/issues/144#issuecomment-353378741,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAQi_1jayz6Pgzq6hdxGgNKepnhH3yqzks5tCni4gaJpZM4RESST
.

--
Stephen Potter,
Developer @ Vydia.com

@StevePotter It works for me, thinks

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mharrisweb picture mharrisweb  Â·  3Comments

jetre219 picture jetre219  Â·  4Comments

grundmanise picture grundmanise  Â·  3Comments

ijry picture ijry  Â·  5Comments

arnsa picture arnsa  Â·  5Comments