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.