简体   繁体   English

在 Gitlab CI/CD 管道中构建应用程序时出错

[英]Getting error when building app in Gitlab CI/CD Pipeline

I have been trying to build the app in pipeline to run just unit tests but I am getting error which i cannot find anywhere else can you guys look and tell me what I an doing wrong here.我一直在尝试在管道中构建应用程序以仅运行单元测试,但我遇到错误,我在其他任何地方都找不到,你们可以看看并告诉我我在这里做错了什么。

here is what I am getting as an error.这是我得到的错误。

 Preparing to unpack.../lib32z1_1%3a1.2.11.dfsg-2_amd64.deb... Unpacking lib32z1 (1:1.2.11.dfsg-2)... Setting up libc6-i386 (2.31-13+deb11u2)... Setting up lib32z1 (1:1.2.11.dfsg-2)... Setting up lib32gcc-s1 (10.2.1-6)... Setting up lib32stdc++6 (10.2.1-6)... Processing triggers for libc-bin (2.31-13+deb11u2) $ wget --quiet --output-document=android-sdk.zip https://dl.google.com/android/repository/sdk-tools-linux-${ANDROID_SDK_TOOLS}.zip Cleaning up project directory and file based variables 00:01 ERROR: Job failed: exit code 1

here is my.gitlab-ci.yml file:这是 my.gitlab-ci.yml 文件:

 image: openjdk:11-jdk variables: ANDROID_COMPILE_SDK: "31" ANDROID_BUILD_TOOLS: "32.0.0" ANDROID_SDK_TOOLS: "7583922" 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/sdk-tools-linux-${ANDROID_SDK_TOOLS}.zip - unzip -d android-sdk-linux android-sdk.zip - echo y | android-sdk-linux/tools/bin/sdkmanager "platforms;android-${ANDROID_COMPILE_SDK}" >/dev/null - echo y | android-sdk-linux/tools/bin/sdkmanager "platform-tools" >/dev/null - echo y | android-sdk-linux/tools/bin/sdkmanager "build-tools;${ANDROID_BUILD_TOOLS}" >/dev/null - export ANDROID_HOME=$PWD/android-sdk-linux - export PATH=$PATH:$PWD/android-sdk-linux/platform-tools/ - chmod +x./gradlew # temporarily disable checking for EPIPE error and use yes to accept all licenses - set +o pipefail - yes | android-sdk-linux/tools/bin/sdkmanager --licenses - set -o pipefail stages: - build - test lintDebug: stage: build script: -./gradlew -Pci --console=plain:app:lintDebug -PbuildDir=lint assembleDebug: stage: build script: -./gradlew assembleDebug artifacts: paths: - app/build/outputs/ debugTests: stage: test script: -./gradlew -Pci --console=plain:app:testDebug

I think that URL you are constructing here.. does not exist anymore.. hence fails我认为您在这里构建的 URL.. 不再存在.. 因此失败

wget --quiet --output-document=android-sdk.zip https://dl.google.com/android/repository/sdk-tools-linux-${ANDROID_SDK_TOOLS}.zip

Output: Output:

PS C:\Users\Sayan> curl https://dl.google.com/android/repository/sdk-tools-linux-7583922.zip
curl :
<!DOCTYPE html>
<html lang=en>
  <meta charset=utf-8>
  <meta name=viewport content="initial-scale=1, minimum-scale=1, width=device-width">
  <title>Error 404 (Not Found)!!1</title>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM