我正在try 在使用Bitbucket的管道工作流程中运行不带窗口和 bootstrap 动画的AVD,以进行仪器测试.我正在使用Docker image和使用Linux Ubuntu的Android SDK.

安装程序正常运行并成功创建AVD,但启动时出现错误,因为它要求硬件加速.

脚本

+ emulator -avd EMU -no-window -no-audio -no-boot-anim & ./gradlew connectedAndroidTest mergeAndroidReports --continue

误差

WARNING | Crash annotation is very large (17292), only 16384 bytes will be recorded, 908 bytes are lost.

INFO    | Storing crashdata in: /tmp/android-unknown/emu-crash-34.1.20.db, detection is enabled for process: 378

INFO    | Android emulator version 34.1.20.0 (build_id 11610631) (CL:N/A)

INFO    | Found systemPath /opt/android-sdk-linux/system-images/android-34/google_apis_playstore/x86_64/

WARNING | Crash annotation is very large (17651), only 16384 bytes will be recorded, 1267 bytes are lost.

WARNING | File System is not ext4, disable QuickbootFileBacked feature

Downloading https://services.gradle.org/distributions/gradle-8.4-bin.zip

ERROR   | x86_64 emulation currently requires hardware acceleration!

CPU acceleration status: KVM requires a CPU that supports vmx or svm

More info on configuring VM acceleration on Linux:

https://developer.android.com/studio/run/emulator-acceleration#vm-linux

General information on acceleration: https://developer.android.com/studio/run/emulator-acceleration.

INFO    | Storing crashdata in: /tmp/android-unknown/emu-crash-34.1.20.db, detection is enabled for process: 378

INFO    | Duplicate loglines will be removed, if you wish to see each individual line launch with the -log-nofilter flag.

INFO    | Increasing RAM size to 2048MB

  [1]: https://github.com/mindrunner/docker-android-sdk

根据这个SO answer,即使它很慢,我也可能会使用ARM作为最后的手段,因为它不需要硬件加速,所以我使用system-images;android-23;google_apis;armeabi-v7a

我更改脚本以等待adb然后再运行gradlew

+ emulator -avd EMU -memory 2048 -cache-size 1000 -partition-size 6144 -wipe-data -no-window -no-audio -no-boot-anim & adb wait-for-device

+ ./gradlew connectedAndroidTest mergeAndroidReports --continue

模拟器启动

* daemon not running; starting now at tcp:5037

WARNING | Crash annotation is very large (17355), only 16384 bytes will be recorded, 971 bytes are lost.

INFO    | Storing crashdata in: /tmp/android-unknown/emu-crash-34.1.20.db, detection is enabled for process: 380

INFO    | Android emulator version 34.1.20.0 (build_id 11610631) (CL:N/A)

INFO    | Found systemPath /opt/android-sdk-linux/system-images/android-23/google_apis/armeabi-v7a/

WARNING | Crash annotation is very large (17713), only 16384 bytes will be recorded, 1329 bytes are lost.

WARNING | File System is not ext4, disable QuickbootFileBacked feature

WARNING | encryption is off

WARNING | FeatureControl is requesting a non existing feature.

WARNING | Your GPU drivers may have a bug. Switching to software rendering.

WARNING: cannnot unmap ptr 0x7efff4664000 as it is in the protected range from 0x7efff4664000 to 0x7f0074864000

WARNING: cannnot unmap ptr 0x7f0074801000 as it is in the protected range from 0x7efff4664000 to 0x7f0074864000

WARNING | Using fallback path for the emulator registration directory.

WARNING | The emulator now requires a signed jwt token for gRPC access! Use the -grpc flag if you really want an open unprotected grpc port

WARNING | *** Basic token auth should only be used by android-studio ***

WARNING | Using fallback path for the emulator registration directory.

INFO    | Storing crashdata in: /tmp/android-unknown/emu-crash-34.1.20.db, detection is enabled for process: 380

INFO    | Duplicate loglines will be removed, if you wish to see each individual line launch with the -log-nofilter flag.

library_mode swangle_indirect gpu mode swangle_indirect

