Receiving an incompatible AVD error when starting the Gitlab CI ion meter

I get below errors whenever I try to run a measurement test for my Android project:

Skipping device 'test(AVD)' for 'app:': Unknown API Level > : No compatible devices connected.[TestRunner] FAILED Found 1 connected device(s), 0 of which were compatible. :app:connectedDebugAndroidTest FAILED FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':app:connectedDebugAndroidTest'. > There were failing tests. See the report at: file:///builds/antitheft/anti-theft-screen-lock/app/build/reports/androidTests/connected/index.html * Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. BUILD FAILED Total time: 2 mins 45.163 secs ERROR: Job failed: exit code 1 

I use a common runner. My target API is 25, and I'm trying to run AVD on API 22.

Here is my gitlab-ci.yml file:

 image: openjdk:8-jdk variables: ADB_INSTALL_TIMEOUT: "5" ANDROID_COMPILE_SDK: "25" ANDROID_TEST_SDK: "22" ANDROID_ABI: "armeabi-v7a" ANDROID_BUILD_TOOLS: "25.0.2" ANDROID_SDK_TOOLS: "24.4.1" IS_CI_BUILD : "true" before_script: - apt-get --quiet update --yes - apt-get --quiet install --yes wget tar unzip lib32stdc++6 lib32z1 - wget --quiet --output-document=android-sdk.tgz https://dl.google.com/android/android-sdk_r${ANDROID_SDK_TOOLS}-linux.tgz - tar --extract --gzip --file=android-sdk.tgz - echo y | android-sdk-linux/tools/android --silent update sdk --no-ui --all --filter android-${ANDROID_COMPILE_SDK} - echo y | android-sdk-linux/tools/android --silent update sdk --no-ui --all --filter android-${ANDROID_TEST_SDK} - echo y | android-sdk-linux/tools/android --silent update sdk --no-ui --all --filter platform-tools - echo y | android-sdk-linux/tools/android --silent update sdk --no-ui --all --filter build-tools-${ANDROID_BUILD_TOOLS} - echo y | android-sdk-linux/tools/android --silent update sdk --no-ui --all --filter extra-android-m2repository - echo y | android-sdk-linux/tools/android --silent update sdk --no-ui --all --filter extra-google-google_play_services - echo y | android-sdk-linux/tools/android --silent update sdk --no-ui --all --filter extra-google-m2repository - export ANDROID_HOME=$PWD/android-sdk-linux - export PATH=$PATH:$PWD/android-sdk-linux/platform-tools/ - chmod +x ./gradlew stages: - build #Generates the release and debug build - test #Performs unit and insttrumentation tests. debugBuild: #Generate debug build for dev and master branch stage: build script: - ./gradlew assembleDebug only: - master - dev artifacts: paths: - app/build/outputs/ unitTests: #Unit tests stage: test script: #Run the unit test - ./gradlew test functionalTests: #Instrumantation tests stage: test script: #Download the wait for emulator script - 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 #Download emulator image for armeabi-v7a - echo y | android-sdk-linux/tools/android --silent update sdk --no-ui --all --filter sys-img-armeabi-v7a-google_apis-${ANDROID_TEST_SDK} #Create AVD - echo no | android-sdk-linux/tools/android create avd --force -n test -t android-${ANDROID_TEST_SDK} --abi google_apis/armeabi-v7a #Start the AVD and wait for the emulator to start - android-sdk-linux/tools/emulator64-arm -avd test -no-audio -no-window & - ./android-wait-for-emulator #Display list of devices - adb devices #Unloack device and run the instrumantation test - adb shell input keyevent 82 & - ./gradlew connectedAndroidTest 

Help me solve this problem. I have been trying to run it for the last 4-5 days with no luck.

Thanks.

+7
android gitlab testing instrumentation gitlab-ci
source share

No one has answered this question yet.

See related questions:

140
How to fix it: "HAX does not work, but the emulator works in emulation mode"
21
Cordova android emulator stops working
7
Android build error: unknown packet filter
7
Could not start emulator in Android Studio
2
Android ABI linked to wrong target
2
Jenkins: failed to create Android emulator, failed to parse AVD configuration file
one
Android AVD Manager Linux, error: no space left on device Error: AVD not created
one
Android Emulator Plugin Failed to Initialize EGL Background Screen
0
ion launch failed - command completed with error code 1: cmd / s / c "D: \ Android \ sdk \ tools \ android.bat list avds"
0
Android Studio application works on a real device, but does not run on an emulator

All Articles