3

当我尝试在 Android M 设备上升级我的应用程序时,我在设备上收到错误消息:
App not installed. ”。

日志猫说:

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?

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

4

1 回答 1

2

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

于 2016-04-07T03:26:06.810 回答