Android Studio - Sync Project With Gradle files - android-studio

Sync Project With Gradle files option in android studio is disabled for my android studio project, how can i enable this.?

I just got this problem and got the "Sync Project with Gradle files" re-enabled after I detach the Gradle link and then re-open the project.
To detach Gradle link:
Open Gradle Windows, from View -> Tool Windows -> Gradle menu,
Remove the project from that window with the (-) button,
Close project.
Reopen.
Hope this helps.

Open New->Import Project-> select your project and open it. Hope this will Help

Related

Android Studio Bumblebee: Gradle sync failed

After upgrading to Bumblebee, some of my projects now show this:
The specified Gradle installation directory '/Applications/Android Studio.app/Contents/gradle/gradle-2.14.1' does not exist.
How can I solved this issue? I have tried some old solutions (eg Android Studio - Gradle sync error on gradle-diagnostics-X.X.X.jar) and does not seem to work. Also tried clear cache and restart.
Go to Android Studio Preferences → Build, Execute, Deployment → Build Tools → Gradle.
Change the "Use Gradle from:" option from "Specified location" to your properties file.
(Screenshot provided by Mike)
Then, click "Try Again".

How to open Activity_main.xml on Android Studio

When I try to open the activity_main.xml I get Design editor is unavailable until a successful build.
I fixed it before by using the clean project and rebuild project but it does not work when I opened the file again. I tried the solutions found on this answer: Android studio design editor is unavailable until after a successful project sync but it didn't worked for me.
Go to the files, open folder res (resources), after press layout and finally there is the activity_main.xml.
Open your android studio and go to File and click on Sync Project with Gradle Files this will solve your problem. As cleaning your project and rebuilding it won't work unless you sync the project.
After the gradle has finish building, you can go to file menu and click on Sync Project with Gradle Files which is present here:

Android studio 4.0 project under android only show gradle files

android studio 4.0 project under android only shows gradle files.
In LHS side there is only gradle file in project->android section
Just delete the .gradle and .idea folders and then rebuild
Steps to resolve mention issue:
1.Click Edit Configurations()(Beside Build or Hammer Icon)
2.Remove unnecessary module then apply
3.Update gradle module(POPUP come when project start)
4.File->Sync Project with gradle files
5.Invalidate caches & Restart the Android Studio

Unknown Attribute Android: error on Android STUDIO 3.2.1

Things i have done to resolve this issue:
Clean Build & Rebuild
Deleted .idea file
Invalidated Caches/ Restart.. option
Turn On Power Save Mode.
SDk is up to date.
Sync Project with Gradle Files done.
Reinstall Android Studio done
recreate new project done
changed something in app Gradle file and synced the project again
android studio old version change also not help
Intellij shows to reset to default namespace, it will delete android namespace..
(In Project, Layout file corrections not reflecting into app)
Android Studio Version
Error Image
gradle image
Intelij Solution
This worked for me
Close Android studio
Delete all files from
C:\Users\.AndroidStudio3.2\system\caches
C:\Users\.AndroidStudio3.2\config //not importent
start android studio
Ran into the same issue. Seems to be something specifically related to Android Studio 3.2. My solution on Windows was to delete everything withing the cache/ folder in the .AndroidStudio3.2/ folder.
This problem happen for Android studio Cache & History.
Firstly In android studio go File -> Close Project and Exit Android Studio.
Then Delete below 2 Folders:
C:\Users\user-name.AndroidStudio3.X\system\caches
C:\Users\user-name.AndroidStudio3.X\config\terminal\history (optional)
Open the Android Studio and Enjoy!
Complete uninstall Android Studio (including system and cache files) and Reinstalling clears my bug...

Android Studio project files not showing up

I have a library project in Android Studio that has been working fine, but today I went to work on it and all of the files are missing except for a few git files. The folders/files are there when I look in the project's folder on my hard drive, they just aren't displaying in Android Studio. Here is a screenshot:
I tried reinstalling and updating Android Studio, but it didn't work. Any ideas as to what is going on here? How can I fix it?
Try Import Project... and navigate to your project. Select build.gradle file.
Be sure to wait for a while, so that android studios can load all your stuff. Sometimes a restart will help, but since you reinstalled it, that shouldn't be the problem.
Go to File > Project Structure > Project Settings > Modules.
Click on the green colored + and add new module. select Application module and set the content root to your project module.
Click next and then finish.
This should do the trick and the complete project structure will appear. It worked for me.
I had to Sync Project with Gradle Files in Android Studio to get my files back after they disappeared in Android Studio's Project window.
Go to
File > Project Structure> click on + > then set it to android
Go to:
File > Sync Project with Gradle files.
It will show up all the files linked with the gradle.
You can reset the IDE configurations by removing the configurations folder manually.
First close your project in Android Studio
In the project's root folder run:
rm -r .idea
Open your project again.
In my case i have a slash in the subproject
settings.gradle
As an example, this did not work:
include ":somedir/library"
But changing it to this fixed it:
include ":somedir-library"
project(":somedir-library").projectDir = new File(settingsDir, "somedir/library")
In my case, it was because of the NDK version
In my case only File -> Invalidate Caches / Restart... works.

Resources