com.android.builder.testing.api.DeviceException:com.android.ddmlib.InstallException:无法全部安装

问题描述 投票:19回答:1

我正在使用React Native 0.26,并尝试从下面的npm进行Android应用程序的Google Plus登录。

npm install react-native-google-signin --save

我正在使用命令行(react-native run-android)直接在我的设备上构建调试apk。

非常仔细地遵循了所有安装步骤。默认情况下,我的构建仅在build.gradle(/ android /)上的构建工具版本1.2.3上有效,并且曾经用于其他项目,但是由于必须包含以下行,因此我在此项目中遇到以下错误在build.gradle文件中,

classpath 'com.google.gms:google-services:2.1.0' //

并且当我添加它时,我还必须将distributionUrl上的https\://services.gradle.org/distributions/gradle-2.13-all.zip修改为android/gradle/wrapper/gradle-wrapper.properties

[当我尝试运行build命令时进行了所有修改后,它从未在设备上安装更新的apk,并且进度保持在99%。

下面是详细错误

Installing APK 'app-debug.apk' on 'Micromax Q372 - 5.0' for app:debug
08:26:35 E/1526411097: Error while uploading app-debug.apk : Unknown failure ([CDS]close[0])
Unable to install /home/sid/react/gplus/android/app/build/outputs/apk/app-debug.apk
com.android.ddmlib.InstallException: Failed to install all 
at com.android.ddmlib.SplitApkInstaller.install(SplitApkInstaller.java:91)

......

: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
android gradle react-native apk ubuntu-14.04
1个回答
0
投票

我在尝试在特定设备上安装APK时遇到了同样的问题。

为了解决,我用adb devices列出了所有连接的设备,并确定了正确的设备,然后运行run-android指定设备ID:

react-native run-android --deviceId MY-DEVICE-ID
© www.soinside.com 2019 - 2024. All rights reserved.