【问题标题】:Importing an existing Eclipse android project into Android Studio将现有的 Eclipse android 项目导入 Android Studio
【发布时间】:2015-09-13 01:00:13
【问题描述】:

我接到了一项任务,将现有的 eclipse android 工作区导入 Android Studio。我尝试了所有可能的方法,但现在的问题是我得到的工作空间是一个大型项目,它包含多个相互关联的项目和库。 起初,android studio 找不到我解决了修复 android 方面的 android 清单文件。这样做会产生新的错误,这些错误与AndroidManifest.xml 文件中使用的资源有关,例如@string/app_name。我应该如何导入完整的工作区?

该项目在 Eclipse 中运行良好,没有任何错误。

我们将非常感谢您在这方面的任何帮助或建议。

Information:Using javac 1.7.0 to compile java sources
Information:Compilation completed with 6 errors and 0 warnings in 23 sec
Information:6 errors
Information:0 warnings
G:\pgWorkspace\Pocketglobe\AndroidManifest.xml
    Error:Error:line (35)Android Resource Packaging: [pgWorkspace] G:\pgWorkspace\Pocketglobe\AndroidManifest.xml:35: error: Error: No resource found that matches the given name (at 'icon' with value '@drawable/app_icon').
    Error:Error:line (35)Android Resource Packaging: [pgWorkspace] G:\pgWorkspace\Pocketglobe\AndroidManifest.xml:35: error: Error: No resource found that matches the given name (at 'label' with value '@android:string/app_name').
    Error:Error:line (35)Android Resource Packaging: [pgWorkspace] G:\pgWorkspace\Pocketglobe\AndroidManifest.xml:35: error: Error: No resource found that matches the given name (at 'theme' with value '@style/AppTheme').
    Error:Error:line (109)Android Resource Packaging: [pgWorkspace] G:\pgWorkspace\Pocketglobe\AndroidManifest.xml:109: error: Error: No resource found that matches the given name (at 'value' with value '@string/app_id').
    Error:Error:line (112)Android Resource Packaging: [pgWorkspace] G:\pgWorkspace\Pocketglobe\AndroidManifest.xml:112: error: Error: No resource found that matches the given name (at 'value' with value '@integer/google_play_services_version').
    Error:Error:line (118)Android Resource Packaging: [pgWorkspace] G:\pgWorkspace\Pocketglobe\AndroidManifest.xml:118: error: Error: No resource found that matches the given name (at 'value' with value '@android:string/google_APIKEY')

【问题讨论】:

标签: android android-studio


【解决方案1】:

1.首先用eclipse将你所有的项目导出到gradle build 确保您在 Eclipse 中拥有最新的 ADT 和 SDK。

首先选择生成Gradle Build

2.将您所有的工作空间项目添加到 gradle build

然后按照说明进行操作。生成你的 gradle Build。 记住您的导出位置。您需要在 Android Studio 中导入时定位。

3.启动 Android Studio 文件 > 新建 > 导入项目 或在欢迎屏幕中,您可以选择导入项目。

并按照 android Studio 要求 Gradle 设置的步骤进行操作。

对于more的信息

1.Link 1

2.Link 2

【讨论】:

  • 感谢您的帮助。你能描述一下你的第二步吗?
  • @SyedDany 检查更新的答案。
  • 嘿伙计,你简直就是个天才。我已经按照说的做了,但问题仍然存在。一开始它给出了一个错误,指出找不到 AndroidManifest.xml 文件。我通过转到文件 > 其他项目设置 > 方面 > 清单文件位置来修复它。这样做之后,Android Studio 又给了我一些新错误,这些错误无法找到清单文件中所述的资源。我检查过的no resource found for @string/app_name 是否在string.xml 文件中。
  • @SyedDany 你能附上屏幕截图/添加错误吗?并告诉我你的项目结构和 Gradle 文件。
猜你喜欢
  • 1970-01-01
  • 2016-08-06
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2015-06-21
  • 1970-01-01
  • 2014-05-12
  • 2017-06-07
相关资源
最近更新 更多