安装错误代码:-26升级应用程序时

时间:2016-03-16 08:40:47

标签: android android-permissions android-6.0-marshmallow app-update

当我尝试在Android M设备上升级我的应用程序时,我收到的错误是:
设备上的“应用未安装。”。

logcat说:

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)    

安装错误代码-26有什么意义?
我之前的应用程序目标SDK版本为23,较新的应用程序目标SDK版本为22 日志包括:

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

虽然在较新的升级应用程序中未添加任何新权限。

如何确保在M设备上正确升级应用,目标SDK版本从23减少到22?

提前感谢任何类型的投入。

1 个答案:

答案 0 :(得分:1)

我遇到了同样的问题。经过几次安装,我发现目标减少是原因。我首先使用目标23安装了我的应用程序的1.4.2版本,然后使用目标22重新安装1.4.3版本,它失败并显示“失败[INSTALL_FAILED_PERMISSION_MODEL_DOWNGRADE]”信息。我用目标23重新打包了1.4.3版本,并成功重新装入。所以我认为答案是你应该再次将你的目标提高到23。