gpt4 book ai didi

docker - Gitlab CI仿真器无法启动

转载 作者:行者123 更新时间:2023-12-02 19:21:39 24 4
gpt4 key购买 nike

我在GitLab上的配置项有问题。几天前它一直在工作,但没有进行任何更改,它停止了工作。仿真器不再启动,并且作业总是在超时后完成。

这是作业失败时的日志(full log):

[ ... ]

$ wget --quiet --output-document=android-wait-for-emulator https://raw.githubusercontent.com/travis-ci/travis-cookbooks/0f497eb71291b52a703143c5cd63a217c8766dc9/community-cookbooks/android-sdk/files/default/android-wait-for-emulator
$ chmod +x android-wait-for-emulator
$ android-sdk-linux/tools/bin/sdkmanager --update > update.log
Warning: File /root/.android/repositories.cfg could not be loaded.
$ android-sdk-linux/tools/bin/sdkmanager "platform-tools" "emulator" "system-images;android-${EMULATOR_VERSION};google_apis;x86_64" > installEmulator.log
Warning: File /root/.android/repositories.cfg could not be loaded.
$ echo no | android-sdk-linux/tools/bin/avdmanager create avd --force --name test --abi google_apis/x86_64 --package "system-images;android-${EMULATOR_VERSION};google_apis;x86_64"
Loading local repository...
[========= ] 25% Loading local repository...
[========= ] 25% Fetch remote repository...
[========= ] 25% Fetch remote repository...
[========= ] 25% Fetch remote repository...
[=======================================] 100% Fetch remote repository...
Do you wish to create a custom hardware profile? [no] $ android-sdk-linux/emulator/emulator -avd test -no-window -no-audio &
$ ./android-wait-for-emulator
statvfs('/root/.android/avd/test.avd/snapshots/default_boot/ram.img') failed: No such file or directory
Waiting for emulator to start
Pulling docker image gitlab/gitlab-runner-helper:x86_64-577f813d ...
ERROR: Job failed: execution took longer than 1h0m0s seconds

这是EXACT SAME作业工作时的日志( full log):
[ ... ]

$ wget --quiet --output-document=android-wait-for-emulator https://raw.githubusercontent.com/travis-ci/travis-cookbooks/0f497eb71291b52a703143c5cd63a217c8766dc9/community-cookbooks/android-sdk/files/default/android-wait-for-emulator
$ chmod +x android-wait-for-emulator
$ android-sdk-linux/tools/bin/sdkmanager --update > update.log
Warning: File /root/.android/repositories.cfg could not be loaded.
$ android-sdk-linux/tools/bin/sdkmanager "platform-tools" "emulator" "system-images;android-${EMULATOR_VERSION};google_apis;x86_64" > installEmulator.log
Warning: File /root/.android/repositories.cfg could not be loaded.
$ echo no | android-sdk-linux/tools/bin/avdmanager create avd --force --name test --abi google_apis/x86_64 --package "system-images;android-${EMULATOR_VERSION};google_apis;x86_64"
Loading local repository...
[========= ] 25% Loading local repository...
[========= ] 25% Fetch remote repository...
[========= ] 25% Fetch remote repository...
[========= ] 25% Fetch remote repository...
[=======================================] 100% Fetch remote repository...
Do you wish to create a custom hardware profile? [no] $ android-sdk-linux/emulator/emulator -avd test -no-window -no-audio &
$ ./android-wait-for-emulator
statvfs('/root/.android/avd/test.avd/snapshots/default_boot/ram.img') failed: No such file or directory
Waiting for emulator to start
Your emulator is out of date, please update by launching Android Studio:
- Start Android Studio
- Select menu "Tools > Android > SDK Manager"
- Click "SDK Tools" tab
- Check "Android Emulator" checkbox
- Click "OK"

