Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
spenggithub opened this issue Dec 29, 2017 · 11 comments

Comments

@spenggithub
Copy link

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

@ZhaZhengRefn
Copy link

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

@readthecodes
Copy link

遇到了同样的问题

@supermanxiacheng
Copy link

supermanxiacheng commented Jan 3, 2018

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

showtan commented Jan 8, 2018

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

@StevePotter
Copy link
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
Copy link

1c7 commented Jan 9, 2018

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

@1c7
Copy link

1c7 commented Jan 9, 2018

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

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

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

@1c7
Copy link

1c7 commented Jan 9, 2018

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

@crazycodeboy
Copy link
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
Copy link

DruidTedaHill commented Apr 13, 2018

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

@jsu93
Copy link

jsu93 commented Apr 19, 2018

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants