29

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.)

Bananeweizen
  • 21,797
  • 8
  • 68
  • 88
Rob
  • 801
  • 2
  • 9
  • 16
  • This Android pop up is a real nuisance. – kpsfoo Oct 29 '13 at 08:32
  • @kpsfoo It's not merely a "nuisance". It's telling you that your workspace is corrupted. Go ahead and ignore exceptions like this if you desire, but don't expect positive results... – arkon Aug 08 '14 at 12:55
  • possible duplicate of [How to solve this : 'Running android lint' issue](http://stackoverflow.com/questions/12243762/how-to-solve-this-running-android-lint-issue) – arkon Aug 08 '14 at 13:05

8 Answers8

33

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.
abegosum
  • 636
  • 5
  • 11
15

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

Baby Groot
  • 4,637
  • 39
  • 52
  • 71
dave
  • 175
  • 1
  • 2
  • there is no lint error checking for saving files in my eclipse... :( – Shridutt Kothari Apr 16 '14 at 11:00
  • 11
    @user7777777 Ignoring an error is **not** what I would call a solution. – arkon Aug 08 '14 at 13:00
  • 6
    @b1nary.atr0phy: I'd call "ignoring an _error_ that's not really an error you have any control over but rather an error in clearly not production-ready third-party code that is supposed to scan for _potential errors_ and falls flat on its face while doing so, causing a modal dialog to annoy you with a useless message" a perfectly acceptable solution. ;-) +1 from me. – Amos M. Carpenter Aug 21 '14 at 08:00
3

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

2

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.

ArgentMage
  • 43
  • 1
  • 6
  • How did you narrow it down? I've found I can run Lint on individual projects, and doing that has narrowed it down to probably 1 project. But I am still getting a "null pointer" popup message, and this seems like it is separate from the Lint warnings and messages I am getting. Why does this "Lint Failed" message popup when all other Lint messages are shown in the window? And why doesn't Lint give me a line number if it really is a problem it found?? I still think Lint itself is crashing, but I do not know why. – Rob Aug 09 '12 at 21:45
  • 2
    What annoys the heck out of me is that it pops up this dialog box after EVERY SAVE of a file, right in the middle of the screen. I used to keep closing it, but now I minimize it so it doesn't keep popping up...it just quietly collects it's FAILED messages in the corner. – Rob Aug 09 '12 at 23:01
  • I started by selectively cleaning one package at a time. The error only occurred in one of the 5 packages, so that narrowed it down. After copying off my changes from the day, I did an SVN Revert on the code and got back my state from the start of the day, and that did not produce the error - then put my changes back in until the error happened, and chose a different way to accomplish the task (using an Int instead of Enum in this case didn't produce the error). – ArgentMage Aug 13 '12 at 21:32
  • And I should mention that this has happened a couple more times in the same package since, so I'm committing my source changes much more frequently. It's definitely some kind of weird eclipse error, since the code runs just fine, and there are no lint errors in the Problems tab. Very strange, and very annoying. – ArgentMage Aug 13 '12 at 21:33
  • Interesting. I don't know how far I'd have to go back to have it stop, but it might be worth the effort. I found a lint.xml file in the main directory of the project and deleted that, hoping that would make a difference. Initially it seemed to, but it's back to how it was now. – Rob Aug 16 '12 at 18:29
2

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.

David
  • 1,227
  • 12
  • 23
  • This gave me the idea, I changed all my projects since I have 3 for the App and on proeject for testing. I had mixed minimum versions and target versions on all apps. So now all have min=11 and target=19. – JPM Aug 21 '14 at 15:37
1

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.

Derek Johnson
  • 191
  • 1
  • 2
  • 1
    I looked over all of the projects, and did find one that was set to 1.5. I changed it to 1.6, but still get the very annoying Lint NPE popup. – Rob Sep 12 '12 at 22:59
0

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

Sam003
  • 331
  • 3
  • 3
0

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.

Patrick M
  • 10,547
  • 9
  • 68
  • 101
User
  • 1