问题
I have an old app developed in Eclipse and now trying to migrate it to Android Studio.
I updated the libraries and followed the basic steps.
Now, I am getting this error:
Error: Project 'app' not found in root project 'projectName'.
I am using
classpath 'com.android.tools.build:gradle:3.0.1'
and latest gradle 4.1.
Can anyone help on this?
回答1:
I think your project is too old.
Here is a classpath use it. Then your project will ask for update and Project will automatically update to latest version. It work like mid upgrade then high upgrade for too old project. Actually it work for me many times. I am not sure but you can try this. Use this instead of latest class path.
classpath 'com.android.tools.build:gradle:2.3.0-alpha2'
回答2:
Check whether you have renamed your project or opened the wrong directory, the android project will be in the inner directory of the main directory that you just opened. Also post a screenshot of your project hierarchy.
回答3:
In case anyone is still looking for solution, please verify if you have any issue with settings.gradle.
settings.gradle should contain below strings:
**include ':app'**
来源:https://stackoverflow.com/questions/49278875/error-project-app-not-found-in-root-project-projectname