26

I spent the whole day just trying to create a simple Android Application Project on my Mac (10.7.5). When pressing "Finish" in the project wizard, I got the following error message:

    Errors occurred during the build.
    Errors running builder 'Android Resource Manager' on project 'MyFirstApp'.
    java.lang.NullPointerException

A project with empty directories was created, but no files were generated except for a file called "proguard-project.txt", which just contained comments.

I literally just downloaded the ADT Bundle onto my Mac.

I've already had a look at here and tried all the suggestions there, like removing the ".metadata" folder and trying to change the Android "Project Build Target".

I've also tried using Eclipse Juno and Kepler - same problem. I've reinstalled Eclipse and recreated workspaces many many times.

So I'm pretty stuck...it's not working out of the box. Any help would be most appreciated.

Community
  • 1
  • 1
iht
  • 692
  • 1
  • 8
  • 15
  • Sounds like Eclipse doesn't see SDK Android folder. Did you configured your Eclipse? – Maxim Shoustin Aug 07 '13 at 06:42
  • I didn't think I need to? ADT Bundle comes with the SDK installed. I had a look at the "Eclipse/Preferences/Android", and it seems to be pointing to the "SDK" directory that came with the bundle "adt-bundle-mac-x86_64-20130729" – iht Aug 07 '13 at 06:49
  • Lots of people solved this issue as described at this link: http://stackoverflow.com/questions/14455018/eclipse-android-errors-running-builder-android-pre-compiler-on-project – superpuccio Oct 02 '13 at 08:55
  • Were you able to solve this problem? I have same issue and I can't find any reason why this is happening. – Sourabh86 May 13 '14 at 14:02
  • Glad you got it solved,Would you mind to mark the answer? – ganesh Aug 13 '15 at 13:52
  • one of the [solution](http://stackoverflow.com/a/26245000/2624806). – CoDe Oct 11 '15 at 05:40

10 Answers10

25

I got same error on my windows machine.

When I compared project file system with other working project I found that

  project.properties 

was missing, So I Created a txt file and renamed it to "project.properties" then got this message on my console.

 "Project has no project.properties file! Edit the project properties to set one"

Then I went through project menu

project->properties->android->choose & set the "project build target".

then build it.now everything was smooth.

We just setup a valid project.properites file for that project.

ganesh
  • 780
  • 7
  • 19
  • In my case before adding project build target I need to open project.properties file and add below line: android.library=false – Milan Sheth Dec 15 '15 at 08:02
14

Creating an empty project.properties file got it working for me.

MushroomSoda
  • 380
  • 4
  • 8
13

I followed below steps to add a line to the Eclipse.ini and solved the problem

1. Go to your eclipse directory and find "Eclipse.app" file. Just to 
   be on safe side, back up this file somewhere (Just the Eclipse.app file).
2. Right-Click on "Eclipse.app" file, and select "Show Package 
   Contents"
3. Once inside package, go to Contents-->MacOS, and open        
   "eclipse.ini"
4. Just before the "-vmargs", add the following:

-vm
/System/Library/Frameworks/JavaVM.framework/Versions/1.6/Commands/java

5. Run eclipse again, and you should be able to create the project  
    without any problems.
Jack
  • 6,430
  • 27
  • 80
  • 151
  • @HugoGresse study the article that is mentioned in the answer. – Jack Apr 03 '15 at 08:53
  • this worked for me, but in my case java was located in a slightly different place: /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/bin – Ben H May 08 '15 at 20:33
  • @HugoGresse can not do much, just follow the steps. Article was included as a reference. – Jack Jun 19 '15 at 13:48
3

This is the the solution I've used to solve that problem which gave me enough troubles.

  1. Make sure that you've installed already the following libraries Android Support Library, Android Support Repository and Google Repository by checking in the Extra folder by openning the Android SDK Manager in eclipse.
  2. Create an Android Sample Project then choose the appcompact_v7 library.
  3. Close the project you've just created, restart Eclipse and create now a new Android Application project.

Hope that it will help you !

Valynk
  • 466
  • 7
  • 7
2

workaround

1. create the project

android create project --target [target-id] --name MyFirstApp --path [path-to-workspace]/MyFirstApp --activity MainActivity --package com.example.myfirstapp

2. import the created project in Eclipse

rudolph9
  • 8,021
  • 9
  • 50
  • 80
Mauricio
  • 21
  • 2
1

I faced same problem on my New Macbook Pro so I just Downloaded JDK and installed it and problem fixed.

For Guru
  • 1,197
  • 13
  • 23
0

i have also the same kind of problem with my windows 8 . i solve it by going to eclipse workspace folder and delete the folder called appcompat_v7 . after the restart the eclipse . it will works fine.

redblood
  • 542
  • 1
  • 4
  • 19
0

Create a project without creating an activity(in the create new project wizard just untick create an activity). then create the activity manually in the manifest. this should then create the properties file as well

Andre Coetzee
  • 1,260
  • 3
  • 20
  • 34
0

Here is another way to fix this, since this post has been answered.

(on windows/ linux) In eclipse, do the following:

  1. right click on project
  2. Select 'Android Tools' near bottom of the list
  3. Select 'Fix Project Properties'

That should do the trick also.

wseme
  • 805
  • 6
  • 14
0

Just remove the older version of JDK,Install latest version after that it's work fine.

JDK 8,Eclipse Luna,ADT 26 is the best combination.

Thanks Manoj