我有一个非常困难的时间试图让 react-native run-android
在我的mac上运行,以便我的react-native android项目在模拟器中运行 . 该命令在我的Windows机器上运行正常 .
这是我得到的错误:
配置项目:react-native-vector-icons不推荐使用CompileOptions.bootClasspath属性,并计划在Gradle 5.0中删除它 . 请改用CompileOptions.bootstrapClasspath属性 . FAILURE:构建因异常而失败 . 出了什么问题:配置项目':app'时出现问题 . 无法解析配置':app:_debugApk'的所有依赖项 . 配置项目':react-native-vector-icons'时出现问题 . 无法通知项目评估监听器 . com.android.build.gradle.tasks.factory.AndroidJavaCompile.setDependencyCacheDir(Ljava / IO /文件;)V
在我的Android Studio中,我使用的是虚拟设备 Pixel API 26, API = 26, Target = Android 8.0 (Google APIs)
.
以下是我选择的SDK平台:
对于SDK工具,我选择了 23.0.1,26.0.1,26.0.2,27.0.1
.
如何让 react-native run-android
在我的模拟器中显示应用程序?
1 回答
尝试注释掉所有对react-native-vector-icons的引用,看看你的项目是否没有运行
尝试获取更新版本的react-native-vector-icons
尝试运行
react-native run-android --info --scan
,如果可以,请批准然后将批准的扫描链接粘贴到您的问题的更新中 .