Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can a valid (Project) build.gradle not show in 'Android' view?

In Android Studio 3.0.1 Project window I select Android then expand Gradle Scripts

Normally the top of the list shows build.gradle(Project:XXXX).

It does not appear, but choosing Project window Project Files confirms it's existance.

I have laboriously compared this project's home directory to that of a 'good' project but nothing stood out.

The project was created from a recently forked repo via

File > New > Project from Version Control > GitHub 

The project builds correctly, honoring my changes to the project build.gradle.

This question may have been asked elsewhere but remains unanswered, so I am re-asking it with additional information!

Any insights or new avenues to explore would be appreciated.

Update I have removed Versioning for this project and the problem persists. Have removed GitHub tag for this question.

like image 335
Bad Loser Avatar asked Feb 13 '18 00:02

Bad Loser


People also ask

Why is my Gradle not syncing?

It could be that you are using gradle in offline mode. To uncheck it go to File > Settings > Gradle , uncheck the Offline Work checkbox, and click Apply Make sure you have internet connection and sync the project again.

Where is build Gradle File in Android Studio?

The top-level build.gradle file, located in the root project directory, defines dependencies that apply to all modules in your project. By default, the top-level build file uses the plugins block to define the Gradle dependencies that are common to all modules in the project.

How do I open an existing Gradle project in Android Studio?

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 build Gradle?

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.


2 Answers

You can delete .gradle and .idea folders in your project manually and reload your project, it helped me.

like image 119
Acuna Avatar answered Oct 10 '22 08:10

Acuna


For me this worked fine.

      1. Close the project  using Close project option.
      2. Import the project newly from android studio.
like image 37
Thriveni Avatar answered Oct 10 '22 08:10

Thriveni