Skip to content

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

Open
@spenggithub

Description

@spenggithub

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

Activity

ZhaZhengRefn

ZhaZhengRefn commented on Dec 29, 2017

@ZhaZhengRefn

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

readthecodes

readthecodes commented on Dec 29, 2017

@readthecodes

遇到了同样的问题

supermanxiacheng

supermanxiacheng commented on Jan 3, 2018

@supermanxiacheng

#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>

showtan

showtan commented on Jan 8, 2018

@showtan

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

StevePotter

StevePotter commented on Jan 8, 2018

@StevePotter
Contributor

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>
1c7

1c7 commented on Jan 9, 2018

@1c7

@StevePotter Your solution work! Thanks!
I am using React Native 0.51 and react-native run-android

1c7

1c7 commented on Jan 9, 2018

@1c7

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

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

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

1c7

1c7 commented on Jan 9, 2018

@1c7

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

crazycodeboy

crazycodeboy commented on Jan 11, 2018

@crazycodeboy
Owner

在使用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的颜色值作为状态栏的颜色;

DruidTedaHill

DruidTedaHill commented on Apr 13, 2018

@DruidTedaHill

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

jsu93

jsu93 commented on Apr 19, 2018

@jsu93

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @StevePotter@1c7@crazycodeboy@readthecodes@supermanxiacheng

        Issue actions

          在模拟器安卓4.0上运行正常,在手机上安卓6.0 7.0都闪退 不知道什么情况求解 · Issue #149 · crazycodeboy/react-native-splash-screen