20180106
肖威工作总结
- 环境变量参考文章:http://www.chongchonggou.com/g_841616996.html
- https://zaaack.github.io/2017/05/27/ios-safari-scroll/
今天所遇到的问题:
- react-native run-android
rScanning folders for symlinks in /Users/xiaowei/caihuahengyiapp/node_modules (51ms) Starting JS server... Building and installing the app on the device (cd android && ./gradlew installDebug)... Unzipping /Users/xiaowei/.gradle/wrapper/dists/gradle-2.14.1-all/8bnwg5hd3w55iofp58khbp6yv/gradle-2.14.1-all.zip to /Users/xiaowei/.gradle/wrapper/dists/gradle-2.14.1-all/8bnwg5hd3w55iofp58khbp6yv Exception in thread "main" java.util.zip.ZipException: zip END header not found at java.base/java.util.zip.ZipFile$Source.zerror(ZipFile.java:1252) at java.base/java.util.zip.ZipFile$Source.findEND(ZipFile.java:1153) at java.base/java.util.zip.ZipFile$Source.initCEN(ZipFile.java:1160) at java.base/java.util.zip.ZipFile$Source.
(ZipFile.java:997) at java.base/java.util.zip.ZipFile$Source.get(ZipFile.java:960) at java.base/java.util.zip.ZipFile. (ZipFile.java:216) at java.base/java.util.zip.ZipFile. (ZipFile.java:148) at java.base/java.util.zip.ZipFile. (ZipFile.java:162) at org.gradle.wrapper.Install.unzip(Install.java:159) at org.gradle.wrapper.Install.access$500(Install.java:26) at org.gradle.wrapper.Install$1.call(Install.java:69) at org.gradle.wrapper.Install$1.call(Install.java:46) at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:65) at org.gradle.wrapper.Install.createDist(Install.java:46) at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:126) at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61) - 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
在看react-mative的视频的教程的时候,可以知道真正的错误不是在最后的红色,而是在前面的内容,在这个过程汇总,看到了一个解决掉的方法,但是执行不了,非常的郁闷;
- react-native项目run-android报告无法安装应用
z /〜/ Projects / ReactXP / reactxp / samples / TodoList(master●)中的ZsMBP
$ react-native run-android
在/ Users / z / Projects / ReactXP / reactxp / samples / TodoList / node_modules(7ms)中扫描740文件夹中的符号链接
JS服务器已经在运行。
在设备上构建和安装应用程序(cd android && ./gradlew installDebug)...
无法在设备上安装应用程序,请阅读上面的错误了解详情。
确保你有一个Android模拟器运行或设备连接和拥有
设置你的Android开发环境:
https://facebook.github.io/react-native/docs/android-setup.html
这个错误的解释废话太多,还是错的,其实手动运行下命令cd android && ./gradlew installDebug就会发现是./android/.gradlew这个文件没有执行权限导致的,运行一下
1chmod + x ./android/.gradlew 就可以了