Вопрос

If I run "lint ." inside project directory I get the expected warnings, but if I run it from inside eclipse I get nonsense errors and warnings, for example:

  • The resource R.array.settings_derivatives appears to be unused [in fact, it is used]
  • The x.y.z is not registered in the manifest [in fact, it is registered]
  • Call requires API level 3 (current min is 1): android.view.SurfaceView#isInEditMode [in fact minSdkVersion is set to 7]

edit: If I create a new workspace and import the existing projects I get the right errors

Это было полезно?

Решение

There seems to be an issue, when the project directory is not directly under the workspace directory.

As of today the bug should be fixed in release 20: http://code.google.com/p/android/issues/detail?id=27527

Edit:

If necessary you can make a softlink into the workspace.

Другие советы

The problem was solved by switching workspace to a fresh one. It probably was a problem with settings left over from previous lint versions

I solved the same problem using this:-

Right click on the project folder > Android tools > Clear Link Markers

"Run Android Lint" makes some markers and the markers cause this error.

"Preference --> Android --> Lint Error Checking", search issues "NewApi", and you can see the settings.

This check scans through all the Android API calls in the application and warns about any calls that are not available on all versions targeted by this application (according to its minimum SDK attribute in the manifest).

If your code is deliberately accessing newer APIs, and you have ensured (e.g. with conditional execution) that this code will only ever be called on a supported platform, then you can annotate your class or method with the @TargetApi

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top