MacOS下Jenkins 无法找到android sdk跟ndk的问题

错误信息:

Could not determine the dependencies of task ':app:compileReleaseJavaWithJavac'.

16:15:42.665 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] > SDK location not found. Define location with an ANDROID_SDK_ROOT environment variable or by setting the sdk.dir path in your project's local properties file at '/Users/XXX/Jenkins/Home/workspace/XXX/local.properties'.

原因:

jenkins无法访问本机用户目录.

解决:

1.Copy your Android folder \Users{yourUser}\Library\Android\

2.Paste in the folder \Users\Shared\Jenkins\Library

3.Go to Jenkins -> Manage Jenkins -> Configure System

4.Check "Environment variables"

5.add name: ANDROID_HOME, value -> \Users\Shared\Jenkins\Library\Android\sdk

6.Add

7.Save

Jenkins build failed due to missing android SDK - Stack Overflow

你可能感兴趣的:(MacOS下Jenkins 无法找到android sdk跟ndk的问题)