简体   繁体   中英

Constant 'Running Android Lint' Failed, nullpointerexception popping up in Eclipse (but doesn't seem to be my code)

I don't recall what it is I updated (probably some android ADK items), but suddenly I keep getting a "Problem Occurred" text box in Eclipse, frequently . It says:

'Running Android Lint' has encountered a problem. Failed

And there is an OK and a Details button. When I click Details, I get:

Failed java.lang.NullPointerException

From the text box, I can't tell what it is that failed....it sounds like the running of Lint itself failed, and failed from a NPE. There is no line number associated with any of my code anywhere, so I don't think it's from my code.

I've tried disabling running Lint along with everything else...but clicking the checkbox for "Runs Android Lint" just causes Lint to run, and thus give the message box warning. It does seem to actually run, as several Lint warnings appear on the bottom. But it still seems like it's telling me Lint itself is having a NPE...and I have on idea where to fix that.

I'm running Eclipse SDK 3.7.2 in Windows Home Premium 64bit, with JDK 6 (recently uninstalled JDK 7 and installed 6 instead.)

This is caused by a bug in ADT 23.0.2, noted per the issue here: https://code.google.com/p/android/issues/detail?id=73002

Upgrading to 23.0.3 fixed it for me.

  1. Start Eclipse
  2. Go to Help->Install new Software
  3. Select "Android Developer Tools Update Site - https://dl.google.com/android/eclipse/ " from the drop down (You can add it if you don't have it by clicking add and pasting the name and URL)
  4. Check the Developer Tools package in the package list (expand it and make sure that all the sub-packages are checked)
  5. To avoid a bug when installing, uncheck "Contact all update sites during install to find required software"
  6. Click next, accept licences, click next
  7. Once the install finishes, restart Eclipse.

In Window > Preferences > Android > Lint Error Checking; uncheck "When saving files check for errors.

I had to change my project settings under Android to the API-Level I used in android:targetSdkVersion . Now the problem is gone.

Just had this problem myself. It was isolated to a single library, as I could clean and rebuild each package and only one reported this error. I finally rolled out some edits from one source file and the Lint exception went away. It was just an enumerated type as a formal parameter in a method, which seemed pretty innocuous, but there you go. It does seem to be a Lint bug, but a wierd one. Hope that helps.

I got this problem after I upgraded from Android 19 to 20 in my manifest. I did this because Eclipse was crying that I wasn't using the latest Android version and should think of updating it.

    <uses-sdk
    android:minSdkVersion="17
    android:targetSdkVersion="20" /> 

The error might have occured because I don't have the lastest SDK (20) installed.

Changing it back to:

    <uses-sdk
    android:minSdkVersion="17"
    android:targetSdkVersion="19" />

Fixed the problem for me.

I had this issue and it turned out that java compiler had reverted to 1.5. Setting it to 1.6 fixed these issues. Properties > Java Compiler ? Compiler compliance level: 1.6. I see this occasionally, but I'm not sure why the compiler reverts back to 1.5.

The following steps helped me to solve the same issue.

On My Project -> Context Menu -> Android Tools -> Fix Project Properties Changing to latest version in AndroidManifest.xml

I'm not a expert and English is not my mother tongue. But I got a work around for this problem.

I encountered the Problem when the appocompat_v7 data was destroyed. So I deleted that apk in the workspace I am using. Then I generated a new apk in my workspace in the appcom... was generated automatically and now it works.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM