Jenkins构建失败 - Android应用程序

时间:2017-10-07 18:00:38

标签: java android jenkins automation devops

我正在设置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

有任何解决方案吗?在网上找不到任何有用的东西

1 个答案:

答案 0 :(得分:1)

卸载Java SDK Version 9并安装Java SDK Version 8为我解决了这个问题。

我使用以下说明在OS X上卸载了SDK:

http://docs.oracle.com/javase/8/docs/technotes/guides/install/mac_jdk.html