gpt4 book ai didi

android - 在项目的 gitlab 中执行 CI/CD 期间出错

转载 作者:行者123 更新时间:2023-12-03 17:36:03 24 4
gpt4 key购买 nike

我需要配置 gitlab 的 CI/CD 服务。所以,我创建了一个文件 .gitlab-ci.yml

image: openjdk:8-jdk

variables:
ANDROID_COMPILE_SDK: "26"
ANDROID_BUILD_TOOLS: "26.0.2"

before_script:
- apt-get --quiet update --yes
- apt-get --quiet install --yes wget tar unzip lib32stdc++6 lib32z1
- wget --quiet --output-document=android-sdk.zip https://dl.google.com/android/repository/tools_r${ANDROID_SDK_TOOLS}-linux.zip
- unzip android-sdk.zip
- export ANDROID_HOME=$PWD/
- echo y | $ANDROID_HOME/tools/android --silent update sdk --no-ui --all --filter android-${ANDROID_COMPILE_SDK}
- echo y | $ANDROID_HOME/tools/android --silent update sdk --no-ui --all --filter platform-tools
- echo y | $ANDROID_HOME/tools/android --silent update sdk --no-ui --all --filter build-tools-${ANDROID_BUILD_TOOLS}
- echo y | $ANDROID_HOME/tools/android --silent update sdk --no-ui --all --filter extra-android-m2repository
- echo y | $ANDROID_HOME/tools/android --silent update sdk --no-ui --all --filter extra-google-google_play_services
- echo y | $ANDROID_HOME/tools/android --silent update sdk --no-ui --all --filter extra-google-m2repository
- export PATH=$PATH:$ANDROID_HOME
- chmod +x ./gradlew

stages:
- build

build:
stage: build
script:
- ./gradlew assembleDebug
artifacts:
paths:
- app/build/outputs/

我只需要在云中构建一个工件而无需测试。因此,在 master 提交后,cd 管道开始执行,并失败。下载sdk一直失败:
.....
Preparing to unpack .../libc6-i386_2.24-11+deb9u1_amd64.deb ...
Unpacking libc6-i386 (2.24-11+deb9u1) ...
Selecting previously unselected package lib32z1.
Preparing to unpack .../lib32z1_1%3a1.2.8.dfsg-5_amd64.deb ...
Unpacking lib32z1 (1:1.2.8.dfsg-5) ...
Selecting previously unselected package lib32gcc1.
Preparing to unpack .../lib32gcc1_1%3a6.3.0-18_amd64.deb ...
Unpacking lib32gcc1 (1:6.3.0-18) ...
Selecting previously unselected package lib32stdc++6.
Preparing to unpack .../lib32stdc++6_6.3.0-18_amd64.deb ...
Unpacking lib32stdc++6 (6.3.0-18) ...
Setting up libc6-i386 (2.24-11+deb9u1) ...
Processing triggers for libc-bin (2.24-11+deb9u1) ...
Setting up lib32z1 (1:1.2.8.dfsg-5) ...
Setting up lib32gcc1 (1:6.3.0-18) ...
Setting up lib32stdc++6 (6.3.0-18) ...
Processing triggers for libc-bin (2.24-11+deb9u1) ...
$ wget --quiet --output-document=android-sdk.zip https://dl.google.com/android/repository/tools_r${ANDROID_SDK_TOOLS}-linux.zip
ERROR: Job failed: exit code 1

最佳答案

你没有变量ANDROID_SDK_TOOLSwget 中使用,你只有:

  • ANDROID_BUILD_TOOLS
  • ANDROID_COMPILE_SDK
  • 关于android - 在项目的 gitlab 中执行 CI/CD 期间出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48053886/

    24 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com