簡體   English   中英

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

[英]com.android.builder.testing.api.DeviceException: com.android.ddmlib.InstallException: Failed to install all

我正在使用 React Native 0.26 並嘗試從下面的 npm for 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' // <--- 添加這個

當我加入這個,我也有修改distributionUrlhttps\\://services.gradle.org/distributions/gradle-2.13-all.zipandroid/gradle/wrapper/gradle-wrapper.properties

在我嘗試運行構建命令時進行所有修改后,它永遠不會在設備上安裝更新的 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

我在嘗試在特定設備上安裝 APK 時遇到了同樣的問題。

為了解決這個問題,我用adb devices列出了所有連接的設備,並確定了正確的adb devices ,然后運行run-android指定設備 ID:

react-native run-android --deviceId MY-DEVICE-ID

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM