初次接触到react-native,遇到的两个失误
来源:互联网 发布:数据修炼系统顶点 编辑:程序博客网 时间:2024/06/14 22:31
初次接触到react-native,遇到的两个失误
错误一
D:\node\AwesomeProject>react-native run-androidStarting JS server...Building and installing the app on the device (cd android && gradlew.bat installDebug)...Unzipping C:\Users\g\.gradle\wrapper\dists\gradle-2.14.1-all\8bnwg5hd3w55iofp58khbp6yv\gradle-2.14.1-all.zip to C:\Users\g\.gradle\wrapper\dists\gradle-2.14.1-all\8bnwg5hd3w55iofp58khbp6yvException in thread "main" java.util.zip.ZipException: error in opening zip file at java.util.zip.ZipFile.open(Native Method) at java.util.zip.ZipFile.<init>(ZipFile.java:219) at java.util.zip.ZipFile.<init>(ZipFile.java:149) at java.util.zip.ZipFile.<init>(ZipFile.java:163) 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 haveset up your Android development environment:https://facebook.github.io/react-native/docs/android-setup.htmlɾ³ýgradle-2.14.1-all°ü£¬ÖØÐÂÏÂÔØ¡£
解决办法
删掉C:\Users\g\.gradle\wrapper\dists\下的所有gradle包,重新下载,可能输网速的原因,或者其它原因导致包被破坏
错误二
ÎÊÌâ¶þLoading dependency graph, done.error: bundling: NotFoundError: Cannot find entry file index.android.js in any of the roots: ["D:\\node\\AwesomeProject\\node_modules\\react-native\\packager"] at DependencyGraph._getAbsolutePath (D:/node/AwesomeProject/node_modules/react-native/packager/src/node-haste/DependencyGraph.js:280:11) at DependencyGraph.getDependencies (D:/node/AwesomeProject/node_modules/react-native/packager/src/node-haste/DependencyGraph.js:218:26) at Resolver.getDependencies (D:/node/AwesomeProject/node_modules/react-native/packager/src/Resolver/index.js:107:27) at D:/node/AwesomeProject/node_modules/react-native/packager/src/Bundler/index.js:591:37 at next (native) at step (D:\node\AwesomeProject\node_modules\react-native\packager\src\Bundler\index.js:12:445) at D:\node\AwesomeProject\node_modules\react-native\packager\src\Bundler\index.js:12:605 at process._tickCallback (internal/process/next_tick.js:109:7)Bundling `index.android.js` 0.0% (0/1), failed.½â¾ö£º
解决方式
错误原因是create-react-native-app AwesomeProject命令和react-native
run-android混用导致的,解决办法是删掉工程,新建一个工程。创建工程命令正确的组合方式:
组合1
create-react-native-app AwesomeProject cd AwesomeProject npm start
组合2
react-native init AwesomeProject
cd AwesomeProject
react-native run-android
阅读全文
0 0
- 初次接触到react-native,遇到的两个失误
- react-native 初次编译遇到的问题
- React Native Android 初次试用遇到的各种坑
- React native初次使用的各种坑
- 初次接触React Native
- React Native遇到的问题
- react-native 遇到的错误
- react-native遇到的问题
- React Native遇到的坑
- React-native遇到的错误
- 【React Native】导入github上react native遇到的问题。
- React Native 环境配置遇到的坑
- React Native 配置遇到的错误:TransformError
- 安装react-native遇到的问题
- react-native遇到的坑,及解决方法
- React native安装过程遇到的问题
- React-native android 启动遇到的问题
- react native 遇到的问题总结
- 总结HTML中不经常使用的标签
- 父类子类指针相互转换问题
- Tick与GraphTask
- github Permission denied (publickey). fatal: Could not read from remote repository.
- python写算法题:leetcode: 22. Generate Parentheses
- 初次接触到react-native,遇到的两个失误
- QML实现窗口拖拽与阴影
- node 连接mongodb ---小白入门
- script.sh
- PHP--每日十个数组函数的学习
- 关于DCMTK中像素存储以及getoutdata()函数的使用
- HIVE SQL 的三种查找当前日期
- JAVA 日期工具类使用总结
- 444. Sequence Reconstruction