lundi 24 avril 2017

Gradle command connectedGoogleDebugAndroidTest resilts in Failed to install all on Android 5 devices

I'm using Espresso to run instrumentation tests. When I run the gradle 2.14.1 command connectedGoogleDebugAndroidTest the tests run OK on all devices, except on an Android 5.0.1 tablet.

I get

[WARN] [org.gradle.api.Task] com.android.builder.testing.api.DeviceException: com.android.ddmlib.InstallException: Failed to install all

and

FAILURE: Build failed with an exception. [ERROR] [org.gradle.BuildExceptionReporter] * What went wrong: [ERROR] [org.gradle.BuildExceptionReporter] Could not receive a message from the daemon.

I read that it could be an issue with folder access permissions on Android 5 devices (when I try to accessing /data folder in the device using adb, it tells me that I don't have permission) I have tried some of the suggested methods (de-authorizing the device on the development machine , restarting and reauthorizing it) but it didn't work.

I've also noticed that there seemes to be a bug in earlier gradle versions that could cause this issue, nevertheless I also see people facing issues with later verisons. http://ift.tt/2oXWxpp

here is the debug log:

01:06:31.008 [DEBUG] [org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter] Starting to execute task ':connectedGoogleDebugAndroidTest'
01:06:31.008 [DEBUG] [org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter] Determining if task ':connectedGoogleDebugAndroidTest' is up-to-date
01:06:31.008 [INFO] [org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter] Executing task ':connectedGoogleDebugAndroidTest' (up-to-date check took 0.0 secs) due to:
  Task has not declared any outputs.
01:06:31.008 [DEBUG] [org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter] Executing actions for task ':connectedGoogleDebugAndroidTest'.
01:06:32.644 [DEBUG] [org.gradle.api.Task] DeviceConnector 'TAB 2 A10-70F - 5.0.1': installing /Users/USERNAME/GoogleDrive/git/FOLDERNAME/build/outputs/apk/app-android-google-debug.apk
01:06:35.404 [QUIET] [system.out] 01:06:35 E/1382318257: Error while uploading app-android-google-debug.apk : Unknown failure ([CDS]close[0])
01:06:35.961 [ERROR] [org.gradle.api.Task] Unable to install /Users/USERNAME/GoogleDrive/git/FOLDERNAME/build/outputs/apk/app-android-google-debug.apk
com.android.ddmlib.InstallException: Failed to install all 
        at com.android.ddmlib.SplitApkInstaller.install(SplitApkInstaller.java:91)
        at com.android.ddmlib.Device.installPackages(Device.java:901)
        at com.android.builder.testing.ConnectedDevice.installPackages(ConnectedDevice.java:119)
        at com.android.builder.internal.testing.SimpleTestCallable.call(SimpleTestCallable.java:121)
        at com.android.builder.internal.testing.SimpleTestCallable.call(SimpleTestCallable.java:48)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at java.lang.Thread.run(Thread.java:745)
01:06:35.963 [WARN] [org.gradle.api.Task] 
com.android.builder.testing.ConnectedDevice > runTests[TAB 2 A10-70F - 5.0.1] FAILED 
01:06:35.963 [WARN] [org.gradle.api.Task]       com.android.builder.testing.api.DeviceException: com.android.ddmlib.InstallException: Failed to install all 
                at com.android.builder.testing.ConnectedDevice.installPackages(ConnectedDevice.java:129)
01:06:36.402 [DEBUG] [org.gradle.launcher.daemon.client.DaemonClientConnection] Problem receiving message to the daemon. Performing 'on failure' operation...
01:06:36.403 [DEBUG] [org.gradle.launcher.daemon.client.DaemonClientInputForwarder] Dispatching close input message: org.gradle.launcher.daemon.protocol.CloseInput@4714fa9c
01:06:36.403 [DEBUG] [org.gradle.launcher.daemon.client.DaemonClientConnection] thread 19: dispatching class org.gradle.launcher.daemon.protocol.CloseInput
01:06:36.403 [DEBUG] [org.gradle.launcher.daemon.client.DaemonClientConnection] thread 1: connection stop
01:06:36.408 [ERROR] [org.gradle.BuildExceptionReporter] 
01:06:36.408 [ERROR] [org.gradle.BuildExceptionReporter] FAILURE: Build failed with an exception.
01:06:36.409 [ERROR] [org.gradle.BuildExceptionReporter] 
01:06:36.409 [ERROR] [org.gradle.BuildExceptionReporter] * What went wrong:
01:06:36.409 [ERROR] [org.gradle.BuildExceptionReporter] Could not receive a message from the daemon.
01:06:36.409 [ERROR] [org.gradle.BuildExceptionReporter] 
01:06:36.409 [ERROR] [org.gradle.BuildExceptionReporter] * Try:
01:06:36.409 [ERROR] [org.gradle.BuildExceptionReporter] Run with --stacktrace option to get the stack trace.

Aucun commentaire:

Enregistrer un commentaire