Initializing hardware OpenGLES emulation supportandroid_startOpenglesRenderer: gpu infoI0429 22:07:24.206154     380 HealthMonitor.cpp:279] HealthMonitor disabled.

I0429 22:07:24.220783     380 FrameBuffer.cpp:486] Graphics Adapter Vendor Google (Google Inc.)

I0429 22:07:24.220791     380 FrameBuffer.cpp:487] Graphics Adapter Android Emulator OpenGL ES Translator (Google SwiftShader)

I0429 22:07:24.220793     380 FrameBuffer.cpp:488] Graphics API Version OpenGL ES 3.0 (OpenGL ES 3.0 SwiftShader 4.0.0.1)

I0429 22:07:24.220794     380 FrameBuffer.cpp:489] Graphics API Extensions GL_OES_EGL_sync GL_OES_EGL_image GL_OES_EGL_image_external GL_OES_depth24 GL_OES_depth32 GL_OES_element_index_uint GL_OES_texture_float GL_OES_texture_float_linear GL_OES_compressed_paletted_texture GL_OES_compressed_ETC1_RGB8_texture GL_OES_depth_texture GL_OES_texture_half_float GL_OES_texture_half_float_linear GL_OES_packed_depth_stencil GL_OES_vertex_half_float GL_OES_standard_derivatives GL_OES_texture_npot GL_OES_rgb8_rgba8 GL_EXT_color_buffer_float GL_EXT_color_buffer_half_float GL_EXT_texture_format_BGRA8888 GL_APPLE_texture_format_BGRA8888 

I0429 22:07:24.220795     380 FrameBuffer.cpp:490] Graphics Device Extensions N/A

OpenGL Vendor=[Google (Google Inc.)]OpenGL Renderer=[Android Emulator OpenGL ES Translator (Google SwiftShader)]OpenGL Version=[OpenGL ES 3.0 (OpenGL ES 3.0 SwiftShader 4.0.0.1)]INFO    | Using security allow list from: /opt/android-sdk-linux/emulator/lib/emulator_access.json

INFO    | The active JSON Web Key Sets can be found here: /opt/android-sdk-linux/.android/avd/running/380/jwks/c028d3c2-fd10-428d-adea-ca35206b1f07/active.jwk

INFO    | Scanning /opt/android-sdk-linux/.android/avd/running/380/jwks/c028d3c2-fd10-428d-adea-ca35206b1f07 for jwk keys.

INFO    | Started GRPC server at 127.0.0.1:8554, security: Local, auth: +token

INFO    | Advertising in: /opt/android-sdk-linux/.android/avd/running/pid_380.ini

I0429 22:07:24.334844     430 FrameBuffer.cpp:3707] setDisplayConfigs w 320 h 640 dpiX 160 dpiY 160

I0429 22:07:24.334870     430 FrameBuffer.cpp:3720] setDisplayActiveConfig 0

INFO    | Loading snapshot 'default_boot'...

WARNING | Failed to process .ini file /opt/android-sdk-linux/.android/emu-update-last-check.ini for reading.

WARNING | Device 'userdata' does not have the requested snapshot 'default_boot'

WARNING | Failed to load snapshot 'default_boot'

WARNING | Cold boot based on user configuration

INFO    | Cold boot based on user configuration

WARNING | Failed to process .ini file /opt/android-sdk-linux/.android/emu-update-last-check.ini for reading.

* daemon started successfully

仪器测试开始,但安装时出现错误,因为模拟器似乎没有响应.

Welcome to Gradle 8.4!


Here are the highlights of this release:

 - Compiling and testing with Java 21

 - Faster Java compilation on Windows

 - Role focused dependency configurations creation


For more details see https://docs.gradle.org/8.4/release-notes.html


Starting a Gradle Daemon (subsequent builds will be faster)

> Configure project :app

The Jacoco plugin extension version '0.8.9' is not currently available in the Android Gradle Plugin. Setting the version to 0.8.8

The Jacoco plugin extension version '0.8.9' is not currently available in the Android Gradle Plugin. Setting the version to 0.8.8

