2016-01-14 5 views
12

Aşağıdaki komutu CMD'de girdim ve komut, komutun altındaki hatayı döndürdü.Hata [INSTALL_FAILED_PERMISSION_MODEL_DOWNGRADE]

Komut:

phonegap run android --verbose --stacktrace 

Hata:

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]

+0

Çok yararlı bir sorgu. öyle –

cevap

30

Sorun şu ki, APK'nızın zaten cihazınızda olandan daha az bir sürümünü yüklemeye çalışıyorsunuz.

Kaldırma sorunu sizin için kesinlikle çözecektir.

ADB, daha fazla esneklik sağlar adb install -r -d <apk path>, ancak Phonegap'in bu işlevselliğe sahip olduğundan emin değilim.

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) 

Güncelleme:

O App sürümünü geçersiz kılınması için doğru hata mesajı değildi çıkıyor. Infact, tamamen ayrı bir şey.

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].

+0

** - r ** nerede duruyor? Bunu [developer.android.com] android hata ayıklama köprüsü belgelerinde bulamıyorum (http://developer.android.com/tools/help/adb.html). 'Sürüm' ile ne demek istediğini de söyleyebilir misin? Bu biraz belirsiz. – SPottuit

+0

Sorumu, seçenek anlamını yeniden yansıtmak için güncelledim. Sürümüne göre, Uygulama sürümünüzü kastediyorum. App sürüm 3 yüklüyse ve Uygulama sürüm 2'yi yüklemeyi denerseniz. Bu, bozulma bayrağı olmadan buna izin vermez. – Knossos

+0

Teorinizi test ettim. Uygulama sürümümü 2'den 1'e değiştirdim ve farklı bir hata aldım: '[INSTALL_FAILED_VERSION_DOWNGRADE]' böylece kafam karıştı. Bu hata, daha önce sahip olduğumla aynı anlama gelir: '[INSTALL_FAILED_PERMISSION_MODEL_DOWNGRADE]'? Bu hatalar arasındaki farkın ne olduğunu merak ediyorum. – SPottuit

7

Çözüm: Ben yönetilen

Cihazımdan Uygulamamı kaldırarak hata kurtulmak için.

Neden: muhtemelen hataya neden Ne

Ben SDK Manager ile benim Android SDK güncelleştirilmiş olmasıdır.

0

Belirli bir emülatör profili kullanarak Android için Taco ve hata ayıklama kullanarak VS2015 bu hata var: doğru durumu açıklıyor Ben found this link. Ben VS Emulator 10.1" Zefir (6.0.0) xhdpi Tablet projesiydi üzerinde çalıştığı için bu özel profil üzerinde bir uygulama olarak yüklenmiştir.Geliştirme ve bu özel profili yeniden yükleyerek sorunu çözdüm: Araçlar -> Android için Visual Studio Emulator -> Profili kaldır. benim app içeriyordu ve hata gitti.Ayrıca uzak bir cihazdan uygulamayı kaldırmanın VS Emulator eşdeğer, sanırım.