Jenkins Gradle 打包的问题

错误1

* What went wrong:
Could not determine java version from '10.0.2'.

解决方案: 这个问题的原因是本地有多个Java版本,卸载掉其他版本的java,保留java8就可以了。

错误2

* What went wrong:
A problem occurred configuring project ':avchatkit'.
> You have not accepted the license agreements of the following SDK components:
  [Android SDK Platform 26, Android SDK Build-Tools 26.0.2].
  Before building your project, you need to accept the license agreements and complete the installation of the missing components using the Android Studio SDK Manager.
  Alternatively, to learn how to transfer the license agreements from one workstation to another, go to http://d.android.com/r/studio-ui/export-licenses.html

解决方案: 这个问题的原因是sdk没有统一授权,需要到sdk的安装目录里面,找到bin/sdkmanager,执行下面的命令同意授权即可

yes | sdkmanager --licenses

错误3

* What went wrong:
A problem occurred configuring project ':avchatkit'.
> Failed to notify project evaluation listener.
   > org.gradle.api.tasks.compile.CompileOptions.setBootClasspath(Ljava/lang/String;)V

解决方案 主要问题是是项目使用的gradle4.2,但是Jenkins使用了gradle5
所以导致了一些兼容问题,可以在jenkins里面设置为使用项目里面的gradle版本。

Search by:GoogleBingBaidu