首页 > 解决方案 > Bare React Native Up and Running (Expo), Expo-web-browser:compileDebugJavaWithJavac

问题描述

我试图按照 Expo 文档来做出原生反应(链接)。

我在 Linux Manjaro 的 android 模拟器上运行。

安装后expo init --template bare-minimumreact-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错误。可能没有正确设置环境?

标签: androidreact-nativeexpo

解决方案


找到了答案

这是由于 Android 到 Android X 的迁移,其中映射已更改。比如 android.support.annotation.Nullableandroidx.annotation.Nullable

其中有很多,我不完全记得所有这些。但是如果你在 Android Studio 中运行它们,你尝试构建它,它会告诉你错误在哪里和哪一行,所以你可以在这个链接中搜索它们


推荐阅读