Jenkins build for android sdk 问题无法安装以下 SDK 组件:
Jenkins build for android sdk problem Failed to install the following SDK components:
我尝试通过 jenkins 应用程序构建 android 应用程序,但 android sdk 有问题。
我在 linux 服务器和配置变量上安装了 android sdk 版本,并在 jenkins 站点上安装。
构建消息:
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 但仍然无法正常工作)
通过将sdk目录从/opt/sdk更改为/home/user/sdk
来解决
更改 android SDK 的所有权
chown -R <user_name> <directory_name>
我尝试通过 jenkins 应用程序构建 android 应用程序,但 android sdk 有问题。 我在 linux 服务器和配置变量上安装了 android sdk 版本,并在 jenkins 站点上安装。
构建消息:
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 但仍然无法正常工作)
通过将sdk目录从/opt/sdk更改为/home/user/sdk
来解决更改 android SDK 的所有权
chown -R <user_name> <directory_name>