Waiting for emulator to start
Waiting for emulator to start
Waiting for emulator to start
Waiting for emulator to start
Waiting for emulator to start
Waiting for emulator to start
Waiting for emulator to start
Waiting for emulator to start
Waiting for emulator to start
Waiting for emulator to start
Waiting for emulator to start
Waiting for emulator to start
Waiting for emulator to start
Waiting for emulator to start
Waiting for emulator to start
Waiting for emulator to start
emulator: INFO: boot completed
emulator: INFO: boot time 23881 ms
emulator: Increasing screen off timeout, logcat buffer size to 2M.
emulator: Revoking microphone permissions for Google App.
Emulator is ready
$ adb shell settings put global window_animation_scale 0 &
$ adb shell settings put global transition_animation_scale 0 &
$ adb shell settings put global animator_duration_scale 0 &
$ adb shell input keyevent 82
$ cd ./DenisAppProject
$ ./gradlew connectedCheck

[ ... ]

$ adb emu kill
OK: killing emulator, bye bye
OK
emulator: Saving state on exit with session uptime 146931 ms
Job succeeded

这是我的gitlab-ci.yml
    image: openjdk:8-jdk

variables:
ANDROID_COMPILE_SDK: "28"
ANDROID_BUILD_TOOLS: "28.0.3"
ANDROID_SDK_TOOLS: "4333796"
EMULATOR_VERSION: "26"

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 ./DenisAppProject/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
- unit-test
- instrumental-test

lintDebug:
tags: ["android"]
stage: build
script:
- cd DenisAppProject/
- ./gradlew -Pci --console=plain :DenisApp:lintDebug -PbuildDir=lint

assembleDebug:
tags: ["android"]
stage: build
script:
- cd DenisAppProject/
- ./gradlew assembleDebug
artifacts:
paths:
- DenisApp/build/outputs/

debugTests:
tags: ["android"]
stage: unit-test
script:
- cd DenisAppProject/
- ./gradlew -Pci --console=plain :DenisApp:testDebug

instrumentation_tests:
tags: ["android"]
stage: instrumental-test
script:
- apt-get --quiet update --yes
- apt-get --quiet install --yes libx11-dev libpulse0 libgl1 libnss3 libxcomposite-dev libxcursor1 libasound2
- wget --quiet --output-document=android-wait-for-emulator https://raw.githubusercontent.com/travis-ci/travis-cookbooks/0f497eb71291b52a703143c5cd63a217c8766dc9/community-cookbooks/android-sdk/files/default/android-wait-for-emulator
- chmod +x android-wait-for-emulator
- android-sdk-linux/tools/bin/sdkmanager --update > update.log
- android-sdk-linux/tools/bin/sdkmanager "platform-tools" "emulator" "system-images;android-${EMULATOR_VERSION};google_apis;x86_64" > installEmulator.log
- echo no | android-sdk-linux/tools/bin/avdmanager create avd --force --name test --abi google_apis/x86_64 --package "system-images;android-${EMULATOR_VERSION};google_apis;x86_64"
- android-sdk-linux/emulator/emulator -avd test -no-window -no-audio &
- ./android-wait-for-emulator
# Turn off animations
- adb shell settings put global window_animation_scale 0 &
- adb shell settings put global transition_animation_scale 0 &
- adb shell settings put global animator_duration_scale 0 &
- adb shell input keyevent 82
- cd ./DenisAppProject
- ./gradlew connectedCheck
- adb emu kill

屏幕上的作业,您可以看到它是第一次工作,然后停止了(之前所有的工作都在工作)。 Screen

最佳答案

@ Denis-Pinna
嗨,我尝试第一次设置gitlab CI。创建后启动ii时,出现以下错误。

等待模拟器启动
仿真器:错误:x86仿真当前需要硬件加速!
请确保正确安装了KVM并可以使用它。
CPU加速状态:KVM需要支持vmx或svm的CPU
有关在Linux上配置VM加速的更多信息:
https://developer.android.com/studio/run/emulator-acceleration#vm-linux
有关加速的一般信息:https://developer.android.com/studio/run/emulator-acceleration

关于docker - Gitlab CI仿真器无法启动,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59204776/

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