【问题标题】:"expo-location:compileReleaseJavaWithJavac" error while building application using EAS build使用 EAS 构建构建应用程序时出现“expo-location:compileReleaseJavaWithJavac”错误
【发布时间】:2022-07-04 08:05:16
【问题描述】:

美好的一天。
我是 React Native 的新手,当我想构建我的应用程序时,我遇到了以下错误:

[stderr] /home/expo/workingdir/build/node_modules/expo-location/android/src/main/java/expo/modules/location/taskConsumers/LocationTaskConsumer.java:235: error: cannot find symbol

[stderr]       extras.putString("appId", mTask.getAppScopeKey());

[stderr]                                      ^

[stderr]   symbol:   method getAppScopeKey()

[stderr]   location: variable mTask of type TaskInterface

[stderr] Note: /home/expo/workingdir/build/node_modules/expo-location/android/src/main/java/expo/modules/location/taskConsumers/GeofencingTaskConsumer.java uses unchecked or unsafe operations.

[stderr] Note: Recompile with -Xlint:unchecked for details.

[stderr] 1 error

[stderr] FAILURE: Build failed with an exception.

[stderr] * What went wrong:

[stderr] Execution failed for task ':expo-location:compileReleaseJavaWithJavac'.

[stderr] > Compilation failed; see the compiler error output for details.

[stderr] * Try:

[stderr] Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan

[stderr] to get full insights.

[stderr] * Get more help at https://help.gradle.org

[stderr] BUILD FAILED in 4m 34s

我的 eas.json 文件如下所示:

{
  "cli": {
    "version": ">= 0.52.0"
  },
  "build": {
    "development": {
      "developmentClient": true,
      "distribution": "internal"
    },
    "preview": {
      "android": {
        "buildType": "apk"
      },
      "distribution": "internal"
    },
    "production": {}
  },
  "submit": {
    "production": {}
  }
}

在一些消息来源中,据说将构建服务器映像更改为“最新”可以解决问题。但它没有。
我该如何克服这个问题?

【问题讨论】:

  • 你以后能解决这个问题吗??
  • 我无法解决问题:(

标签: java android react-native build expo


【解决方案1】:

我后来找到了答案 frawen。 你需要在你的 eas.json 中添加你的 jdk 版本的最新镜像

这是我的:

{
  "cli": {
    "version": ">= 0.54.1"
  },
  "build": {
    "development": {
      "env":{
        "ANDROID_SDK_ROOT": "C:/Users/user/AppData/Local/Android/Sdk"
      },
      "developmentClient": true,
      "distribution": "internal",
      "android": {
        "image": "ubuntu-18.04-jdk-11-ndk-r19c"
      }
    },
    "preview": {
      "distribution": "internal"
    },
    "production": {}
  },
  "submit": {
    "production": {}
  }
}

只要您的 jdk 版本等于或高于 11,您就可以使用与我相同的图像 (ubuntu-18.04-jdk-11-ndk-r19c)。

【讨论】:

    猜你喜欢
    • 2022-11-10
    • 2023-02-25
    • 2022-11-10
    • 2023-02-17
    • 2023-01-05
    • 1970-01-01
    • 1970-01-01
    • 2022-06-15
    • 1970-01-01
    相关资源
    最近更新 更多