Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android: Lint says - Class referenced in the layout file, was not found in the project or the libraries

Tags:

android

lint

In my app, I am using Pull TO Refresh list view library. I had designed layouts for all screens respectively. When I ran lint on my project, in one of my layout file for xlarge screen, it gave me fatal error:

Class referenced in the layout file, com.handmark.pulltorefresh.library.PullToRefreshListView, was not found in the project or the libraries

While in same layout file for other screens, it is giving no error at all. Also, I had used same library in other layouts of my file, where it does not give any error. It is giving same error for Google Maps api as well. My project targets Google Api level 16 and I had checked, all libraries are added to it. But,the error doesn't go away even on cleaning project.

like image 451
Nitish Avatar asked Mar 15 '13 10:03

Nitish


People also ask

What is lint error in Android?

The lint tool checks your Android project source files for potential bugs and optimization improvements for correctness, security, performance, usability, accessibility, and internationalization. When using Android Studio, configured lint and IDE inspections run whenever you build your app.

How to enable lint in Android Studio?

Configuring lint checking in Java and XML source files Tip: If you are using Android Studio, you can use the File > Settings > Project Settings > Inspections feature to manage the lint checking to your Java or XML source files.

How to run lint check Android?

Lint checks are automatically performed by the Gradle build system. To see the available checks in Android Studio File Settings Editor Inspections. You can also run the lint checks manually by right-clicking on your project and select Analyze Inspect Code. You can run link also from the command line.

How to disable lint in Android Studio?

The lint xml file is therefore configured in the gradle through the use of lintOptions. Linting can be disabled in java files by adding the @SuppressLint annotation to that code. For example, how you can turn off lint checking for the NewApi issue in the onCreate method.


1 Answers

This is a lint bug and you can safely ignore it. Lint is meant to help, not to hinder your development time. Change the lint Errors to warnings and you can compile and run the app just fine. I don't recommend turning it off because it helps to keep your code cleaner.

like image 69
meredrica Avatar answered Oct 22 '22 16:10

meredrica