我正在设置 Jenkins 以使用我们的 Android 应用程序。 我获取源代码并尝试构建它。
构建失败并显示以下消息:
10:43:35.419 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]
10:43:35.419 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] FAILURE: Build failed with an exception.
10:43:35.420 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]
10:43:35.420 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * What went wrong:
10:43:35.420 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] A problem occurred configuring project ':mobile'.
10:43:35.420 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] > Failed to notify project evaluation listener.
10:43:35.420 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] > Could not initialize class com.android.sdklib.repository.AndroidSdkHandler
10:43:35.421 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]
10:43:35.421 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * Exception is:
10:43:35.421 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] org.gradle.api.ProjectConfigurationException: A problem occurred configuring project ':mobile'.
A problem occurred configuring project ':mobile'.
> Failed to notify project evaluation listener.
> Could not initialize class com.android.sdklib.repository.AndroidSdkHandler
有什么解决方案吗?在网上找不到任何有用的东西
最佳答案
卸载 Java SDK 版本 9 并安装 Java SDK 版本 8 为我解决了这个问题。
我按照以下说明在 OS X 上卸载了 SDK:
http://docs.oracle.com/javase/8/docs/technotes/guides/install/mac_jdk.html
关于java - Jenkins 构建失败 - Android 应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46623393/