Lint in Android Studio 1.5.1 does not work to detect missing permissions

I am currently porting the application to target API 23.

I need time to understand why accountManager.getAccountsByType("com.google") no longer works. This is due to the new Marshmallow permission model - http://developer.android.com/intl/es/training/permissions/requesting.html

I am using Android Studio 1.5.1

According to http://tools.android.com/tips/lint-checks , I expect lint to be able to warn me about the following code based on MissingPermission

 public static String getEmail() { Pattern emailPattern = Patterns.EMAIL_ADDRESS; // API level 8+ AccountManager accountManager = AccountManager.get(MyApplication.instance()); Account[] accounts = accountManager.getAccountsByType("com.google"); for (Account account : accounts) { if (emailPattern.matcher(account.name).matches()) { String possibleEmail = account.name; return possibleEmail; } } } 

I checked the lint installed on my system. I can confirm that the MissingPermission function exists through

 c:\adt-bundle-windows-x86_64-20140624\sdk\tools\lint.bat --show 

But I did not receive a warning in Android Studio. I checked the lint setup in Android Studio.

enter image description here

It seems that I do not see the option "Missing permission" there.

Is there something wrong with the settings in Android Studio?

I can see how the EverNote team once reported an error regarding lint checking for missing permissions - https://code.google.com/p/android/issues/detail?id=182165 But this has been fixed since Android Studio 1.4

+5
source share
1 answer

I am using Android Studio 2.0 Beta 2

I have several missing resolution settings in different categories, have you checked other categories?

Lint permissions

Edit: MissingPermission seems to be none of them.

0
source

Source: https://habr.com/ru/post/1239682/


All Articles