Gradle sync failed on first startup in Android studio 2.2.2 - android

It seem I'm struggled of this issue since last week because I couldn't find the same problem that I have on the internet...
My AMD Computer ran on windows xp first and trying to install the android studio 2.2.2 but I've got the problem says Incompatible Operating System so I decided to upgrade to windows 7 but I've got the same thing so I fully upgraded my computer to windows 10 pro 64 bit. Yes the issue has gone but sad to say that I've got a new problem.. Gradle stuck in
Gradle: Resolve dependencies 'app:_debugAndroidTestCompile'
. I've waited half an hour but nothing happen.
I've done checking some possible solution like gradle version and android studio plugin version but noting happen too.
so anybody knows whats going on in this version because in few months ago I am using older version of android studio but I don't get any problem like this...
Update:
Is this a normal duration of gradle synchronizing?

Have you tried deleting your gradle caches? I've found sometimes these get messed-up and deleting them seems to solve the problem.
Gradle cache locates at
On Windows: %USER_HOME%.gradle/caches
On Mac/Unix: $HOME/.gradle/caches/

have you tried updating the gradle version? How many dependencies do you have on your project? Maybe too much dependencies can cause slow actions.

I had a same issue. When I updated to 2.2.2 gradle sync begun to fail an run for 10+ mins. After a long digging through log files and gooogle search I found out it was caused by Comodo firewall blocking JCenter. After uninstalation of that traitor everything runs as before.

Related

Android Studio gradle build stuck at app:processDebugResources

I'm on Windows. I created a new project on Android Studio for Marshmallow at least.
The only thing I've done so far is generating the main activity which is a tabbed activity with view pager. Also, you should know that this project is a private git repo that I cloned.
I'm working on this project with another developer and the project is perfectly working on his side.
The problem is:
When I try to launch the app (wether it is a virtual device or my real phone), the gradle build gets stuck at the app:processDebugResources step. I waited more than an hour and nothing happened. Moreover, when I want to cancel the gradle build, it doesn't respond and I have to kill Android Studio process. Then I restart Android Studio and I have to kill a gradle process that prevents the initial gradle build (at Android Studio startup) from working.
The crazy thing is that I was able to launch the app before. I even installed it on my phone!
What I've tried so far:
Do what stackoverflow was giving as solutions like tick the offline mode in the settings
Create a new project --> It doesn't change anything
Reinstall Android Studio --> It doesn't change anything
Deactivating Avast antivirus
Invalidate cache/restart + Clean + rebuild (the rebuild gets stuck like when I try to launch the app)
And maybe other solutions that I forgot...
It's getting very annoying as it's making me lose days of development.
If you have any more solutions, or if you think I should try again some of the previous solutions, help would be greatly appreciated !
I know this is an old post, but I faced the same problem during the last few days and since i got crazy I hope I can help someone else out there.
After many hours of troubleshooting I found that the Java Platform SE binary executable goes in "suspended mode" in Windows 10, preventing Android Studio from compiling (it hangs at app:processDebugResources).
Example Screenshot
Killing the suspended process and recompiling the project works just fine... until Java gets suspended again.
Maybe your gradle version is not compatible with it. Try again with latest version of gradle in your project.
I did several things:
Install NDK
Change JDK from embedded one to Jdk 8
Redownload SDK i was using (6,7,8)
And now the problem is solved ! I have no idea which of these things made the tricks but I'm happy ! It may be useful to someone else one day.

Android Studio 2.3.1 | Gradle "AppName" project refresh failed

For 2 days I can't start coding my first android app, because of an issue with Android Studio 2.3.1.
There is many discussions about that out there, but non of them helped me so far.
I'm not able to use Run button for my app or even to edit the main_activity.xml file in the program window. Also the following error occurs when Android Studio starts running.
Screen shot of the error:
I'm workin' on Windows 7, 64bit, 8gb RAM, Java 1.8.0.121. Installed Android Studio 2.3.1 using android-studio-bundle-162.3871768-windows.exe file with no custom settings.
To solve the problem I've tried:
reinstall Android Studio
remove .gradle catalog
use File>>Invalidate Crashes/Restart
nothing helps.
Problem solved!
In my particular case the problem was caused by uncomplete Android Studio installation.
The reason of such an installation was Comodo AntiVirus
I noticed that there was some .bat files blocked during the installation. Comodo doesn't inform about it, but you can check it on blocked features list.
So I removed completely Android Studio, turned off all blocking functions in Comodo and quited it. Then installed AS once again.
Now it works fine. Ad least so far... Luckilly there's no Gradle error, so I hope there won't occur further problems.
Hope that this tip's gonna be helpful to somebody.
Have a good day folks!

