Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Project isn't linked with Gradle

I'm trying to run google firebase example but got an "Project isn't linked with Gradle" error when opens gradle file. Also files visible only in "project-veiw". It looks it because projet use gradle.kts. How i need to set it up to make project working?

enter image description here

like image 583
Siarhei Avatar asked Oct 13 '18 15:10

Siarhei


People also ask

How do I link a Gradle project?

Open the Project pane from the left side of the IDE and select the Android view. Right-click on the module you would like to link to your native library, such as the app module, and select Link C++ Project with Gradle from the menu.

Why is my Gradle not syncing?

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

I had similar issue.

I have Added empty build.gradle file in the root of the project that uses Gradle Kotlin DSL (projects may use build.gradle.kts for config, however empty build.gradle file is required by grade to function correctly)

Update:

You should also add this line to settings.gradle.kts file:

rootProject.buildFileName = "build.gradle.kts"

like image 128
Igor Avatar answered Sep 17 '22 13:09

Igor