React native 入门二 魅力展示
来源:互联网 发布:cepii世界贸易数据库 编辑:程序博客网 时间:2024/06/04 19:12
打下面代码copy至index.os.js 和index.android.js
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
- 53
- 54
- 55
- 56
- 57
- 58
- 59
- 60
- 61
- 62
- 63
- 64
- 65
- 66
- 67
- 68
- 69
- 70
- 71
- 72
- 73
- 74
- 75
- 76
- 77
- 78
- 79
- 80
- 81
- 82
- 83
- 84
- 85
- 86
- 87
- 88
- 89
- 90
- 91
- 92
- 93
- 94
- 95
- 96
- 97
- 98
- 99
- 100
- 101
- 102
- 103
- 104
- 105
- 106
- 107
- 108
- 109
- 110
- 111
- 112
- 113
- 114
然后分别真机运行android和iOS项目即可
如果正常就可以看到运行结果
android可能遇见的问题
红屏问题”Could not get BatchedBridge, make sure your bundle is packaged correctly”
解决方法: 主要就只遇到这一个问题, 更改ip和port没有解决了, 后来在package.json中的”scripts”中添加”bundle-android”:”react-native bundle –platform android –dev false –entry-file index.android.js –bundle-output android/app/src/main/assets/index.android.bundle –sourcemap-output android/app/src/main/assets/index.android.map –assets-dest android/app/src/main/res/”,
如果没有assets目录,手动添加下,不过运行时没有效果,
在cmd中手动执行下, assets目录中会多出几个文件, 即可解决这个问题
阅读全文
0 0
- React native 入门二 魅力展示
- React native 入门二 魅力展示
- React Native 二:快速入门
- React Native 入门(二)
- React Native基础与入门(二)--初识React Native
- React Native (一) --React 入门
- React Native课程-入门
- React-Native入门指南
- React-Native入门
- react native 入门探索
- 入门React-Native世界
- iOS React Native 入门
- Android react native 入门
- react-native windows 入门
- React Native 入门姿势
- React native 入门一
- React Native入门
- React Native 入门
- python学习---第九天
- java-interface(接口)
- Oracle Spacial(空间数据库)查询空间数据2
- linux下join命令的用法
- 行为级和RTL级的区别
- React native 入门二 魅力展示
- Ubuntu14.04下安装ROS(Robot Operating System)
- 统计难题
- spring cloud + spring boot + springmvc+mybatis分布式微服务云架构
- Python学习——str.replace()方法与re.sub()方法对比
- leetcode_5. Longest Palindromic Substring ? 待解决
- java-web EL表达式
- 工业相机与镜头的一些参数
- 使用freertos V9.0.0需要注意的几个问题