Gradle Building Non-Stop

My Gradle building since yesterday My gradle has been building for more than 6 Hours now, I really have no idea of what is going on. Please help.
I tried to disable the proxy but it gives me this: Proxy Disabled
if you are working on android studio 1.5 then upgrade to version 2 because 1.5 takes more time for graddle building.

Gradle gets stuck at either 'build' or 'assembleDebug' when using the 64bit or 32bit version of Android Studio

The issue I've had over the past few months is that Android Studio would often get stuck on Gradle: build, as seen here. Android Studio itself would stay responsive but the build simply wouldn't progress. It also never generates any kind of error, so I can't really post any useful information. Once in a blue moon it might suddenly work, but nothing reliable.
Recently I found a post here on Stack Overflow where someone's Android Studio would get stuck on Gradle: build when he tried to create a new project, and he noticed that this issue didn't exist in the 32-bit version of Android. So I thought, why not try that. Turns out that building isn't an issue anymore, but assembleDebug is, when trying to build the application. As can be seen here.
Of course all these commands work flawlessly when run using command prompt and gradlew.
What I've tried so far:
Reinstalling Android Studio (including the removal of .AndroidStudioProject)
Upgrading Android Studio to the latest version
Removing any build files from projects
Creating completely new projects in Android Studio
Switching from 64-bit to 32-bit Android Studio
I'm running the latest version of Android Studio, using version 19.1.0 of the build tools, gradle v0.11+ and am on Windows 8.1.
Is there anything else I can try? This is starting to become seriously annoying. The last possible solution I can come up with is just doing a complete format and a fresh Windows installation.
I was experiencing the same problem, and the solution was very unexpected in my case: AVAST antivirus was somehow interfering with the Gradle:build process.
Deactivating this antivirus solved the problem!
Because there is no answer to this problem I will share, what I have done, to solve this issue. From what I have seen, the problem is that there is a dependancy(or many) from a maven repo that can not be loaded. So you have to take all dependacy one by one and check if exist on the maven repo.
For example I was having a dependancy for "org.jraf:android-switch-backport:1.3.1" from "http://JRAF.org/static/maven/2" that at that time could not be opened.
My build.gradle looked like this:
repositories {
mavenCentral()
maven {
url "http://JRAF.org/static/maven/2"
}
}
compile "org.jraf:android-switch-backport:1.3.1
For me, this problem occurred when I was USB tethering using an Android device. The first build took anywhere from 5-10 minutes, and every subsequent build took about 3-7 seconds. I found that by disabling USB tethering, the first build completed quickly (and so would all subsequent builds). After the first build completed, I could reenable USB tethering.
If you have a fresh Ubuntu 14.04 with Android Studio 1.5, you may be missing a library. Try this:
sudo apt-get install lib32z1
Another stack overflow answer
It happens 1 in 2 times for me. The hack that works for me is File->Exit and confirm exiting. Then a message shows up telling me that Gradle is running and then all of a sudden the screen to choose the device shows up. I Click NO and all goes well again.
Anyway, still a bummer, but I have not found an answer yet.
My problem was that the Android Sdk executables were missing the executable bit. You can check some of your binaries like /Sdk/build-tools//aapt to see if they have permission to execute. If not you can solve it by running this on the Sdk folder
chmod -R +x ./
If you are behind a proxy on ubunthu you might need to set your gradle system wide proxy:
sudo nano ~/.gradle/gradle.properties
And enter the following entries:
systemProp.http.proxyHost=<Your Host>
systemProp.http.proxyPort=<Your Host Port>

Downgrading Android Studio cause unrecoverable error

I recently attempted to upgrade my version of Android Studio, Android build tools and the Android Gradle Plugin to 0.6.1, 19.1.0 and 0.11.1, respectively.
That turned out to be a mess. So much has changed, especially with the location of output files, that it made my project completely barf. So now I want to downgrade back to 0.5.9, when everything worked and was fine, but I can't.
I get the message:
Error:Unable to load class 'org.jetbrains.plugins.gradle.model.ExtIdeaCompilerOutput' This is an unexpected error. Please file a bug containing the idea.log file
I've seen a few bugs in the google code forums about this issue, but no mention of any workaround.
I've tried completely wiping my previous install using this post,
And recloning my repo from a place that was known to work with AS 0.5.9 and gradle plugin 0.10.0, but no luck.
So currently I'm dead in the water. Any help would be appreciated.
The same thing just happened to me. Clearing the IDE's cache solved the issue
In Android Studio
File > Invalidate caches / restart...
What finally solved this for me was uninstalling, via the instructions in this post,
How to completely uninstall Android Studio?
and then installing 0.5.9 from scratch.

Categories

Resources