6

I am running the Lint tool from Eclipse(Android SDK).

My settings are default and NewApi is set up as Error in my Android Lint Settings However, when I run Lint (by Package Explorer > Android Tools > Run Lint: Check for Common Errors.), It seems to ignore the fact that I have used API methods higher than the android:minSdkVersion in my manifest XML.

What am I doing wrong?

UPDATE:

I tried to do the check by Lint command line tool by:

lint "C:\Android\workspace\MyProject" -- still didnot show the newAPI errors

However when I did the link check specifically for newAPI:

lint --check NewApi "C:\Android\workspace\MyProject" --- showed the expected errors

Why are NewApi errors not pointed by default?

A Nice Guy
  • 2,676
  • 4
  • 30
  • 54
  • Can you paste the code where you have used NewAPIs? – AndyFaizan Feb 13 '14 at 09:57
  • 3
    Turns out that this is a bug. Check this [link](https://code.google.com/p/android/issues/detail?id=56427). – AndyFaizan Feb 13 '14 at 10:54
  • That bug is closed now. But I still see the issue. Using Android Studio 3.0.1, I ran Lint. Please let me know in which section of the results this check is listed. I used to get the warning as a compile time error before in java file itself. Now, it did not show up. E.g: Html.fromHtml(getString(R.string.privacy_policy_name)) is introduced in API 24. minSdkVersion is 16 in build.gradle file. No error was shown in java file where this was written. Tried to find the error in lint results. I am not able to find the section where this kind of error is specified – garnet Nov 27 '17 at 05:31
  • Sorry, when I use the correct method introduced in API 24, I get the warning: Html.fromHtml(getString(R.string.privacy_policy_name), 0); But, the deprecation warning for using Html.fromHtml(getString(R.string.privacy_policy_name)) was NOT shown. It's a minor issue anyways. – garnet Nov 27 '17 at 07:11
  • For Android Studio users. Check this [answer](https://stackoverflow.com/a/49357147/8942811). – Bek Mar 19 '18 at 06:55

0 Answers0