android - 在运行 react-native run-android 时遇到问题
问题描述
自从我安装了 react-native-vector-icons 后,我一直在尝试在我的 android 上运行该应用程序时遇到麻烦。
这是我尝试 react-native run-android 命令时显示的内容:
FAILURE:构建失败并出现异常。
出了什么问题:配置项目“:react-native-vector-icons”时出现问题。
无法解析配置“:react-native-vector-icons:classpath”的所有依赖项。无法从 C:\Users\Pichau.gradle\caches\modules-2\metadata-2.71\descriptors\org.jetbrains.kotlin\kotlin-stdlib-common\1.3.20\475b59a03ea03e6388c8f34eee6a9d08\descriptor.bin 加载模块元数据
尝试:使用 --stacktrace 选项运行以获取堆栈跟踪。使用 --info 或 --debug 选项运行以获得更多日志输出。运行 --scan 以获得完整的见解。
在https://help.gradle.org获得更多帮助
10 秒内构建失败
错误 无法安装应用程序。确保您已设置 Android 开发环境:https ://facebook.github.io/react-native/docs/getting-started.html#android-development-environment 。使用 --verbose 标志运行 CLI 以获取更多详细信息。错误:命令失败:gradlew.bat app:installDebug -PreactNativeDevServerPort=8081
FAILURE:构建失败并出现异常。
出了什么问题:配置项目“:react-native-vector-icons”时出现问题。
无法解析配置“:react-native-vector-icons:classpath”的所有依赖项。无法从 C:\Users\Pichau.gradle\caches\modules-2\metadata-2.71\descriptors\org.jetbrains.kotlin\kotlin-stdlib-common\1.3.20\475b59a03ea03e6388c8f34eee6a9d08\descriptor.bin 加载模块元数据
尝试:使用 --stacktrace 选项运行以获取堆栈跟踪。使用 --info 或 --debug 选项运行以获得更多日志输出。运行 --scan 以获得完整的见解。
在https://help.gradle.org获得更多帮助
10 秒内构建失败
at checkExecSyncError (child_process.js:621:11)
at execFileSync (child_process.js:639:15)
at runOnAllDevices (C:\Users\Pichau\Desktop\PetCare-RN\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:74:39)
at buildAndRun (C:\Users\Pichau\Desktop\PetCare-RN\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\index.js:158:41)
at C:\Users\Pichau\Desktop\PetCare-RN\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\index.js:125:12
at processTicksAndRejections (internal/process/task_queues.js:85:5)
at async Command.handleAction (C:\Users\Pichau\Desktop\PetCare-RN\node_modules\@react-native-community\cli\build\cliEntry.js:160:7)
解决方案
这是我的 package.json 文件 { "name": "petcare", "version": "0.0.1", "private": true, "scripts": { "start": "react-native start", "test" : "jest" }, "dependencies": { "react": "16.8.6", "react-native": "0.60.5", "react-native-gesture-handler": "^1.3.0", “react-native-vector-icons”:“^6.6.0”,“react-navigation”:“^3.11.1”},“devDependencies”:{“@babel/core”:“^7.5.0”, “@babel/runtime”:“^7.5.0”、“@react-native-community/eslint-config”:“^0.0.3”、“babel-jest”:“^24.1.0”、“jest” :“^24.1.0”、“metro-react-native-babel-preset”:“0.54.1”、“react-test-renderer”:“16.8.6”}、“jest”:{“preset”:“反应原生“}}
推荐阅读
- shell - 优化 curl 命令的输出
- skype-for-business - Skype for Business Online 2016 UCWA
- c++ - bitbake grpc 交叉编译/配置失败并出现错误 c-ares::cares 引用文件 /usr/lib/libcares.so.2.2.0
- php - WhereHas 如果计数大于 2 则返回
- javascript - javascript中的方法和函数有什么区别
- python - 在 ubuntu 中的 python 上安装 pyOpt
- c# - 添加新项目后将列表重新组织到列表框中
- python - 无法针对熊猫数据框绘制线性回归预测模型
- android - Android上的配置文件
- php - PHP E_NOTICE 最佳实践 - 检查未定义的 var 的值是否不好?