React-native-splash-screen: 在模拟器安卓4.0上运行正常,在手机上安卓6.0 7.0都闪退 不知道什么情况求解

Created on 29 Dec 2017  ·  11Comments  ·  Source: crazycodeboy/react-native-splash-screen

在模拟器安卓4.0上运行正常,在手机上安卓6.0 7.0都闪退 不知道什么情况求解

Most helpful comment

Sorry I don't speak Chinese but if you are having a problem getting Android working, @supermanxiacheng has the answer that I used to get it working.
In my app, the file is android/app/src/main/res/values/colors.xml
File contents:

<?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 11 comments

同样遇到这个问题。不知道怎么解决

遇到了同样的问题

127

应该和这个issue的解决方法相同.

嗨,尝试这个方法:

创建文件 android/app/src/main/res/values/colors.xml
填入一下内容

<?xml version="1.0" encoding="utf-8"?> <resources> <color name="primary_dark">#660B0B0B</color> </resources>

@supermanxiacheng 不是这个 而且打包屏显后闪退 @readthecodes @ZhaZhengRefn @spenggithub @StevePotter 你们解决没

Sorry I don't speak Chinese but if you are having a problem getting Android working, @supermanxiacheng has the answer that I used to get it working.
In my app, the file is android/app/src/main/res/values/colors.xml
File contents:

<?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 Your solution work! Thanks!
I am using React Native 0.51 and react-native run-android

楼上说加个 colors.xml 文件 + 填入内容可以解决闪退问题。
试了管用。

React Native 0.51 + 在安卓模拟器上运行。

我看了好几次文档以为自己哪里做错了。原来是这样的小问题。

@crazycodeboy 建议把这个问题加入文档
(安卓闪退问题,加个 colors.xml 解决)

在使用react-native-splash-screenAPP的color.xml中添加:

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <color name="primary_dark">#000000</color>
</resources>

react-native-splash-screen需要一个名为primary_dark的颜色值作为状态栏的颜色;

@StevePotter Hi,guys,successfully solved my problem,thanks.

到底是 colors.xml 还是 color.xml??

Was this page helpful?
0 / 5 - 0 ratings

Related issues

luqingxuan picture luqingxuan  ·  3Comments

summerPsyche picture summerPsyche  ·  5Comments

ijry picture ijry  ·  5Comments

zhaogao picture zhaogao  ·  4Comments

johndo31 picture johndo31  ·  3Comments