Tuesday, 15 May 2012

"Permission dinied" for a simple app on Android 5.0 -


I have an app in which only one activity and the next manifest file are given below. When I start it on an emulator (Android 4.3), it works fine, the activity is open, but with the Android 5.0 I refused "permission denied" error in trying to launch an app on my Nexus 5 had to face. I'v also tried to make it with SDK version 21, but it does not help

  & lt ;? Xml version = "1.0" encoding = "UTF-8"? & Gt; & Lt; Manifest xmlns: Android = "http://schemas.android.com/apk/res/android" package = "course.labs.dangerousapp" Android: versionCode = "1" Android: versionName = "1.0" & gt; & Lt; Use-sdk android: minSdkVersion = "13" Android: targetSdkVersion = "18" /> & Lt ;! - TODO - Using the permission element, define a custom permissions with the name of "course.labs.permissions.DANGEROUS_ACTIVITY_PERM" and "Dangerous" security level. - & gt; & Lt; Permission Android: name = "course.labs.permissions.DANGEROUS_ACTIVITY_PERM" Android: protectionLevel = "Dangerous" & gt; & Lt; / Permission & gt; & Lt; Android Android: allowBackup = "true" android: icon = "@drawable / ic_luncher" android: label = "@ string / app_name" android: theme = "@ style / applying" Android: permission = "course.labs.permissions.DANGEROUS_ACTIVITY_PERM "& Gt; & Lt ;! - TODO - Apply custom permissions on this activity - & gt; & Lt; Activity Android: name = "Dangerous Activity" Android: label = "@ string / app_name" & gt; & Lt ;! - TODO - Add additional intent filter information so that this activity is "course labs..permissions.DANGEROUS_ACTIVITY" - & gt; A motive with action will answer the intent. & Lt; Intent-Filter & gt; & Lt; Action Android: name = "android.intent.action.MAIN" /> & Lt; Action Android: name = "course.labs.permissions.DANGEROUS_ACTIVITY" /> & Lt; Category android: name = "android.intent.category.LAUNCHER" /> & Lt; Category android: name = "android.intent.category.DEFAULT" /> & Lt; / Intent-Filter & gt; & Lt; / Activity & gt; & Lt; / Application & gt; & Lt; / Reveal & gt;  

remove android: permission = "course.labs.permissions.DANGEROUS_ACTIVITY_PERM" to by element.

First of all, this is probably a & lt; Activity & gt; P> My guess is that it applies to all components allowed within the application.

Third, nothing on the device, probably any app you've written, in which & lt; Use-permission & gt; The element will only be able to work with your app such as an element for this permission.


No comments:

Post a Comment