Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to install split APK(s) #387

Open
joshing-dev opened this issue Mar 29, 2024 · 3 comments
Open

Failed to install split APK(s) #387

joshing-dev opened this issue Mar 29, 2024 · 3 comments

Comments

@joshing-dev
Copy link

I'm using this setup for my github action:

  instrumented-tests:
    name: Run Instrumented Tests
    runs-on: macos-latest
    steps:
      - name: checkout
        uses: actions/checkout@v3
      - name: Configure JDK
        uses: actions/setup-java@v1
        with:
          java-version: 17
      - name: run tests
        uses: reactivecircus/android-emulator-runner@v2
        with:
          api-level: 29
          script: ./gradlew connectedAndroidTest

But when running connectedAndroidTest I'm getting this error:

Exception thrown during onBeforeAll invocation of plugin AndroidTestApkInstallerPlugin: ErrorName: UNKNOWN
NameSpace: DdmlibAndroidDeviceController
ErrorCode: 1
ErrorType: TEST
Message: Failed to install split APK(s): [/Users/runner/work/Budgeteer/Budgeteer/core/database/build/outputs/apk/androidTest/debug/database-debug-androidTest.apk]
Failed to install split APK(s): [/Users/runner/work/Budgeteer/Budgeteer/core/database/build/outputs/apk/androidTest/debug/database-debug-androidTest.apk]
Device emulator-5554 API level=1. Cannot install split APKs with API level < 21
Device emulator-5554 API level=1. Cannot install split APKs with API level < 21
java.lang.IllegalArgumentException: Device emulator-5554 API level=1. Cannot install split APKs with API level < 21
	at com.android.ddmlib.SplitApkInstallerBase.validateApiLevel(SplitApkInstallerBase.java:245)
	at com.android.ddmlib.SplitApkInstaller.validateArguments(SplitApkInstaller.java:162)
	at com.android.ddmlib.SplitApkInstaller.create(SplitApkInstaller.java:190)
	at com.android.ddmlib.IDeviceSharedImpl.installPackages(IDeviceSharedImpl.java:394)
	at com.android.ddmlib.internal.DeviceImpl.lambda$installPackages$36(DeviceImpl.java:1492)
	at com.android.ddmlib.internal.DeviceImpl.logRun3(DeviceImpl.java:1834)
	at com.android.ddmlib.internal.DeviceImpl.installPackages(DeviceImpl.java:1489)
	at com.android.ddmlib.internal.DeviceImpl.lambda$installPackages$37(DeviceImpl.java:1504)
	at com.android.ddmlib.internal.DeviceImpl.logRun3(DeviceImpl.java:1834)
	at com.android.ddmlib.internal.DeviceImpl.installPackages(DeviceImpl.java:1500)
	at com.android.tools.utp.plugins.deviceprovider.ddmlib.DdmlibAndroidDevice.installPackages(DdmlibAndroidDevice.kt:74)
	at com.android.tools.utp.plugins.deviceprovider.ddmlib.DdmlibAndroidDeviceController$executeAsync$deferred$1.invokeSuspend(DdmlibAndroidDeviceController.kt:254)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
	at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:570)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:749)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:677)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:664)

I use this same defined job on other projects, but I'm unsure why it's saying it's using a Device emulator with an API level of 1?

My project uses a min-sdk of 26 and a compile-sdk/target-sdk of 34 and AGP version of 8.3.1 with the action specifying an api-level of 29.

@takahirom
Copy link

I'm experiencing the same issue. However, I'm not sure if I'm using a split APK.
yaml
https://github.com/takahirom/Rin/blob/main/.github/workflows/emulator-test.yml
CI result
https://github.com/takahirom/Rin/actions/runs/8593582109/job/23545585072

I was able to run this test 4 days ago.
https://github.com/takahirom/Rin/actions/runs/8553042186/job/23435398097

@evermind-zz
Copy link

https://issuetracker.google.com/issues/328279698

-> upgrade to AGP 8.3.2

swankjesse pushed a commit to cashapp/zipline that referenced this issue May 13, 2024
swankjesse pushed a commit to cashapp/zipline that referenced this issue May 13, 2024
@LeonelZalegas
Copy link

used to have the same problem, solve it by changing the actions with "uses: actions/checkout@v4"
for some reason worked for me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants