com.android.builder.testing.api.DeviceException: com.android.ddmlib.InstallException: Unknown fai...

刚开始还好好的,嗨能正常运行,但是突然就报了这个错误:

> Task :app:installDebug

03:01:51 V/ddms: execute: running am get-config

03:01:52 V/ddms: execute 'am get-config' on '0123456789ABCDEF' : EOF hit. Read: -1

03:01:52 V/ddms: execute: returning

Installing APK 'app-debug.apk' on 'HUAWEI Y600D-C00 - 4.3' for app:debug

03:01:52 D/app-debug.apk: Uploading app-debug.apk onto device '0123456789ABCDEF'

03:01:52 D/Device: Uploading file onto device '0123456789ABCDEF'

03:01:52 D/ddms: Reading file permision of E:\reactnative\ffchat\android\app\build\outputs\apk\debug\app-debug.apk as: rwx------

03:02:00 V/ddms: execute: running pm install -r -t "/data/local/tmp/app-debug.apk"

03:02:01 V/ddms: execute 'pm install -r -t "/data/local/tmp/app-debug.apk"' on '0123456789ABCDEF' : EOF hit. Read: -1

03:02:01 V/ddms: execute: returning

Unable to install E:\reactnative\ffchat\android\app\build\outputs\apk\debug\app-debug.apk

com.android.ddmlib.InstallException: Unknown failure: Error: Could not access the Package Manager.  Is the system running?

        at com.android.ddmlib.Device.installRemotePackage(Device.java:1022)

        at com.android.ddmlib.Device.installPackage(Device.java:903)

        at com.android.ddmlib.Device.installPackage(Device.java:881)

        at com.android.ddmlib.Device.installPackage(Device.java:870)

        at com.android.builder.testing.ConnectedDevice.installPackage(ConnectedDevice.java:126)

        at com.android.build.gradle.internal.tasks.InstallVariantTask.install(InstallVariantTask.java:179)

        at com.android.build.gradle.internal.tasks.InstallVariantTask.install(InstallVariantTask.java:110)

        at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:73)

        at org.gradle.api.internal.project.taskfactory.StandardTaskAction.doExecute(StandardTaskAction.java:46)

        at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:39)

        at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:26)

        at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:801)

        at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:768)

        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$1.run(ExecuteActionsTaskExecuter.java:131)

        at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:300)

        at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:292)

        at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:174)

        at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:90)

        at org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31)

        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:120)

        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:99)

        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:77)

        at org.gradle.api.internal.tasks.execution.OutputDirectoryCreatingTaskExecuter.execute(OutputDirectoryCreatingTaskExecuter.java:51)

        at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:59)

        at org.gradle.api.internal.tasks.execution.ResolveTaskOutputCachingStateExecuter.execute(ResolveTaskOutputCachingStateExecuter.java:54)

        at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:59)

        at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:101)

        at org.gradle.api.internal.tasks.execution.FinalizeInputFilePropertiesTaskExecuter.execute(FinalizeInputFilePropertiesTaskExecuter.java:44)

        at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:91)

        at org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter.execute(ResolveTaskArtifactStateTaskExecuter.java:62)

        at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:59)

        at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:54)

        at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)

        at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:34)

        at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.run(EventFiringTaskExecuter.java:51)

        at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:300)

        at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:292)

        at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:174)

        at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:90)

        at org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31)

        at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter.execute(EventFiringTaskExecuter.java:46)

        at org.gradle.execution.taskgraph.LocalTaskInfoExecutor.execute(LocalTaskInfoExecutor.java:42)

        at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareWorkItemExecutor.execute(DefaultTaskExecutionGraph.java:277)

        at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareWorkItemExecutor.execute(DefaultTaskExecutionGraph.java:262)

        at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$ExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:135)

        at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$ExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:130)

        at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$ExecutorWorker.execute(DefaultTaskPlanExecutor.java:200)

        at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$ExecutorWorker.executeWithWork(DefaultTaskPlanExecutor.java:191)

        at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$ExecutorWorker.run(DefaultTaskPlanExecutor.java:130)

        at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)

        at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46)

        at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)

> Task :app:installDebug FAILED

FAILURE: Build failed with an exception.

* What went wrong:

Execution failed for task ':app:installDebug'.

> com.android.builder.testing.api.DeviceException: com.android.ddmlib.InstallException: Unknown failure: Error: Could not access the Package Manager.  Is the system run

ning?

* Try:

Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 14s

352 actionable tasks: 3 executed, 349 up-to-date

error Could not install the app on the device, read the error above for details.

Make sure you have an Android emulator running or a device connected and have

set up your Android development environment:

https://facebook.github.io/react-native/docs/getting-started.html

error Command failed: gradlew.bat app:installDebug. Run CLI with --verbose flag for more details.

百度了很多文档都说是签名、模拟器、电脑硬件等等。。。

还有一名rn大佬告诉我说添加了什么代码去掉重试。。。

然鹅并没有什么卵用。

最后发现是我链接了两台手机,其中一台没有开机,虽然另外一台连接着,表面看也能安装,就是不能运行,重启了电脑也没有用,把另外一台手机拔掉就好了,哈哈,真是醉了,记录一下。

你可能感兴趣的:(com.android.builder.testing.api.DeviceException: com.android.ddmlib.InstallException: Unknown fai...)