For my project, the annotation cannot be found, since my target api is set to 13:
Then fix this or set android:targetSdkVersion low enough that you don't need @JavascriptInterface .
Why do I need to go to the project build target (e.g. Project> Properties> Android in Eclipse) and change it to API 17+ as permission.
Since @JavascriptInterface does not exist until API level 17, the same as DisplayManager does not exist until API level 17.
Now I need to build against this SDK when all I really want to do is ignore the annotation for anything below API 17.
Since your build target does not affect any other classes, methods, annotations, etc., I do not see this problem.
I do not like the idea of creating against api 17, and then figuring out that I have code that will not work on previous releases.
Lint has been reporting API level violations for more than a year. Just make sure your android:minSdkVersion installed correctly.
In the end, you already relied on this, since your android:minSdkVersion set to 11 , and now your build target is set to 13. This means that you are counting Lint to tell where you are using API level 12 and API Level 13 API so you can handle them correctly. All you do is raise your build goal to increase the number of things you rely on Lint for.
source share