Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Being told project is not using the gradle build system when it is

When I open my project in Android Studio, I always get this. Error when project is opened

Back when Android Studio first came out, I went through this process so the project should have the Gradle build system. There is a build.gradle file in the root of the project. I can still build and run the project, but I don't understand why it always says this since the project should use gradle build system. Any help with this would be great.

like image 736
Sega dude Avatar asked Dec 03 '13 21:12

Sega dude


People also ask

Why is my Gradle build failing?

If gradle --version works, but all of your builds fail with the same error, it is possible there is a problem with one of your Gradle build configuration scripts. You can verify the problem is with Gradle scripts by running gradle help which executes configuration scripts, but no Gradle tasks.

How do I migrate to using the Gradle build system?

Import a Gradle-based IntelliJ project If you are already using Gradle with your IntelliJ project, you can open it in Android Studio using the following steps: Click File > New > Import Project. Select your IntelliJ project directory, and click OK. Your project will open in Android Studio.

How do I fix Gradle issues?

For this, you have to connect your PC to the internet and you have to open your Android studio. After opening your project click on the Sync Project with Gradle files option. This will automatically download the new Gradle files and will fix the issue which is caused by the Gradle files.


1 Answers

The android studio support two "build mode". one is "legacy" and one is "gradle based". If you are using an very early version of android studio, probably you are still using the legacy build mode. You need to re-import your project using "gradle mode" then this warning will be gone.

To do so, select "file/import project", select your project root directory, and in the next dialog choose "Import project from external model" and select gradle. Then, you may choose "gradle wrapper" or use your own gradle distribution (1.8 for now[12/2013]).

like image 189
Shawn Avatar answered Nov 01 '22 19:11

Shawn