IITC-CE / ingress-intel-total-conversion

intel.ingress.com total conversion user script with some new features. Should allow easier extension of the intel map.
https://iitc.app
ISC License
284 stars 110 forks source link

Unable to reinstall apk: INSTALL_FAILED_UPDATE_INCOMPATIBLE #12

Closed johnd0e closed 3 years ago

johnd0e commented 5 years ago

Edited

Unable to reinstall apk with changed signature. The problem appeared after uninstalling previous build truing to keep it's data with this command:

adb uninstall [-k] <package> - remove this app package from the device
                               ('-k' means keep the data and cache directories)

Please help.

johnd0e commented 5 years ago

BTW, did you change something in apk build (e.g. signature)? I just failed to install latest test apk over previous one, so I had to uninstall it at first.

modos189 commented 5 years ago

I didn't change debug signature, but I didn't spesify it. It is possible that each build uses new signature

johnd0e commented 5 years ago

I've just run into problem, after uninstalled apk with this command:

adb shell pm uninstall -k org.exarhteam.iitc_mobile.debug

Now it's impossible to install apk again, because I have not stored that previous apk from 05/12. And any other version just refuses to install. May be you still have that version?

Or may be you can tell what should I clear in my system in order to be able to install new apk? Already have deleted /data/app/org.exarhteam.iitc_mobile.debug, but some data still remains somewhere..

modos189 commented 5 years ago

-k: keep the data and cache directories around after package removal.

You can try without this key. If not, what is the error if you install using

adb install IITC_Mobile-debug.apk

johnd0e commented 5 years ago

You can try without this key

Too late, it is not working

If not, what is the error if you install using

Error message is brief, can't remember exact text now, but something about wrong signature.

modos189 commented 5 years ago

maybe adb shell pm clear org.exarhteam.iitc_mobile.debug

johnd0e commented 5 years ago

This fails too

modos189 commented 5 years ago

adb install -r IITC_Mobile-debug.apk ? Don't know what the problem is, can the error text to this command?

  push package(s) to the device and install them
 -l: forward lock application
 -r: replace existing application
 -t: allow test packages
 -s: install application on sdcard
 -d: allow version code downgrade (debuggable packages only)
 -p: partial application install (install-multiple only)
 -g: grant all runtime permissions
johnd0e commented 5 years ago

adb install IITC_Mobile-debug.apk (plus any of mentioned key):

   Failure [INSTALL_FAILED_UPDATE_INCOMPATIBLE]

adb uninstall org.exarhteam.iitc_mobile.debug

   Failure - not installed for 0

adb shell pm clear org.exarhteam.iitc_mobile.debug

    Failed

But: adb shell pm dump org.exarhteam.iitc_mobile.debug still indicates that package info stored somewhere.

With TWRP I've cleaned all directories:

   /data/app/org.exarhteam.iitc_mobile.debug-1/
   /data/data/org.exarhteam.iitc_mobile.debug/

Unfortunately nothing changed.

Also I've tried to install apk manually, with TWRP, placing it here (with 755 permissions):

      /data/app/org.exarhteam.iitc_mobile.debug-1/base.apk

Still no luck.

johnd0e commented 5 years ago

The single trace that I've found is the output of adb shell pm dump org.exarhteam.iitc_mobile.debug

DUMP OF SERVICE package:

  Key Set Manager:

    [org.exarhteam.iitc_mobile.debug]

        Signing KeySets: 545

  Packages:

    Package [org.exarhteam.iitc_mobile.debug] (217e65b):

      userId=10605

      pkg=null

      codePath=/data/app/org.exarhteam.iitc_mobile.debug-1

      dexoptNeeded=

  Exception occurred while dumping:

  java.lang.NullPointerException: Attempt to read from field 'android.util.ArraySet android.content.pm.PackageParser$Package.mDexOptPerformed' on a null object reference

    at com.android.server.pm.Settings.dumpPackageLPr(Settings.java:4045)

    at com.android.server.pm.Settings.dumpPackagesLPr(Settings.java:4275)

    at com.android.server.pm.PackageManagerService.dump(PackageManagerService.java:15674)

    at android.os.Binder.dump(Binder.java:326)

    at android.os.Binder.onTransact(Binder.java:292)

    at android.content.pm.IPackageManager$Stub.onTransact(IPackageManager.java:2112)

    at com.android.server.pm.PackageManagerService.onTransact(PackageManagerService.java:2665)

    at android.os.Binder.execTransact(Binder.java:453)

I suspect that problem is in Key Set Manager, may be there is some secure storage that prevents to install apk with incompatible signature. Unfortunately, it's only guesses, and I failed to find any info in the internet.

modos189 commented 5 years ago

what is use adb disable-verity? https://stackoverflow.com/questions/44344766/java-lang-nullpointerexception-when-using-adb-to-deploy-apk-to-android-n-phone

johnd0e commented 5 years ago

what is use adb disable-verity?

disable-verity only works for userdebug builds

modos189 commented 5 years ago

Maybe create a separate issue with asking for help?

johnd0e commented 5 years ago

Maybe create a separate issue with asking for help?

Done, but vice versa: recreate original issue as #24, and renamed this. Please change label.

johnd0e commented 5 years ago

Actually, I do not feel hopeful about this issue. So I use option Enable developer mode, and upload all *.js in dev directory.

BTW, are there other places where we can discuss iitc-ce development? May be we should create forum or chat? Telegram group? Gitter room?