网上下载一个老工程,.project文件里有eclipse。

android studio导入eclipse项目
eclipse项目结构

Android studio文件结构

下面是导入步骤:
第一步,打开一个项目。
选择File->New->Import Project

第二步,选择Eclipse项目根目录文件夹
第三步,默认选择如下选项,点击Finish

根据提示点击Add google Maven repository and sync project

AS会自动检查是否需要对某些文件重构,如果有点击DO Refactor再次编译
如果碰到错误:Could not find method compile() for arguments
Could not find method compile() for arguments [com.android.support:support-v4:32.+] ...
解决:将 compile 改为 implementation 即可!


如果提示错误:Could not find any version that matches com.android.support:appcompat-v4....
就改成这样:
implementation 'com.android.support:support-v4:+'

编译成功,运行成功!
参考链接:https://blog.csdn.net/Unixeyes/article/details/129815410