We are trying to test the Android version of a flutter/dart app via GitHub Actions.
The GitHub actions file looks like this:
android_integration:
name: Integration Tests on Android Devices
runs-on: self-hosted
strategy:
matrix:
api-level: [30]
target: [google_apis]
steps:
- name: Use Flutter
uses: subosito/flutter-action@v1
- name: Android Home Variables
run: |
echo "~/Library/Android/sdk" >> $GITHUB_PATH
echo "~/Library/Android/sdk/platform-tools" >> $GITHUB_PATH
echo "~/Library/Android/sdk/tools" >> $GITHUB_PATH
echo "~/Library/Android/sdk/cmdline-tools/latest/bin" >> $GITHUB_PATH
- name: Run Flutter Driver tests
uses: reactivecircus/android-emulator-runner@v2
env:
ANDROID_HOME: ~/Library/Android/sdk
with:
api-level: ${{ matrix.api-level }}
target: ${{ matrix.target }}
arch: x86_64
script: firebase emulators:exec "./flutter_drive_android.sh"
The "./flutter_drive_android.sh" script that is run looks like this:
#!/bin/sh
flutter drive --disable-service-auth-codes --target=test_driver/app.dart --flavor=production -d emulator-5554
This script works fine when run directly locally, but when run through GitHub Actions this is the output:
API level: 30
target: google_apis
CPU architecture: x86_64
Hardware profile:
SD card path or size:
AVD name: test
emulator options: -no-window -gpu swiftshader_indirect -no-snapshot -noaudio -no-boot-anim
disable animations: true
Script:
firebase emulators:exec "./flutter_drive_android.sh"
Installing new cmdline-tools.
/usr/bin/unzip -q ~/workspace/actions-runner/_work/_temp/861ba3fb-c25d-4258-9886-b3c24ac0b4ba
~/Library/Android/sdk/platform-tools/adb -s emulator-5554 emu kill
error: could not connect to TCP port 5554: Connection refused
The process '~/Library/Android/sdk/platform-tools/adb' failed with exit code 1
Error: ENOENT: no such file or directory, open 'undefined/licenses/android-sdk-arm-dbt-license'
I can't tell where the "undefined is coming from on the last line, 'undefined/licenses/android-sdk-arm-dbt-license'. It seems possible that it is related to the "Connection refused" error, but I can't tell why that is happening either.
Any help would be appreciated.