gpt4 book ai didi

java - 从 Android Git 创建 Eclipse 项目

转载 作者:塔克拉玛干 更新时间:2023-11-02 08:54:04 26 4
gpt4 key购买 nike

我已经从 Android git 下载了一个开源 Android 应用程序(音乐应用程序),我正在尝试从源代码创建一个新项目。使用该现有源创建新项目不起作用,给我一个“无效的描述错误”。有帮助吗?

最佳答案

您一定是指错误消息“invalid project description”。

参见 this thread (以下相关摘录,重点是我的):

如果您在下载的应用程序中看到一个 .project,您可以尝试 "File"+ "Import"+ "Existing Projects into Workspace" 并选择音乐样本的目录。

但如果不是,则使用 New> Android Project> Create project from existing source 是正确的做法。
确保选择您想要的 Android 目标(1.1 或 1.5 或 2.0):
“新项目”向导会自动为您选择正确的示例目录。
然后选择“浏览”和音乐目录。然后它应该填充新 android 项目向导底部的属性。

However you should not put your workspace in %ANDROID_HOME%\samples.
Leave it somewhere else (My Documents, whatever).
I suspect you get a conflict because Eclipse tries to create a project and there's already a directory of the same name.
In either case, can you look at your_workspace_dir/.metadata/.log for a more verbose error and post it?

简而言之:

  • Change the workspace other than android SDK.
  • Then dont put project name first.
  • Browse the project of \samples\Music in create project from the source.
  • The other fields will fill automaticaly.
  • Then execute....

另见 this tutorial (对于蛇样本)

I wanted to open up the Snake sample provided in the SDK samples.
For this, choose ‘Create project from existing source’ in the New Android Project window and select the Snake directory from Samples.
This will set the package name, activity name, and application name for you.

http://www.infinitezest.com/images/eclipse-android-snake-project.jpg


也就是说,如果在导入项目后,您最终(就像 OP)出现大量错误。
见问题 R cannot be resolved - android error :

  • 确保SDK目录下的工具有执行权限
  • 转到 Project > Build all(并选择“Build Automatically

R is an automatically generated class that holds the constants used to identify your resources.


根据 OP 自己的报告 (GuyNoir),整个 Eclipse Android 项目出现大量编译错误的其他原因:

The code I downloaded from git was the newest version, and probably for Android 2.1, where the SDK I'm was creating it under was Android 1.5.
So I'll need to download older code or install the latest SDK.

关于java - 从 Android Git 创建 Eclipse 项目,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2211689/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com