cordova run android executes fine. But Android 4.1.2 doesn't start the app

后端 未结 7 456
悲哀的现实
悲哀的现实 2020-12-02 19:04

I\'m starting to develop and android app using Cordova 5.0.0 (cordova -v prints 5.0.0), and testing it on a Moto Razr D1 with Android 4.1.2. Under Windows 7, btw.

         


        
7条回答
  •  一生所求
    2020-12-02 19:30

    I met the same problem (Cordova "hello world" app won't display) and found a way to pass through it (but I don't really understand the underlying causes).

    Problem seemed to occur when installing the apk. On Cordova 5.0.0, adb commands to install the apk can be found at line 101 of file platforms\android\cordova\lib\device.js (and at line 311 of platforms\android\cordova\lib\emulator.js for cordova emulate android):

    adb -s ' + resolvedTarget.target + ' install -r -d "' + apk_path + '"

    Current command returns to me: "Error: unknown option -d"!

    If you simply delete the "-d" option, applications run normally with cordova run android.

    EDIT

    The -d is supposed to come directly after adb (as in --device) instead of after install. So you can just move it there instead of removing it.

    Plus, here is the opened issue on apache cordova issue tracker

提交回复
热议问题