don't finish gradle build running - android

I had an Android project that transferred all the code and resources and files to a new project! But build gradle is still being processed when I want to run the project and apparently never wants to finish. My project has no errors..
Does anyone have a solution to this problem?
i set http proxy to none .
i cleaned project and tried again .
i invalid caches/restart and tried again.
But none of these ways helped..
I have to close the android studio from Task Manager. And then delete the contents of the crash folder from gradle and invalid caches/restart and clean project and after that, I will run the program, and with any error, all these things should be done
this is image link https://imgur.com/uVn8UMm

My problem Solved when i install new windows and new android studio ...
There may be a problem with my previous SDK

Related

Android Studio build error logs not shown correctly

I have a simple project and I remove some color resources from my file.
Expectations:
I build the project and it should fail. In the Build Output I should have the logs where it shows me the files where build fails. (Because the color resources are missing)
Reality (Android Studio 3.4.2):
I build the project and it fails. In the Build Output I see:
Android resource linking failed...
I navigate through all the failed tasks and none of them shows the proper logs.
Android Studio used to have this working properly. Does any one know any settings that maybe can fix what the Build Output shows?
I know that if I Analyze > Inspect code I can see the proper list of files where there are errors. But this takes time. I also know that running the build task in terminal it shows the files where there are errors. I want to have it like it used to be before.
I know that someone at Android Studio had one job and he didn't do it right but here I am for your help.
Try: Build -> Clean Project
That cleans the gradle file
Alternatively: File->Invalidate Caches / Restart
Then Sync Project with gradle files
Give these a go and see if it changes anything. It should start giving error for resource file.
This issue is fixed in Android Studio 3.5
Just in case:
Be aware of this issue: Android studio 3.5 refactor issue

Cannot resolve R in Android Studio, but app compiles just fine

I am using Android Studio 3.2.1. This error, where the R class is highlighted in red, says Cannot Resolve R, but the app builds and runs just fine, there are no errors in compilation, it just shows R as unresolved reference in the IDE.
This problem only happens in one project that uses Kotlin, and all the other projects open and work without any problems.
I went through most solutions in stackoverflow and that didn't solve the problem.
I'm using ubuntu and it works on other windows pc. Could there be a problem in ubuntu.
These are the solutions that I have tried
clean project
rebuild project
make project
invalidate cache and restart
sync project with gradle files
updating sdk files
updating dependency
recloning the project
checked all my xml files
Kotlin plugin was updated
snapshot
xml snapshot
The issue still persists. Please let me know if any other details are required.
Thanks.
Just try reinstalling it
Hope it works :)
this problem with the android studio itself try to clear cache and restart from file --> invalidate the cache and restart if still not working reinstall the android studio and open the project from the beginning

Gradle sync failed: Cause: startup failed (Basic functionality not working)

It is my first time to use android studio V 3.1.3
when i finished installation and trying to build this error is shown
it said that "Basic functioality not working correctly such as building and debugging "
i do not known how to solve it
i use a local gradle distribution like this
Then press on sync project with gradles files
but this error is still shown.
It works well but after that this error is happened
any help
Thanks in advance.
I also have the same problems as you,Now I have solved it.
The following are the steps to be solved
Exit Android Studio.
Delete the .gradle folder eg: C:\Users{userName}}.gradle
Restart androidStudio and wait a moment.
Have you tried
Android studio -> File -> Invalidate Caches/Restart -> Invalidate and Restart
Deleting the .gradle folder was unsuccessfull for me.
Still waiting for another solution.
you should go to settings > build,execution,Deployment > build tool > gradle
and the change the user gradle home that to path of environment variable of JAVA-HOME Address
Like this
and then change gradle JDK to Embedded JDK it will solve your problem

Gradle project sync failed?

When I started up my project this morning it randomly gave me a message saying Gradle project sync failed. Basic Functionality(eg. editing, debugging) will not work properly. in Android Studio. I looked at other answers that people had put up for this problem but they haven't been working. I invalidated my chaches/restarted my project but no luck. I also deleted my .gradle folder from my project folder and still no luck. If any of you guys could help me that would be awesome! This didn't happen yesterday when I was working on the project or anything, I wonder why its happening now. Oh yea it also says this as a gradle message: Error:C:\Users\Dave\.gradle\caches\2.2.1\scripts\settings_ad4t0wp5ikihzl1y1o83b5sbw\SettingsScript\buildscript\cache.properties (The system cannot find the file specified) :
Thanks again for anyone who reads this/ can help!
There is a file - "cache.properties" that gradle creates for you, upon first time inception of any project. The path for this file is "~Home_Directory\.gradle\2.2.1\taskArtifacts". You may find this path in your home directory. So basically, this file - "cache.properties" is missing from the "taskArtifacts" folder.
One of the solution that worked for me is to copy file - "cache.properties" from any test project of yours to this project that's currently experiencing an issue.
Regards
I had to choose using the Default Gradle Wrapper instead of local.
<< SETTINGS -->/ BUILD TOOLS --> Gradle --> radio button switch... >>
It has helped me to fix the same problem.
I had experience similar sync failed problem with gradle based android project (in Android Studio 1.1.0). I solved this problem without deleting .gradle from my user directory,
steps I followed was
Go to File -> Settings -> Compiler(Gradle Based Android Project)
Change VM options to -Xmx512m -XX:MaxPermSize=512m.
Click Apply -> OK and then tap on Try Again option in sync failed message to clean build the project.
Works like charm!!
UPDATE - 1 : For Android Studio 1.3, Compiler option mentioned in above Step-1 is present inside tab Build, Execution, Deployment.
I had faced similar kind of problem earlier!
But don`t know after rebuild the project and cleaning it, it worked normally.
Invalidate dependency cache by running
gradle clean build --refresh-dependencies
from project root and then re-import your project. Worked for me once.
May be you have put Android Studio into offline mode. To fix it, go to Preferences -> Gradle and ensure that the "Offline work" checkbox is not checked.
Than do
File -> Invalidate caches / Restart
Shutdown Android Studio
Rename/remove .gradle folder in the user home directory
Restart Android Studio let it download all the Gradle stuff it needs
android studio 0.4.2: Gradle project sync failed error
Delete the folder C:\Users\.gradle and reopening the android studio solved my problem

Gradle compiling old project

i am using android studio 0.9.2. I copied project folder(all folders projectname->.gradle,.idea,app,build,gradle and all files placed in this level) and renamed it and then in android studio i goto FILE-> CLOSE which close current opened project. Now i open again the project which i have copied. When i make some changes in code its not effecting compiler or debugger. I have debugged my code and found that my change in code does not take affect.
I have tried FILE->INVALIDATE CACHE AND RESTART and then check again but no luck. I have also closed my android studio and run it again but still i am facing same issue
I think its compiling old project which is last opened project.
Any help will be highly appreciated?
Try cleaning the project. There are three ways to achieve that:
via Menu: Build -> Clean Project
via gradle run gradlew clean
delete all the build directories in your project/modules
After that compile your project again (e.g. with the green play button) and you should be done.
I have a question. Is your gradle setting is in offline mode? Try turning it to online mode.
Also, just to add to above answer, Do you have any gradle dependencies with other project?
If so, also try cleaning those archives from your project folder within .m2 (maven) folder.

Categories

Resources