1

Running cordova run android with version 4.0.0 of the Android platform builds the APK and says that the app launched successfully but the APK isn't installed on the connected phone.

The APK can be transferred manually and works fine. Once the APK is transferred, cordova run android will open the existing APK on the phone but won't update it.

If I use version 3.6.4 of the Android platform everything works as expected.

Any ideas on what might be going wrong?

Mick
  • 118
  • 6
  • 1
    Have you run `cordova platform update`? – eomer Apr 27 '15 at 09:18
  • Yeah, I ran that but it still doesn't work for version `4.0.0` of the platform. – Mick Apr 27 '15 at 12:24
  • 1
    You may want to try logging the run command to see what is happening. I beleve from the documentation you can do so by running this command `/path/to/project/cordova/log` or if on WIndows `C:\path\to\project\cordova\log.bat`. There is also additional information on Cordova's Android Platform Guide. https://cordova.apache.org/docs/en/4.0.0/guide_platforms_android_index.md.html#Android%20Platform%20Guide – eomer Apr 27 '15 at 23:17

1 Answers1

1

This fixed it for me: https://stackoverflow.com/a/30240520/2066218

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.

Community
  • 1
  • 1
Mick
  • 118
  • 6