react native 的坑


按照http://reactnative.cn/docs/0.46/getting-started.html#content提供的步骤一步一步地来,也会出错,现在记录一下遇到的坑


1、运行iOS,报错  Print: Entry, ":CFBundleIdentifier", Does Not Exist

  a.尝试reset一下模拟器之后再,react-native run-ios

     点击模拟器Simulator,里面有Reset Content and Settings

   b. 新建指定项目版本,目前最新版本是0.46

react-native init myapp --version 0.44.3

2、创建项目时提示:Failed to downloadhttps://yarnpkg.com/latest.tar.gz

里面还有一句: Consider installing yarn to make this faster:https://yarnpkg.com

在终端输入命令:npm install -g yarn 

安装后查看版本:yarn --version,然后再重新创建项目即可

3、运行Androidreact-native run-android提示:“Could not install the app on the device, read the error above for details.

Make sure you have an Android emulator running or a device connected and have

set up your Android development environment:https://facebook.github.io/react-native/docs/android-setup.html

打开Android SDK Manager,确保如下工具和开发包已经安装:

SDK

  • Android SDK Build-tools version 23.0.1
  • Android 6.0(API 23)
  • Android Support Repository

模拟器:

  • Intel x86 Atom System Image(for Android 5.1.1 - API 22)
  • Intel x86 Emulator Accelerator(HAXM installer)

4、链接RCTCameraRoll库时,报错:error Couldn't find package "RCTCameraRoll" on the "npm" registry

1.npm install RCTCameraRoll --save

2.XCode打开项目,在Libraries文件夹右击-Add Files,在出来的文件选择中选择node_modules/RCTCameraRoll/这个文件夹,找到RCTCameraRoll.xcodeproj这个文件,并添加

3.选择Build Phases中的Link Binary With Libraries中添加libRCTCameraRoll.a



5、报错,-bash: adb: command not found 


参考:http://blog.sina.com.cn/s/blog_540316260101ftge.html


6.

Execution failed for task ':app:installDebug'.

> com.android.builder.testing.api.DeviceException: No connected devices!

就是没有能连接的设备,我的是mac系统的,就需要装一下genymotion,教程

http://blog.csdn.net/iosbird/article/details/76231570


后续待更。。。。。

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值