android - Bare React Native Up and Running (Expo), Expo-web-browser:compileDebugJavaWithJavac
问题描述
我试图按照 Expo 文档来做出原生反应(链接)。
我在 Linux Manjaro 的 android 模拟器上运行。
安装后expo init --template bare-minimum
,react-native run-android
模拟器工作正常。
但是,在我运行之后npm install expo-web-browser
,它给出了这个错误。
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':expo-web-browser:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.
$react-native info
info
React Native Environment Info:
System:
OS: Linux 4.19 Manjaro Linux undefined
CPU: (8) x64 Intel(R) Core(TM) i5-8250U CPU @ 1.60GHz
Memory: 160.20 MB / 7.52 GB
Shell: 5.0.11 - /bin/bash
Binaries:
Node: 12.11.1 - /usr/bin/node
npm: 6.12.0 - /usr/bin/npm
SDKs:
Android SDK:
API Levels: 28, 29
Build Tools: 28.0.3, 29.0.2
System Images: android-28 | Intel x86 Atom, android-28 | Intel x86 Atom_64, android-28 | Google APIs Intel x86 Atom, android-28 | Google APIs Intel x86 Atom_64
npmPackages:
react: 16.8.3 => 16.8.3
react-native: 0.59.10 => 0.59.10
npmGlobalPackages:
create-react-native-app: 2.0.2
react-native-cli: 2.0.1
编辑 build.gradle 的
implementation "com.facebook.react:react-native:0.59.10" // From node_modules
编辑:
模块,主要是给我compileDebugJavaWithJavac
错误。可能没有正确设置环境?
解决方案
找到了答案
这是由于 Android 到 Android X 的迁移,其中映射已更改。比如
android.support.annotation.Nullable
到androidx.annotation.Nullable
。
其中有很多,我不完全记得所有这些。但是如果你在 Android Studio 中运行它们,你尝试构建它,它会告诉你错误在哪里和哪一行,所以你可以在这个链接中搜索它们
推荐阅读
- angular - 如何在 Ngrx 效果中组合多个可观察对象?
- spring - Spring Cloud 连接器计划信息
- firebase - Flutter Firebase Auth 返回 null,然后返回正确的值
- node.js - 错误:所需的气体超过限额或交易总是失败
- r - 重命名不适用于以两个点开头的列名
- database - Windows 批处理脚本中的 For /F 语句出错
- oracle - 更改项目属性可见或不可见的按钮
- excel - 如果单元格为空白且另一个单元格有数据,如何将其设置为 0
- bash - Bash脚本中的Sudo SU而不询问用户密码
- hadoop - Hadoop distcp 错误路径仍然复制 - 数据去了哪里?