Mac错误创建Android项目 - “项目中运行构建器'Android资源管理器'的错误”

时间:2023-01-20 09:43:00

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:

我花了一整天时间试图在我的Mac上创建一个简单的Android应用程序项目(10.7.5)。在项目向导中按“完成”时,我收到以下错误消息:

    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.

创建了一个包含空目录的项目,但除了名为“proguard-project.txt”的文件外,没有生成任何文件,该文件只包含注释。

I literally just downloaded the ADT Bundle onto my Mac.

我只是将ADT Bundle下载到我的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".

我已经看过这里并尝试了所有建议,比如删除“.metadata”文件夹并尝试更改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.

我也尝试过使用Eclipse Juno和Kepler - 同样的问题。我重新安装了Eclipse并重新创建了多次工作区。

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

所以我很困难......它没有开箱即用。非常感激任何的帮助。

10 个解决方案

#1


25  

I got same error on my windows machine.

我的Windows机器上出现了同样的错误。

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.

失踪了,所以我创建了一个txt文件并将其重命名为“project.properties”,然后在我的控制台上收到了此消息。

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

我们只为该项目设置了一个有效的project.properites文件。

#2


14  

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

创建一个空的project.properties文件让它对我有用。

#3


13  

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

我按照以下步骤向Eclipse.ini添加一行并解决了问题

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.

#4


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. 通过在eclipse中打开Android SDK Manager来检查Extra文件夹,确保您已经安装了以下库Android支持库,Android支持存储库和Google Repository。

  3. Create an Android Sample Project then choose the appcompact_v7 library.
  4. 创建一个Android Sample Project,然后选择appcompact_v7库。

  5. Close the project you've just created, restart Eclipse and create now a new Android Application project.
  6. 关闭刚刚创建的项目,重新启动Eclipse并立即创建一个新的Android应用程序项目。

Hope that it will help you !

希望它能帮到你!

#5


2  

workaround

1. create the project

1.创建项目

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

2.在Eclipse中导入创建的项目

#6


1  

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

我在新的Macbook Pro上遇到了同样的问题所以我只是下载了JDK并安装了它并修复了问题。

#7


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.

我的Windows 8也有同样的问题。我通过转到eclipse工作区文件夹并删除名为appcompat_v7的文件夹来解决它。重启后的日食。它会工作正常。

#8


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

在不创建活动的情况下创建项目(在创建新项目向导中,只需取消创建活动)。然后在清单中手动创建活动。然后,这应该创建属性文件

#9


0  

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

这是解决这个问题的另一种方法,因为这篇文章已被回答。

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

(在windows / linux上)在eclipse中,执行以下操作:

  1. right click on project
  2. 右键单击项目

  3. Select 'Android Tools' near bottom of the list
  4. 选择列表底部附近的“Android工具”

  5. Select 'Fix Project Properties'
  6. 选择“修复项目属性”

That should do the trick also.

这应该也可以。

#10


0  

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

只需删除旧版本的JDK,安装最新版本之后就可以了。

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

JDK 8,Eclipse Luna,ADT 26是最佳组合。

Thanks Manoj

#1


25  

I got same error on my windows machine.

我的Windows机器上出现了同样的错误。

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.

失踪了,所以我创建了一个txt文件并将其重命名为“project.properties”,然后在我的控制台上收到了此消息。

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

我们只为该项目设置了一个有效的project.properites文件。

#2


14  

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

创建一个空的project.properties文件让它对我有用。

#3


13  

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

我按照以下步骤向Eclipse.ini添加一行并解决了问题

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.

#4


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. 通过在eclipse中打开Android SDK Manager来检查Extra文件夹,确保您已经安装了以下库Android支持库,Android支持存储库和Google Repository。

  3. Create an Android Sample Project then choose the appcompact_v7 library.
  4. 创建一个Android Sample Project,然后选择appcompact_v7库。

  5. Close the project you've just created, restart Eclipse and create now a new Android Application project.
  6. 关闭刚刚创建的项目,重新启动Eclipse并立即创建一个新的Android应用程序项目。

Hope that it will help you !

希望它能帮到你!

#5


2  

workaround

1. create the project

1.创建项目

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

2.在Eclipse中导入创建的项目

#6


1  

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

我在新的Macbook Pro上遇到了同样的问题所以我只是下载了JDK并安装了它并修复了问题。

#7


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.

我的Windows 8也有同样的问题。我通过转到eclipse工作区文件夹并删除名为appcompat_v7的文件夹来解决它。重启后的日食。它会工作正常。

#8


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

在不创建活动的情况下创建项目(在创建新项目向导中,只需取消创建活动)。然后在清单中手动创建活动。然后,这应该创建属性文件

#9


0  

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

这是解决这个问题的另一种方法,因为这篇文章已被回答。

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

(在windows / linux上)在eclipse中,执行以下操作:

  1. right click on project
  2. 右键单击项目

  3. Select 'Android Tools' near bottom of the list
  4. 选择列表底部附近的“Android工具”

  5. Select 'Fix Project Properties'
  6. 选择“修复项目属性”

That should do the trick also.

这应该也可以。

#10


0  

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

只需删除旧版本的JDK,安装最新版本之后就可以了。

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

JDK 8,Eclipse Luna,ADT 26是最佳组合。

Thanks Manoj