2017-04-19 48 views
4

react-native run-android,並報告下面的錯誤com.android.ddmlib.InstallException:無法安裝在設備上的所有

上 'm2註釋 - 5.1' 安裝APK 'APP-debug.apk' 的應用程序:調試 10 :53:48 E/1765594925:上傳app-debug.apk時出錯:未知失敗([CDS]關閉[0]) 無法安裝/ Users/xiaotian/Desktop/wanme_rn/android/app/build/outputs/apk /app-debug.apk

失敗:生成失敗並出現異常。

  • 出了什麼問題: 執行失敗的任務 ':應用程序:installDebug'。

    com.android.builder.testing.api.DeviceException:com.android.ddmlib.InstallException:無法安裝所有

  • 嘗試: 運行與--stacktrace選項獲取堆棧跟蹤。使用--info或--debug選項運行以獲取更多日誌輸出。

構建失敗

完全錯誤日誌

03:49:45 E/693346604: Error while uploading app-debug.apk : Unknown failure ([CDS]close[0]) 
Unable to install /home/niggacode/Projects/Phones/Tokeo/android/app/build/outputs/apk/app-debug.apk 
com.android.ddmlib.InstallException: Failed to install all 
     at com.android.ddmlib.SplitApkInstaller.install(SplitApkInstaller.java:89) 
     at com.android.ddmlib.Device.installPackages(Device.java:904) 
     at com.android.builder.testing.ConnectedDevice.installPackages(ConnectedDevice.java:137) 
     at com.android.build.gradle.internal.tasks.InstallVariantTask.install(InstallVariantTask.java:134) 
     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) 
     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 
     at java.lang.reflect.Method.invoke(Method.java:498) 
     at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:75) 
     at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.doExecute(AnnotationProcessingTaskFactory.java:228) 
     at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:221) 
     at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:210) 
     at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:621) 
     at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:604) 
     at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:80) 
     at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:61) 
     at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:46) 
     at org.gradle.api.internal.tasks.execution.PostExecutionAnalysisTaskExecuter.execute(PostExecutionAnalysisTaskExecuter.java:35) 
     at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:66) 
     at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58) 
     at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:52) 
     at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52) 
     at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:53) 
     at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43) 
     at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:203) 
     at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:185) 
     at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.processTask(AbstractTaskPlanExecutor.java:66) 
     at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.run(AbstractTaskPlanExecutor.java:50) 
     at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor.process(DefaultTaskPlanExecutor.java:25) 
     at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter.execute(DefaultTaskGraphExecuter.java:110) 
     at org.gradle.execution.SelectedTaskExecutionAction.execute(SelectedTaskExecutionAction.java:37) 
     at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:37) 
     at org.gradle.execution.DefaultBuildExecuter.access$000(DefaultBuildExecuter.java:23) 
     at org.gradle.execution.DefaultBuildExecuter$1.proceed(DefaultBuildExecuter.java:43) 
     at org.gradle.execution.DryRunBuildExecutionAction.execute(DryRunBuildExecutionAction.java:32) 
     at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:37) 
     at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:30) 
     at org.gradle.initialization.DefaultGradleLauncher$4.run(DefaultGradleLauncher.java:153) 
     at org.gradle.internal.Factories$1.create(Factories.java:22) 
     at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:91) 
     at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:53) 
     at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:150) 
     at org.gradle.initialization.DefaultGradleLauncher.access$200(DefaultGradleLauncher.java:32) 
     at org.gradle.initialization.DefaultGradleLauncher$1.create(DefaultGradleLauncher.java:98) 
     at org.gradle.initialization.DefaultGradleLauncher$1.create(DefaultGradleLauncher.java:92) 
     at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:91) 
     at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:63) 
     at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:92) 
     at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:83) 
     at org.gradle.launcher.exec.InProcessBuildActionExecuter$DefaultBuildController.run(InProcessBuildActionExecuter.java:99) 
     at org.gradle.tooling.internal.provider.ExecuteBuildActionRunner.run(ExecuteBuildActionRunner.java:28) 
     at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35) 
     at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:48) 
     at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:30) 
     at org.gradle.launcher.exec.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:81) 
     at org.gradle.launcher.exec.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:46) 
     at org.gradle.launcher.exec.DaemonUsageSuggestingBuildActionExecuter.execute(DaemonUsageSuggestingBuildActionExecuter.java:51) 
     at org.gradle.launcher.exec.DaemonUsageSuggestingBuildActionExecuter.execute(DaemonUsageSuggestingBuildActionExecuter.java:28) 
     at org.gradle.launcher.cli.RunBuildAction.run(RunBuildAction.java:43) 
     at org.gradle.internal.Actions$RunnableActionAdapter.execute(Actions.java:173) 
     at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:239) 
     at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:212) 
     at org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRuntimeValidationAction.java:35) 
     at org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRuntimeValidationAction.java:24) 
     at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:33) 
     at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:22) 
     at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:205) 
     at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:169) 
     at org.gradle.launcher.Main.doAction(Main.java:33) 
     at org.gradle.launcher.bootstrap.EntryPoint.run(EntryPoint.java:45) 
     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) 
     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 
     at java.lang.reflect.Method.invoke(Method.java:498) 
     at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBootstrap.java:55) 
     at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.java:36) 
     at org.gradle.launcher.GradleMain.main(GradleMain.java:23) 
     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) 
     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 
     at java.lang.reflect.Method.invoke(Method.java:498) 
     at org.gradle.wrapper.BootstrapMainStarter.start(BootstrapMainStarter.java:30) 
     at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:127) 
     at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61) 
: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: Failed to install all 

* Try: 
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. 

BUILD FAILED 

Total time: 13.41 secs 
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/android-setup.html 
+0

這是整個錯誤嗎?這裏沒多少東西 –

回答

0

的問題是與Android模擬器。更改了AVD設置以啓用「使用主機GPU」,問題將得到解決。

+0

我在M2 Note設備上運行代碼不是Android模擬器,AVD設置很有用嗎? – user7871794

+0

哦!在這種情況下。 AVD將無法使用。您是否嘗試過手動將APK文件推送至設備並從設備安裝? –

+0

哦,是的,安裝APK到設備是可以的!但這種方式不能使用開發者菜單,比如重新加載,熱重新加載!我想用這些 – user7871794

相關問題