The Jacoco plugin extension version '0.8.9' is not currently available in the Android Gradle Plugin. Setting the version to 0.8.8


> Configure project :app:libs:AndroidCommon

The Jacoco plugin extension version '0.8.9' is not currently available in the Android Gradle Plugin. Setting the version to 0.8.8

The Jacoco plugin extension version '0.8.9' is not currently available in the Android Gradle Plugin. Setting the version to 0.8.8

The Jacoco plugin extension version '0.8.9' is not currently available in the Android Gradle Plugin. Setting the version to 0.8.8


> Task :app:libs:AndroidCommon:preBuild UP-TO-DATE

> Task :app:libs:AndroidFirebase:preBuild UP-TO-DATE

... more tasks here

> Task :app:libs:AndroidCommon:connectedDebugAndroidTest

additionalTestOutput is not supported on this device running API level 23 because the additional test output directory could not be found

> Task :app:libs:AndroidMaterial:mergeDebugAndroidTestGlobalSynthetics

> Task :app:processDebugAndroidTestJavaRes

... more tasks here

> Task :app:libs:AndroidCommon:connectedDebugAndroidTest

Exception thrown during onBeforeAll invocation of plugin AndroidTestApkInstallerPlugin: 误差Name: UNKNOWN

NameSpace: DdmlibAndroidDeviceController

误差Code: 1

误差Type: TEST

Message: Failed to install split APK(s): [/opt/atlassian/pipelines/agent/build/app/libs/AndroidCommon/build/outputs/apk/androidTest/debug/AndroidCommon-debug-androidTest.apk]

Failed to install split APK(s): [/opt/atlassian/pipelines/agent/build/app/libs/AndroidCommon/build/outputs/apk/androidTest/debug/AndroidCommon-debug-androidTest.apk]

Unknown platform error occurred when running the UTP test suite. Please check logs for details.

com.android.ddmlib.ShellCommandUnresponsiveException

    at com.android.ddmlib.internal.DeviceImpl.lambda$executeRemoteCommand$20(DeviceImpl.java:892)

    at com.android.ddmlib.internal.DeviceImpl.logRun1(DeviceImpl.java:1802)

    at com.android.ddmlib.internal.DeviceImpl.executeRemoteCommand(DeviceImpl.java:756)

    at com.android.ddmlib.SplitApkInstallerBase.installCommit(SplitApkInstallerBase.java:137)

    at com.android.ddmlib.SplitApkInstaller.install(SplitApkInstaller.java:85)

    at com.android.ddmlib.IDeviceSharedImpl.installPackages(IDeviceSharedImpl.java:395)

    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)


> Task :app:libs:AndroidMaterial:mergeDebugAndroidTestJavaResource

> Task :app:libs:AndroidMaterial:checkDebugAndroidTestDuplicateClasses

... more tasks here

> Task :app:connectedDebugAndroidTest


> Task :app:libs:AndroidCommon:connectedDebugAndroidTest

Exception thrown during onBeforeAll invocation of plugin AndroidTestApkInstallerPlugin: 误差Name: UNKNOWN

NameSpace: DdmlibAndroidDeviceController

误差Code: 1

误差Type: TEST

Message: Failed to install split APK(s): [/opt/atlassian/pipelines/agent/build/app/libs/AndroidCommon/build/outputs/apk/androidTest/debug/AndroidCommon-debug-androidTest.apk]

Failed to install split APK(s): [/opt/atlassian/pipelines/agent/build/app/libs/AndroidCommon/build/outputs/apk/androidTest/debug/AndroidCommon-debug-androidTest.apk]

Unknown platform error occurred when running the UTP test suite. Please check logs for details.

com.android.ddmlib.ShellCommandUnresponsiveException

    at com.android.ddmlib.internal.DeviceImpl.lambda$executeRemoteCommand$20(DeviceImpl.java:892)

    at com.android.ddmlib.internal.DeviceImpl.logRun1(DeviceImpl.java:1802)

    at com.android.ddmlib.internal.DeviceImpl.executeRemoteCommand(DeviceImpl.java:756)

    at com.android.ddmlib.SplitApkInstallerBase.installCommit(SplitApkInstallerBase.java:137)

    at com.android.ddmlib.SplitApkInstaller.install(SplitApkInstaller.java:85)

    at com.android.ddmlib.IDeviceSharedImpl.installPackages(IDeviceSharedImpl.java:395)

    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)


