3

When I'm trying to upgrade my application on an Android M device, I'm getting an error as:
"App not installed." on the device.

The logcat says:

03-17 14:12:32.161: W/InstallAppProgress(18572): Replacing package:com.test.upgrade
03-17 14:12:32.164: D/AudioFlinger(386): mixer(0xb4310008) throttle end: throttle time(4)
03-17 14:12:32.243: I/LaunchCheckinHandler(1783): Displayed com.google.android.packageinstaller/com.android.packageinstaller.InstallAppProgress,wp,ca,106
03-17 14:12:32.243: I/ActivityManager(1783): Displayed com.google.android.packageinstaller/com.android.packageinstaller.InstallAppProgress: +107ms
03-17 14:12:32.244: I/Keyboard.Facilitator(2895): onFinishInput()
03-17 14:12:32.263: D/Finsky(19175): [1] PackageVerificationReceiver.onReceive: Verification requested, id = 5
03-17 14:12:32.284: D/Finsky(19175): [1] WorkerTask.onPreExecute: Verification Requested for id = 5, data=file:///storage/emulated/0/Download/testupgrade-release(4).apk flags=18 fromVerificationActivity=false
03-17 14:12:32.294: D/OpenGLRenderer(18572): endAllActiveAnimators on 0xb8ce3950 (RippleDrawable) with handle 0xb8adfba0
03-17 14:12:32.629: W/SurfaceFlinger(361): couldn't log to binary event log: overflow.
03-17 14:12:34.211: D/Finsky(19175): [1] PackageVerificationService$1.onResponse: Verification id=5 response=0
03-17 14:12:34.220: D/Finsky(19175): [1] PackageVerificationReceiver.onReceive: Verification requested, id = 5
03-17 14:12:34.253: D/DefContainer(19477): Copying /storage/emulated/0/Download/testupgrade-release(4).apk to base.apk
03-17 14:12:35.210: W/PackageManager(1783): Package com.test.upgrade new target SDK 22 doesn't support runtime permissions but the old target SDK 23 does.
03-17 14:12:35.462: D/InstallAppProgress(18572): Installation error code: -26
03-17 14:12:37.503: I/SFPerfTracer(361):      triggers: (rate: 23:1168) (compose: 0:3) (post: 0:1) (render: 12:263) (171:15181 frames) (172:17292)
03-17 14:12:37.503: D/SFPerfTracer(361):        layers: (4:12) (FocusedStackFrame (0xb8b20fc0): 1:416)* (DimLayer (0xb8b08448): 0:129)* (DimLayer (0xb8bc0988): 0:12)* (StatusBar (0xb8b62628): 0:3907) (com.android.systemui.ImageWallpaper (0xb8b33c88): 0:108)* (DimLayer (0xb8b39238): 0:741)* (DimLayer (0xb8b64828): 0:82)* ( (0xb8bb6128): 0:35) (NavigationBar (0xb8bcaca8): 0:299) (com.google.android.packageinstaller/com.android.packageinstaller.InstallAppProgress (0xb8bcfac0): 0:124)- (com.google.android.packageinstaller/com.android.packageinstaller.PackageInstallerActivity (0xb8bce7f8): 0:54)- (com.google.android.packageinstaller/com.android.packageinstaller.InstallAppProgress (0xb8bbbc28): 172:198)    

What is the significance of install error code -26?
My earlier app target SDK version was 23 and newer app target SDK version is 22.
The logs include:

Package com.test.upgrade new target SDK 22 doesn't support runtime permissions but the old target SDK 23 does.   

While no new permission have been added in the newer upgrade application.

How can ensure that app is correctly upgraded on M devices with my target SDK version reduced to 22 from 23?

Thanking in advance for any kind of inputs.

Zeba
  • 3,041
  • 1
  • 28
  • 39

1 Answers1

2

I ran into the same problem. After several times of installation, I find that target reduced is the reason. I first installed 1.4.2 version of my app with target 23, and then reinstall 1.4.3 version with target 22, it failed with information "Failure [INSTALL_FAILED_PERMISSION_MODEL_DOWNGRADE]". I repackaged the 1.4.3 version with target 23, and resintalled successfully. So I think the answer is that you should increase your target to 23 again.

passerbywhu
  • 522
  • 5
  • 8