public class WrongImportDetector
extends com.android.tools.lint.detector.api.Detector
implements com.android.tools.lint.detector.api.SourceCodeScanner
The root cause is probably this (from http://source.android.com/source/using-eclipse.html) :
Note: Eclipse sometimes likes to add an import android.R statement at the top of your files that use resources, especially when you ask eclipse to sort or otherwise manage imports. This will cause your make to break. Look out for these erroneous import statements and delete them.
com.android.tools.lint.detector.api.Detector.BinaryResourceScanner, com.android.tools.lint.detector.api.Detector.ClassScanner, com.android.tools.lint.detector.api.Detector.GradleScanner, com.android.tools.lint.detector.api.Detector.OtherFileScanner, com.android.tools.lint.detector.api.Detector.ResourceFolderScanner, com.android.tools.lint.detector.api.Detector.UastScanner, com.android.tools.lint.detector.api.Detector.XmlScanner| Modifier and Type | Field and Description |
|---|---|
static com.android.tools.lint.detector.api.Issue |
ISSUE
Is android.R being imported?
|
| Constructor and Description |
|---|
WrongImportDetector()
Constructs a new
WrongImportDetector check |
| Modifier and Type | Method and Description |
|---|---|
com.android.tools.lint.client.api.UElementHandler |
createUastHandler(com.android.tools.lint.detector.api.JavaContext context) |
java.util.List<java.lang.Class<? extends org.jetbrains.uast.UElement>> |
getApplicableUastTypes() |
afterCheckEachProject, afterCheckFile, afterCheckLibraryProject, afterCheckProject, afterCheckRootProject, analyzeCallGraph, applicableAnnotations, applicableSuperClasses, appliesTo, appliesTo, appliesToResourceRefs, beforeCheckEachProject, beforeCheckFile, beforeCheckLibraryProject, beforeCheckProject, beforeCheckRootProject, checkBinaryResource, checkCall, checkClass, checkClass, checkDslPropertyAssignment, checkFolder, checkInstruction, checkMethodCall, createPsiVisitor, fix, getApplicableAsmNodeTypes, getApplicableAttributes, getApplicableCallNames, getApplicableCallOwners, getApplicableConstructorTypes, getApplicableElements, getApplicableFiles, getApplicableMethodNames, getApplicablePsiTypes, getApplicableReferenceNames, getCustomVisitor, getSpeed, isApplicableAnnotationUsage, isCallGraphRequired, run, visitAnnotationUsage, visitAttribute, visitBuildScript, visitClass, visitClass, visitConstructor, visitConstructor, visitDocument, visitElement, visitElementAfter, visitMethod, visitMethod, visitReference, visitReference, visitResourceReference, visitResourceReferenceclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitanalyzeCallGraph, applicableAnnotations, applicableSuperClasses, appliesToResourceRefs, getApplicableConstructorTypes, getApplicableMethodNames, getApplicableReferenceNames, isApplicableAnnotationUsage, isCallGraphRequired, visitAnnotationUsage, visitClass, visitClass, visitConstructor, visitMethod, visitReference, visitResourceReferencepublic static final com.android.tools.lint.detector.api.Issue ISSUE
public WrongImportDetector()
WrongImportDetector checkpublic java.util.List<java.lang.Class<? extends org.jetbrains.uast.UElement>> getApplicableUastTypes()
getApplicableUastTypes in interface com.android.tools.lint.detector.api.SourceCodeScannergetApplicableUastTypes in class com.android.tools.lint.detector.api.Detectorpublic com.android.tools.lint.client.api.UElementHandler createUastHandler(@NonNull
com.android.tools.lint.detector.api.JavaContext context)
createUastHandler in interface com.android.tools.lint.detector.api.SourceCodeScannercreateUastHandler in class com.android.tools.lint.detector.api.Detector