Error on importing an Eclipse project into Android Studio

ε祈祈猫儿з 提交于 2020-01-01 03:35:11

问题


I'm trying to import a project done in Eclipse to Android Studio. While importing, I'm getting the following error:

"There are unrecoverable errors which must be corrected first"

Library reference ../../../../workspace/android-support-v7-appcompat could not be found

I tried copying appcompat folder to the root directory of project, still same error. How can I resolve it?

Please refer the screenshot for more details


回答1:


Finally, I found a way..I opened the project.properties file in a text editor and removed the line which was related to appcompat. Then I managed to import the project without errors. After successful import, I added appcompat as a dependency as answered by Gabriele Mariotti. Thanks Gabriele Mariotti.




回答2:


Dont' copy the appcompat library as a module in Android Studio.

Just add this dependency in your app/build.gradle file:

dependencies {
    compile "com.android.support:appcompat-v7:21.0.3"
}

Where the structure of your project is:

root
  app
     build.gradle  <-- here
  build.gradle  //top level


来源:https://stackoverflow.com/questions/28701237/error-on-importing-an-eclipse-project-into-android-studio

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!