【问题标题】:run Gitlab pipeline failed after updating gradle to 7.0.2将 gradle 更新到 7.0.2 后运行 Gitlab 管道失败
【发布时间】:2021-11-14 01:05:13
【问题描述】:

我正在使用带有 java dor 的 android studio 创建 android 应用程序,并且在 Gitlab 中将 gradle 更新到 7.0.2 管道后出现文本失败:

FAILURE: Build failed with an exception.
* Where:
Build file '/builds/kbinform/education72-android/Edu72/build.gradle' line: 1
* What went wrong:
A problem occurred evaluating project ':Edu72'.
> Failed to apply plugin 'com.android.internal.application'.
   > Android Gradle plugin requires Java 11 to run. You are currently using Java 1.8.
     You can try some of the following options:
       - changing the IDE settings.
       - changing the JAVA_HOME environment variable.
       - changing `org.gradle.java.home` in `gradle.properties`.

尝试更改 IDE 设置但没有帮助 https://i.stack.imgur.com/1MxL2.png

【问题讨论】:

  • 面临类似问题..你解决了吗

标签: java android gradle gitlab


【解决方案1】:

Settings > Build, Execution, Deployment > Build Tools > Gradle > Gradle JDK

从下拉列表中选择Android Studio Default JDK

【讨论】:

  • 我试过但没有帮助
  • android { compileOptions { sourceCompatibility JavaVersion.VERSION_11 targetCompatibility JavaVersion.VERSION_11 } kotlinOptions { jvmTarget = JavaVersion.VERSION_11.toString() useIR = true } } 试试这个
  • 没有改变
  • 您始终可以通过转到 File > Project Structure 来降级,然后将值更改为 Android Gradle Plugin Version 和 Gradle Plugin Version 到 4.2.1 和 6.9
猜你喜欢
  • 2021-11-17
  • 2015-04-11
  • 2018-09-06
  • 2019-09-13
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多