【问题标题】:Cordova: adb: Command failed with exit code 255Cordova:adb:命令失败,退出代码 255
【发布时间】:2016-10-11 00:58:35
【问题描述】:

我得到这个输出/错误时

cordova run android --target 0152a65c02a27d5b --verbose

输出

    No scripts found for hook "before_run".
    No scripts found for hook "before_prepare".
    Checking config.xml for saved platforms that haven't been added to the project
    Checking for any plugins added to the project that have not been installed in android platform
    No differences found between plugins added to project and installed in android platform. Continuing...
    Generating platform-specific config.xml from defaults for android at /Users/r00/Projects/myappGo/myapp_app/platforms/android/res/xml/config.xml
    Merging project's config.xml into platform-specific android config.xml
    Merging and updating files from [www, platforms/android/platform_www] to platforms/android/assets/www
    Wrote out android application name "myapp" to /Users/r00/Projects/myappGo/myapp_app/platforms/android/res/values/strings.xml
    Wrote out Android package name "com.myappgo.myapp" to /Users/r00/Projects/myappGo/myapp_app/platforms/android/src/com/myappgo/myapp/MainActivity.java
    This app does not have launcher icons defined
    This app does not have splash screens defined
    Prepared android project successfully
    No scripts found for hook "after_prepare".
    Checking config.xml for saved plugins that haven't been added to the project
    ANDROID_HOME=/Users/r00/Library/Android/sdk
    JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_101.jdk/Contents/Home
    Running command: /Users/r00/Projects/myappGo/myapp_app/platforms/android/gradlew cdvBuildDebug -b /Users/r00/Projects/myappGo/myapp_app/platforms/android/build.gradle -Dorg.gradle.daemon=true -Pandroid.useDeprecatedNdk=true

    BUILD SUCCESSFUL

    Total time: 1.695 secs
    Command finished with error code 0: /Users/r00/Projects/myappGo/myapp_app/platforms/android/gradlew cdvBuildDebug,-b,/Users/r00/Projects/myappGo/myapp_app/platforms/android/build.gradle,-Dorg.gradle.daemon=true,-Pandroid.useDeprecatedNdk=true
    Built the following apk(s):
        /Users/r00/Projects/myappGo/myapp_app/platforms/android/build/outputs/apk/android-debug.apk
    No scripts found for hook "before_deploy".
    ANDROID_HOME=/Users/r00/Library/Android/sdk
    JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_101.jdk/Contents/Home
    Running command: adb devices
    Command finished with error code 0: adb devices
    Running command: adb devices
    Command finished with error code 0: adb devices
    Running adb shell command "cat /proc/cpuinfo" on target 0152a65c02a27d5b...
    Running command: adb -s 0152a65c02a27d5b shell cat /proc/cpuinfo
    Command finished with error code 0: adb -s,0152a65c02a27d5b,shell,cat,/proc/cpuinfo
    Skipping build...
    Built the following apk(s):
        /Users/r00/Projects/myappGo/myapp_app/platforms/android/build/outputs/apk/android-debug.apk
    Using apk: /Users/r00/Projects/myappGo/myapp_app/platforms/android/build/outputs/apk/android-debug.apk
    Package name: com.myappgo.myapp
    Installing apk /Users/r00/Projects/myappGo/myapp_app/platforms/android/build/outputs/apk/android-debug.apk on target 0152a65c02a27d5b...
    Running command: adb -s 0152a65c02a27d5b install -r /Users/r00/Projects/myappGo/myapp_app/platforms/android/build/outputs/apk/android-debug.apk
    Command finished with error code 255: adb -s,0152a65c02a27d5b,install,-r,/Users/r00/Projects/myappGo/myapp_app/platforms/android/build/outputs/apk/android-debug.apk
    Error: adb: Command failed with exit code 255
        at ChildProcess.whenDone (/Users/r00/Projects/myappGo/myapp_app/platforms/android/cordova/node_modules/cordova-common/src/superspawn.js:169:23)
        at emitTwo (events.js:87:13)
        at ChildProcess.emit (events.js:172:7)
        at maybeClose (internal/child_process.js:827:16)
        at Socket.<anonymous> (internal/child_process.js:319:11)
        at emitOne (events.js:77:13)
        at Socket.emit (events.js:169:7)
        at Pipe._onclose (net.js:486:12)

我在这里很安静

【问题讨论】:

    标签: android cordova build phonegap-build


    【解决方案1】:

    我的解决方法是删除一些应用程序。

    电话提示;它不断弹出存储空间不足的消息。但是,我认为这与(最初)无法安装应用程序无关。

    Connection: MTP (Media Device)
    USB debugging: On
    Device: LG Risio
    Android version: 6.0
    Cordova CLI: 6.5.0
    Framework: Ionic 1.x
    Ionic CLI: 2.2.1
    Machine: Mac OS X Sierra
    Node: 4.4.2
    

    额外细节:

    我一直在 MTP 和 PTP 连接之间切换。重新启动了设备。而且,我一直在电脑上插拔设备。没有任何效果。在控制台中构建总是成功的。但不知何故,该应用程序并没有安装在设备上。我有时会删除旧版本的应用程序,这可能会导致版本不一致的问题。但这也没有用。当我从手机中删除了3个大应用程序并尝试重新安装cordova run android时,该应用程序终于安装到了手机上。

    【讨论】:

      【解决方案2】:

      从你的命令行运行

      adb -s 0152a65c02a27d5b shell cat /proc/cpuinfo
      

      并检查是否失败以及如何失败。

      作为

      Running command: adb devices
      Command finished with error code 0: adb devices
      

      可能已经成功,也许您的特定设备未检测到或无法获取 cpuinfo。

      【讨论】:

        猜你喜欢
        • 2019-03-05
        • 1970-01-01
        • 2014-09-22
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2018-12-11
        • 2015-03-02
        • 1970-01-01
        相关资源
        最近更新 更多