There were failing tests. See the report at: file:///opt/atlassian/pipelines/agent/build/app/libs/AndroidCommon/build/reports/androidTests/connected/debug/index.html


> Task :app:libs:AndroidCommon:connectedAndroidTest


> Task :app:connectedDebugAndroidTest

additionalTestOutput is not supported on this device running API level 23 because the additional test output directory could not be found

Exception thrown during onBeforeAll invocation of plugin AndroidTestApkInstallerPlugin: 误差Name: Test APK installation 误差

NameSpace: AndroidTestApkInstallerPlugin

误差Code: 2002

误差Type: TEST

Message: Failed to install APK: [/opt/atlassian/pipelines/agent/build/app/build/outputs/apk/debug/app-debug.apk] on device emulator-5554.

Failed to install APK: [/opt/atlassian/pipelines/agent/build/app/build/outputs/apk/debug/app-debug.apk] on device emulator-5554.

com.google.testing.platform.core.error.UtpException: 误差Name: Test APK installation 误差

NameSpace: AndroidTestApkInstallerPlugin

误差Code: 2002

误差Type: TEST

Message: Failed to install APK: [/opt/atlassian/pipelines/agent/build/app/build/outputs/apk/debug/app-debug.apk] on device emulator-5554.

    at com.android.tools.utp.plugins.host.apkinstaller.AndroidTestApkInstallerPlugin.beforeAll(AndroidTestApkInstallerPlugin.kt:236)

    at com.google.testing.platform.plugin.PluginLifecycle$onBeforeAll$1$1$2$1$1.invoke(PluginLifecycle.kt:206)

    at com.google.testing.platform.plugin.PluginLifecycle$onBeforeAll$1$1$2$1$1.invoke(PluginLifecycle.kt:206)

    at com.google.testing.platform.plugin.PluginLifecycle$verify$1.invoke(PluginLifecycle.kt:131)

    at com.google.testing.platform.api.event.Events$DefaultImpls.verify(Events.kt:38)

    at com.google.testing.platform.core.event.MutableEvents$DefaultImpls.verify(MutableEvents.kt:7)

    at com.google.testing.platform.core.event.PhaseGlobalEvents.verify(PhaseGlobalEvents.kt:20)

    at com.google.testing.platform.plugin.PluginLifecycle.verify(PluginLifecycle.kt:131)

    at com.google.testing.platform.plugin.PluginLifecycle.verify$default(PluginLifecycle.kt:127)

    at com.google.testing.platform.plugin.PluginLifecycle$onBeforeAll$1$1$2$1.invoke(PluginLifecycle.kt:206)

    at com.google.testing.platform.plugin.PluginLifecycle$onBeforeAll$1$1$2$1.invoke(PluginLifecycle.kt:205)

    at com.google.testing.platform.plugin.PluginLifecycleKt$invokeOrThrow$1$1.invoke(PluginLifecycle.kt:538)

    at com.google.testing.platform.plugin.PluginLifecycleKt$invokeOrThrow$1$1.invoke(PluginLifecycle.kt:538)

    at com.google.testing.platform.core.telemetry.common.noop.NoopDiagnosticsScope.recordEvent(NoopDiagnosticsScope.kt:35)

    at com.google.testing.platform.core.telemetry.SequentialEventRecordRequest.record$java_com_google_testing_platform_core_telemetry_telemetry_api(EventRecordRequest.kt:71)

    at com.google.testing.platform.core.telemetry.DiagnosticsExtKt.record(DiagnosticsExt.kt:27)

    at com.google.testing.platform.core.telemetry.TelemetryKt.createEvent(Telemetry.kt:60)

    at com.google.testing.platform.plugin.PluginLifecycleKt.invokeOrThrow(PluginLifecycle.kt:533)

    at com.google.testing.platform.plugin.PluginLifecycleKt.invokeOrThrow$default(PluginLifecycle.kt:517)

    at com.google.testing.platform.plugin.PluginLifecycle$onBeforeAll$1$1.invoke(PluginLifecycle.kt:205)

    at com.google.testing.platform.plugin.PluginLifecycle$onBeforeAll$1$1.invoke(PluginLifecycle.kt:199)

    at com.google.testing.platform.core.telemetry.common.noop.NoopDiagnosticsScope.recordEvent(NoopDiagnosticsScope.kt:35)

    at com.google.testing.platform.core.telemetry.SequentialEventRecordRequest.record$java_com_google_testing_platform_core_telemetry_telemetry_api(EventRecordRequest.kt:71)

    at com.google.testing.platform.core.telemetry.DiagnosticsExtKt.record(DiagnosticsExt.kt:27)

    at com.google.testing.platform.core.telemetry.TelemetryKt.createEvent(Telemetry.kt:60)

    at com.google.testing.platform.plugin.PluginLifecycle.onBeforeAll(PluginLifecycle.kt:197)

    at com.google.testing.platform.executor.SingleDeviceExecutor$execute$5.invoke(SingleDeviceExecutor.kt:136)

    at com.google.testing.platform.executor.SingleDeviceExecutor$execute$5.invoke(SingleDeviceExecutor.kt:136)

    at com.google.testing.platform.lib.cancellation.ProcessCancellationContext.runUnlessCancelled(ProcessCancellationContext.kt:136)

    at com.google.testing.platform.executor.SingleDeviceExecutor.execute(SingleDeviceExecutor.kt:136)

    at com.google.testing.platform.RunnerImpl.run(RunnerImpl.kt:121)

    at com.google.testing.platform.server.strategy.NonInteractiveServerStrategy$run$4$2.invoke(NonInteractiveServerStrategy.kt:98)

    at com.google.testing.platform.server.strategy.NonInteractiveServerStrategy$run$4$2.invoke(NonInteractiveServerStrategy.kt:98)

    at com.google.testing.platform.core.telemetry.common.noop.NoopDiagnosticsScope.recordEvent(NoopDiagnosticsScope.kt:35)

    at com.google.testing.platform.core.telemetry.SequentialEventRecordRequest.record$java_com_google_testing_platform_core_telemetry_telemetry_api(EventRecordRequest.kt:71)

    at com.google.testing.platform.core.telemetry.DiagnosticsExtKt.record(DiagnosticsExt.kt:27)

    at com.google.testing.platform.core.telemetry.TelemetryKt.createEvent(Telemetry.kt:60)

    at com.google.testing.platform.server.strategy.NonInteractiveServerStrategy.run(NonInteractiveServerStrategy.kt:95)

    at com.google.testing.platform.main.MainKt$main$4.invokeSuspend(Main.kt:75)

    at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)

    at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)

    at kotlinx.coroutines.EventLoopImplBase.processNextEvent(EventLoop.common.kt:284)

    at kotlinx.coroutines.BlockingCoroutine.joinBlocking(Builders.kt:85)

    at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking(Builders.kt:59)

    at kotlinx.coroutines.BuildersKt.runBlocking(Unknown Source)

    at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking$default(Builders.kt:38)

    at kotlinx.coroutines.BuildersKt.runBlocking$default(Unknown Source)

    at com.google.testing.platform.main.MainKt.main(Main.kt:73)

    at com.google.testing.platform.main.MainKt.main$default(Main.kt:35)

    at com.google.testing.platform.main.MainKt.main(Main.kt)

    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)

    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

    at java.base/java.lang.reflect.Method.invoke(Method.java:568)

    at com.google.testing.platform.launcher.Launcher.main(Launcher.java:154)


There were failing tests. See the report at: file:///opt/atlassian/pipelines/agent/build/app/build/reports/androidTests/connected/debug/index.html


> Task :app:connectedAndroidTest

> Task :mergeAndroidReports


BUILD SUCCESSFUL in 23m 47s

324 actionable tasks: 324 executed

当执行最后一个杀死模拟器的脚本时,它成功了.

adb devices | grep emulator | cut -f1 | while read line; do adb -s $line emu kill; done

saving arm snapshot.... !!!

OK: killing emulator, bye bye

OK

INFO    | Wait for emulator (pid 380) 20 seconds to shutdown gracefully before kill;you can set environment variable ANDROID_EMULATOR_WAIT_TIME_BEFORE_KILL(in seconds) to change the default value (20 seconds)

adb devices -l再次try ,它显示已连接的设备

emulator-5554          device product:sdk_google_phone_armv7 model:sdk_google_phone_armv7 device:generic transport_id:1

然后在应用程序模块中运行仪表测试时出现不同的错误

> Task :app:connectedDebugAndroidTest

additionalTestOutput is not supported on this device running API level 23 because the additional test output directory could not be found

Exception thrown during onBeforeAll invocation of plugin AndroidTestApkInstallerPlugin: 误差Name: UNKNOWN

NameSpace: DdmlibAndroidDeviceController

