gpt4 book ai didi

android - 失败 [INSTALL_FAILED_PERMISSION_MODEL_DOWNGRADE]

转载 作者:可可西里 更新时间:2023-11-01 19:09:24 26 4
gpt4 key购买 nike

我在CMD中输入了下面的命令,命令下面返回了错误。

命令:

phonegap run android --verbose --stacktrace

错误:

ERROR: Failed to launch application on device:

ERROR: Failed to install apk to device: pkg: /data/local/tmp/MainActivity-debug.apk

Failure [INSTALL_FAILED_PERMISSION_MODEL_DOWNGRADE]

最佳答案

这里的问题是,您尝试安装的 APK 版本低于您设备上已有的版本。

卸载肯定会为您解决该问题。

亚行允许更大的灵 active adb install -r -d <apk path> ,但我不确定 Phonegap 是否具有该功能。

adb install [-lrtsdg] <file>
- push this package file to the device and install it
(-l: forward lock application)
(-r: replace existing application)
(-t: allow test packages)
(-s: install application on sdcard)
(-d: allow version code downgrade)
(-g: grant all runtime permissions)

更新:

事实证明,这不是降级应用程序版本的正确错误消息。事实上,它是完全不同的东西。我 found this link准确说明情况:

tl;dr You can't fool the new Android 6 permissions model by first publishing an APK with targetSdk 23 which will grant all permissions runtime and then publishing a new version with targetSdk 22 or less. You'll get an INSTALL_FAILED_PERMISSION_MODEL_DOWNGRADE error.

I was working on an app with targetSdk 23 (Android 6 Marshmallow) when it hit me that it possibly could be a security issue with the new Android permission model. Android 6 devices approves all permission on install time and then the user has to approve them whenever the app asks for the permission. What if the user installed the app - auto granting all permissions - and then it didn't ask for using them, and then afterwards the app was updated with the same permissions, but with a lower targetSdk?

I spent a couple minutes creating an app that targeted SDK level 23 and added a fine location permission (ACCESS_FINE_LOCATION). Then I installed and ran the app. The app didn't ask for permission to access the location manager. Then I set the SDK level to 22 and tried to install the app. Luckily it wasn't able to install. I got an error saying Failure [INSTALL_FAILED_PERMISSION_MODEL_DOWNGRADE].

关于android - 失败 [INSTALL_FAILED_PERMISSION_MODEL_DOWNGRADE],我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34791561/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com