Emulator with name Nexus_6_API_26 has a corrupt config.ini file, try fixing it by recreating an emulator

#1

Bitrise Build Issue Report template

Description of the issue

I could not able to run my android tests on bitrise, here is my error log from bitrise along with my yml setup

Environment:

  • Detox: “detox”: “^10.0.12”,
  • React Native: “^0.58.4”,
  • Node: v8.15.0
  • Device: Android emulator on Bitrise
  • OS: Android

If on Bitrise.io: which stack? If not on Bitrise.io: on what operating system? (Plus any other information you can share)

Linux LTS

E.g.: Git Clone v3.6.0

Reproducibility

Local reproduction

Only on Bitrise

Local reproduction: Linux / Android (docker based) stack builds

Only on bitrise

Build emulator step

  • script@1.1.5:
    inputs:
  • content: |-
    #!/usr/bin/env bash
    cd $ANDROID_HOME/emulator
    echo no | avdmanager create avd -n Nexus_6_API_26 -k “system-images;android-26;google_apis;x86” --force
    emulator -avd Nexus_6_API_26 -no-window -no-audio -debug-init > /dev/null 2>&1 &
    echo “Waiting emulator…”
    adb wait-for-device shell ‘while [[ -z $(getprop sys.boot_completed) ]]; do sleep 1; done; input keyevent 82’
    title: Initiate Android emulator
    • script@1.1.5:
      inputs:
      • content: |+
        #!/usr/bin/env bash
        detox test -c android.emu.cli --device-name Nexus_6_API_26 --loglevel verbose --cleanup
        title: Detox E2E**

Build log

configuration=“android.emu.cli” loglevel=“verbose” cleanup=true artifactsLocation=“artifacts/android.emu.cli.2019-03-14 10-47-04Z” deviceName=“Nexus_6_API_26” node_modules/.bin/jest “e2e” --config=e2e/config.json --maxWorkers=1 ‘–testNamePattern=^((?!:ios:).) $’
detox[26902] INFO: [DetoxServer.js] server listening on localhost:33207…
detox[26902] DEBUG: [AsyncWebSocket.js/WEBSOCKET_OPEN] opened web socket to: ws://localhost:33207
detox[26902] DEBUG: [DetoxServer.js/LOGIN] role=tester, sessionId=dca0dbbd-9e47-d712-47f4-b15b3f063780
detox[26902] DEBUG: [DetoxServer.js/LOGIN_SUCCESS] role=tester, sessionId=dca0dbbd-9e47-d712-47f4-b15b3f063780
detox[26902] DEBUG: [exec.js/EXEC_CMD, #0] /opt/android-sdk-linux/emulator/emulator -list-avds --verbose
detox[26902] ERROR: [index.js/DETOX_INIT_ERROR]
Error: Emulator with name Nexus_6_API_26 has a corrupt config.ini file (/root/.android/avd/Nexus_6_API_26.avd/config.ini), try fixing it by recreating an emulator.
at EmulatorDriver._fixEmulatorConfigIniSkinName (/bitrise/src/node_modules/detox/src/devices/drivers/EmulatorDriver.js:30:15)
at EmulatorDriver.acquireFreeDevice (/bitrise/src/node_modules/detox/src/devices/drivers/EmulatorDriver.js:91:16)
at
at process._tickCallback (internal/process/next_tick.js:188:7)
detox[26902] DEBUG: [DetoxServer.js/DISCONNECT] role=tester, sessionId=dca0dbbd-9e47-d712-47f4-b15b3f063780
detox[26902] ERROR: [EmulatorTelnet.js/TELNET_ERROR]
err: Error: connect ECONNREFUSED 127.0.0.1:23
at Object._errnoException (util.js:1022:11)
at _exceptionWithHostPort (util.js:1044:20)
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1198:14)
detox[26902] ERROR: [EmulatorTelnet.js/TELNET_ERROR]
err: Error: connect ECONNREFUSED 127.0.0.1:23
at Object._errnoException (util.js:1022:11)
at _exceptionWithHostPort (util.js:1044:20)
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1198:14)
FAIL e2e/ tests /SearchTenantScreen.e2e.spec.js
● Test suite failed to run
Timeout - Async callback was not invoked within the 120000ms timeout specified by jest.setTimeout.Error: Timeout - Async callback was not invoked within the 120000ms timeout specified by jest.setTimeout.
at mapper (…/node_modules/jest-jasmine2/build/queueRunner.js:25:45)
Test Suites: 1 failed, 1 total
Tests: 0 total
Snapshots: 0 total
Time: 242.393s
Ran all test suites matching /e2e/i with tests matching “^((?!:ios:).)
$”.
child_process.js:644
throw err;
^
Error: Command failed: node_modules/.bin/jest “e2e” --config=e2e/config.json --maxWorkers=1 ‘–testNamePattern=^((?!:ios:).)*$’
at checkExecSyncError (child_process.js:601:13)
at Object.execSync (child_process.js:641:13)
at runJest (/bitrise/src/node_modules/detox/local-cli/detox-test.js:166:6)
at run (/bitrise/src/node_modules/detox/local-cli/detox-test.js:86:7)
at Object. (/bitrise/src/node_modules/detox/local-cli/detox-test.js:229:1)
at Module._compile (module.js:652:30)
at Object.Module._extensions…js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)

0 Likes

#2

Hy there, could you check this thread on creating emulators? this is a really instable thing on VM-s unfortunately

0 Likes

#3

Yes, I have followed those steps to create emulator and I found the issue with the emulator’s .ini file and it does not have any parameters like skin.name and other configurations.

I am trying to add those parameters on my own, I let you know once I done with it.

0 Likes

#4

Seems the config.ini file does not contain much data on linux machine also skins folder missing at android home path, But everything is fine on my Mac local machine.

0 Likes

#5

Hy there, Could you please enable support-user on the settings tab of the app and send us a build’s ulr please, we would like to check out some configs, and fire up some test builds if it’s ok with you

0 Likes

#6

Hy there, could you check this thread on setting up detox tests?
https://discuss.bitrise.io/t/app-testing-with-detox/6996
also run this script before you fire up the test:

- script@1.1.5:
        title: Add Missing Properties
        inputs:
        - content: |-
            #!/usr/bin/env bash
            # fail if any commands fails
            set -e
            # debug log
            set -x

            echo "
            hw.lcd.height=1920
            hw.lcd.width=1080
            hw.lcd.density=161
            skin.name=240x426" >> /root/.android/avd/Nexus_5X_API_26.avd/config.ini
0 Likes

closed #7

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.

0 Likes