误差Code: 1

误差Type: TEST

Message: Failed to install split APK(s): [/opt/atlassian/pipelines/agent/build/app/build/outputs/apk/debug/app-debug.apk]

Failed to install split APK(s): [/opt/atlassian/pipelines/agent/build/app/build/outputs/apk/debug/app-debug.apk]

Failed to install-write all apks

com.android.ddmlib.InstallException: Failed to install-write all apks

    at com.android.ddmlib.SplitApkInstaller.install(SplitApkInstaller.java:83)

    at com.android.ddmlib.IDeviceSharedImpl.installPackages(IDeviceSharedImpl.java:395)

    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)

推荐答案

try 使用尽可能简单的图像,例如x86,然后不使用Google API,并添加-no-accel即可启动模拟器,而无需虚拟机加速.

# Configure Android SDK and Android Virtual Device (AVD)
- sdkmanager --list # Print the Android SDK's list of installed and available packages, install packages, and update packages https://developer.android.com/tools/sdkmanager#usage
- sdkmanager "system-images;android-21;default;x86" # Download an Android System Image
- echo no | avdmanager create avd -n EMU --abi default/x86 -k "system-images;android-21;default;x86" # Create an Android Virtual Device named EMU, the specified ABI and system image will be use for this emulator
# Start AVD without visual or audio output and block until device is online https://android.googlesource.com/platform/system/core/+/4f6e8d7a00cbeda1e70cc15be9c4af1018bdad53/adb/commandline.c#143
- emulator -avd EMU -memory 2048 -cache-size 1000 -partition-size 6144 -wipe-data -no-accel -no-window -no-audio -no-boot-anim & adb wait-for-device
- adb devices -l # Check connected devices
- "./gradlew connectedAndroidTest mergeAndroidReports --continue"

Android相关问答推荐

如果在Kotlin中,如何避免使用过多?

在编写中强制软键盘呈现

写入排除例外以进行依赖性判断

Android Studio -未显示布局预览(不推荐使用安全管理器)

格雷德的两个星号是什么意思?非路径

如何在Jetpack Compose中更新异步回调的用户界面

在内部创建匿名对象的繁忙循环调用函数会产生开销吗?

使用Jetpack Compose创建特定于电视的布局

为什么Kotlin允许将非空值类型化为可空类型,但又将其视为非空值?

第一次使用onBackPressed()、NavigateUp()加载时MapView崩溃

如何在 Jetpack Compose LazyColumn 中将项目分组在一起,例如卡片

使用 Gadle kotlin 为多模块 Android 代码库设置 jacoco

SQLite Kotlin 问题 - 没有数据库

从 HiltViewModel @Injection 访问 Application()

CoroutineScope 与挂起函数

如何在没有人窃取令牌的情况下使用我的移动应用程序中的 API

Jetpack Compose 动画性能问题

如何在 BottomBar jetpack compose 中删除选定的椭圆项目 colored颜色

将应用更改为暗模式后 Android MainActivity 数据泄漏

Jetpack Compose 中的按钮上的文本未更新