Cannot run on Android


#1

Installed on OS X 10.9.3.

Set up the seed project with side menus. Added ios and Android platforms. iOS platform is building and running fine.

Getting this error on the Android run:
-post-build:
[move] Moving 1 file to /Users/michaelpun/pg/dev/scribe-bot/platforms/android/ant-build
[move] Moving 1 file to /Users/michaelpun/pg/dev/scribe-bot/platforms/android/CordovaLib/ant-build

debug:

BUILD SUCCESSFUL
Total time: 4 seconds
WARNING : No started emulators found, starting an emulator.
Waiting for emulator…
HAX is working and emulator runs in fast virt mode
emulator: emulator window was out of view and was recentered

Booting up emulator (this may take a while)…BOOT COMPLETE
WARNING : No target specified, deploying to emulator ‘emulator-5554’.
Installing app on emulator…
Using apk: /Users/michaelpun/pg/dev/scribe-bot/platforms/android/ant-build/HelloCordova-debug-unaligned.apk

/Users/michaelpun/pg/dev/scribe-bot/platforms/android/cordova/node_modules/q/q.js:126
throw e;
^
Failed to launch app on emulator: Failed to install apk to emulator: WARNING: linker: libdvm.so has text relocations. This is wasting memory and is a security risk. Please fix.
pkg: /data/local/tmp/HelloCordova-debug-unaligned.apk
Failure [INSTALL_FAILED_UPDATE_INCOMPATIBLE]

Error: /Users/michaelpun/pg/dev/scribe-bot/platforms/android/cordova/run: Command failed with exit code 8
at ChildProcess.whenDone (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:135:23)
at ChildProcess.EventEmitter.emit (events.js:98:17)
at maybeClose (child_process.js:743:16)
at Process.ChildProcess._handle.onexit (child_process.js:810:5)
Unable to run app on platform android. Please see console for more info.


#2

Were you able to work around this, @mike00000888?
I’m having the exact same issue.


#3

I read here, that this error usually happens:

if a previously installed
package of the same name has a different signature than the new package
(and the old package’s data was not removed).

So, in my case, deleting and recreating my virtual device did the trick.

  1. Run: $ android avd
  2. From the GUI delete your previous device and create a new one with the same specs.

Just for future reference :wink:


#4

I had a similar error:
Error: Failed to install apk to device: pkg: /data/local/tmp/android-debug.apk
Failure [INSTALL_FAILED_UPDATE_INCOMPATIBLE]

For me, I simply uninstalled the existing app from my device, and it worked again.


#5

worked for me, just remove and install again desired Android emulator images, thx!


#6

Work for me too. Just delete all the version of app you have on your device and you are again up and running


#7

Does anyone actually know why this is happening? I understand deleting the old app “fixes” it - but the ability to test the migration from one version to the next is hugely important.


#8

Thank you, work just fine for me!


#9

In my case, If i am running a newly created app with the different package name, the problem is same, WHY?


#10

Here when I got the same problem, first time was the package name that wasn’t the same.
And the second one was the app version that was lower than the one on device.
I think that if the SDK version is lower than the previous one, you can get errors too… never tested but I saw it somewhere.


#11

The solution that works for me is to open a command prompt and type:

adb uninstall my.package.id (which mean => io.ionic.starter) if you are not changing the package name

good luck :slight_smile: