React Native在Android Studio配置中遇到的问题

1、jcenter、maven总是提示sync failed

在国内普通方式访问不通,使用vpn还是不通,想了无数办法,最后在偶然的机会换了一个电信的网络,通了,真是欲哭无泪。

2、Cannot resolve symbol 'ReactApplication/ReactNativeHost'

allprojects {
    repositories {
        mavenLocal()
        jcenter()
        maven {
            url 'http://maven.aliyun.com/nexus/content/groups/public/'//用国内aliyun、不用google
        }

        maven {
            url "$rootDir/../node_modules/react-native/android"
        }
        google()
    }
}

3、Exception in thread "main" javax.net.ssl.SSLException: Connection has been shutdown: javax.net.ssl.SSLException: java.net.SocketException: Connection reset

网络问题,不要再纠结缺什么包、什么配置不对啊。

4、模拟器上报错:unable to load script from assets 'index.android.bundle'.Make sure your bundle ispackged correctly or you are running a packger server.

(1).在mkdir /android/app/src/main/assets

(2).运行:react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res

5、当一切顺利后,显示出了默认的React Native提示页面,修改后双击R刷新,页面一直不变,提示“Could not connect to development server.”

点击模拟器侧面图标,显示“Dev Setting”-->"Debugging"--> Debug server host&port for device-->电脑IP:8081.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值