0

I've been using ionic run android --device to send my ionic app to my Android phone for two years now.

It always used to do an "update install". I.e. it would update the app but retain all local app information (localStorage, granted permissions, position on homescreen). However, all of a sudden it now does a complete re-install every time. So, when I run the command the result is as if it did a complete un-install and then a fresh install. This means that all settings are lost.

Why has this suddenly started happening? Is there any way of getting it back to working in the previous way?

Many thanks in advance.

Pertinent info:

$ ionic -version
2.0.0
(I don't actually recall updating to ionic 2(!) Perhaps this is the culprit?)

$ java -version
java version "1.8.0_101"
Java(TM) SE Runtime Environment (build 1.8.0_101-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.101-b13, mixed mode) (I just updated to Java 8 so this could also be the culprit...)

$ cordova -version
5.4.0

OS
Windows 10

Android version (on phone)
6.0.1 - security patch 5 October 2016.

strttn
  • 2,320
  • 1
  • 18
  • 17
  • Are you deleting and re-creating android platform every time you build an apk? Or, are you building an apk from different computers? It used to happen to us if we built the apk on a different PC – Marko Oct 13 '16 at 01:42
  • Thanks for the comment. I'm always running it from the same PC. I just use the `ionic run android --device` command and it builds the project and then installs it on the device. I don't delete and re-create the android platform. – strttn Oct 13 '16 at 15:18
  • 1
    As a workaround, in case anyone else is having the same issue, it seems I can get an "update install" by building the apk and then manually running it on the device via the package installer. It'd still be nice to fix the original issue though :) – strttn Oct 13 '16 at 15:28
  • That's weird tho. I mean I used to do both options, -run and -build, and in both cases only time I had to uninstall an app is if we build it from a diff PC. By the way, just ionic run works for me, no need to do --device. Maybe you got emulators or more devises though – Marko Oct 13 '16 at 23:54
  • Hi there. No, just a single device. It does work without the --device but I just got into a habit, I guess. :) – strttn Oct 17 '16 at 13:48

1 Answers1

0

To my happened to me the same and the solution was:

rm -r node_modules/ && npm install

I hope this helps!

EDIT

I found an information that in several cases it worked. Link

Community
  • 1
  • 1
sioesi
  • 497
  • 1
  • 5
  • 20
  • Thank you for the answer. That did not work for me though, unfortunately. Have you any idea what it was in node_modules that was causing the problem? – strttn Oct 13 '16 at 15:17
  • @strttn It is deleted and updated, it is possible to cache error with different versions. This happened in many cases when the CLI is updated. You leave a link of interest, with your same problem could be solved. – sioesi Oct 13 '16 at 16:08
  • Thank you for the link. I haven't had the chance to fully explore it yet but I'll report back if I find anything that helps with the issue. – strttn Oct 17 '16 at 13:53