首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >Jenkins build for android sdk问题无法安装以下SDK组件:

Jenkins build for android sdk问题无法安装以下SDK组件:
EN

Stack Overflow用户
提问于 2021-09-13 12:21:23
回答 2查看 461关注 0票数 0

我尝试通过jenkins应用程序构建android应用程序,但android sdk有问题。我在linux服务器和配置变量上安装了android sdk的版本,并在jenkins网站上做了这件事。

构建消息:

代码语言:javascript
运行
复制
Started by user XYZ
Running as SYSTEM
Building in workspace /var/lib/jenkins/workspace/
The recommended git tool is: NONE
No credentials specified
 > git rev-parse --resolve-git-dir /var/lib/jenkins/workspace//.git # timeout=10
Fetching changes from the remote Git repository
 > git config remote.origin.url gitlabgit # timeout=10
Fetching upstream changes from gitlabgit
 > git --version # timeout=10
 > git --version # 'git version 2.17.1'
 > git fetch --tags --progress -- gitlab.git +refs/heads/*:refs/remotes/origin/* # timeout=10
 > git rev-parse refs/remotes/origin/develop^{commit} # timeout=10
Checking out Revision 226418a2e4d787c8d75dd497088efa4347cf7bd0 (refs/remotes/origin/develop)
 > git config core.sparsecheckout # timeout=10
 > git checkout -f 226418a2e4d787c8d75dd497088efa4347cf7bd0 # timeout=10
 > git branch -a -v --no-abbrev # timeout=10
 > git branch -D develop # timeout=10
 > git checkout -b develop 226418a2e4d787c8d75dd497088efa4347cf7bd0 # timeout=10
Commit message: "Merge branch 'jciszewski/FixCardResponse' into 'develop'"
 > git rev-list --no-walk 226418a2e4d787c8d75dd497088efa4347cf7bd0 # timeout=10
[] $ /bin/sh -xe /tmp/jenkins686224158862483808.sh
+ chmod +x gradlew
+ ./gradlew clean
Starting a Gradle Daemon (subsequent builds will be faster)
> Task :clean UP-TO-DATE
> Task :app:clean UP-TO-DATE

Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.7.1/userguide/command_line_interface.html#sec:command_line_warnings

BUILD SUCCESSFUL in 3s
2 actionable tasks: 2 up-to-date
+ ./gradlew assembleDebug
File /var/lib/jenkins/.android/repositories.cfg could not be loaded.
Checking the license for package Android SDK Build-Tools 30.0.3 in /home/face/android-sdk/android-sdk/licenses
License for package Android SDK Build-Tools 30.0.3 accepted.
Preparing "Install Android SDK Build-Tools 30.0.3 (revision: 30.0.3)".
Warning: Failed to read or create install properties file.
Checking the license for package Android SDK Platform 30 in /home/face/android-sdk/android-sdk/licenses
License for package Android SDK Platform 30 accepted.
Preparing "Install Android SDK Platform 30 (revision: 3)".
Warning: Failed to read or create install properties file.

FAILURE: Build failed with an exception.

* What went wrong:
Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.
> Failed to install the following SDK components:
      platforms;android-30 Android SDK Platform 30
      build-tools;30.0.3 Android SDK Build-Tools 30.0.3
  The SDK directory is not writable (/home/face/android-sdk/android-sdk)


* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.7.1/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 1s
Build step 'Execute shell' marked build as failure
Archiving artifacts
[PostBuildScript] - [INFO] Executing post build scripts.
Finished: FAILURE

我在解决它时遇到了问题(我尝试将权限更改为777,但仍然不起作用)

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2021-09-13 15:16:55

更改android SDK的所有权

chown -R <user_name> <directory_name>

票数 2
EN

Stack Overflow用户

发布于 2021-09-13 12:33:59

通过将sdk的目录从/opt/sdk更改为/home/user/sdk进行解析

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/69162605

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档