Gradle daemon is going into infinity loop after upgrading android studio to 4.2.1 - android-studio

This is the image of gradle daemon
This is the version of the android studio
and I have tried to change heap size in the gradle properties but it is not working.
I am really stuck on this issue because any project is not building and even when I was trying to build new project it is also not working.

I update to 4.2.1 on my Mac today, when I open up a project it starts an infinity loop of android studio windows of that project, had to hard restart my Mac.
The only way I was able to fix it, was by going back to 4.1.3.

For solving this problem in windows run this command in cmd.
setx _JAVA_OPTIONS -Djava.net.preferIPv4Stack=true
and this will work definetly.

Related

Newest Android Studio 2021.3.1.17 release gets stuck on launch screen

I've installed the newest version of Android Studio with the installer on my Windows 10, currently it's version 2021.3.1.17 Dolphin.
Upon launching it, the splash screen appears and the little bar loads to the end and then it gets stuck indefinitely on that screen. All I'm seeing is this:
I've tried the following stuff already:
Completely uninstalling Android Studio, making sure all the files have been removed correctly before re-installing it (except the JetBrains folder, since I have other JetBrains stuff in it)
Re-Downloading the installer from the official Android Studio Website to make sure it was not corrupted.
Run as Administrator.
Was previously installed on a non-primary drive D:/, and I've also tried installing it on my primary drive C:/ just in case, same issue with C:/ installation too.
Ran studio.bat to see any errors, however, I'm assuming that bat file itself is buggy. It tells me that it does not find any JRE or JDK installation within the path. So to fix it I've set the newest Oracle JDK19 as my JAVA_HOME and the /bin accordingly, however, the studio.bat will then continue a long java error which seems honestly unfixable, so I won't even bother posting it here. Me setting the path shouldn't even be necessary, as Android Studio comes bundled with a JDK... and it should be using that one anyway.
So I'm out of things to try. I cannot make it work. My only lead was the Java error, but according to some Google search, I shouldn't even have to deal with it as it comes bundled with Android Studio. Looking into the files, there is indeed a jre folder within the Android Studio installation. Is it not using that one? What could be the reason that it is not using it if that is the case?
So, I was able to fix it myself after trying a few hours more. I've had also other Java installations (Java JDK 8, JDK 19) that interfered somehow with Android Studio. I've uninstalled everything related to Android Studio and I've uninstalled every Java version I had.
Additionally, I've removed every reference to Java or Android Studio from all of my system and environment variables. Also removed a path to Android SDK that was within my system variables.
After rebooting and installing Android Studio, it worked. Haven't installed any Java version so far, so not sure if the issues will return if I install my Java versions again.

React Native Android No such property - logger for class DefaultProjectDescriptor

I am developing my app using React Native and now when I open the android project in Android Studio, during gradle sync it is throwing this error:
A problem occurred evaluating settings 'MyApp'.
No such property: logger for class: org.gradle.initialization.DefaultProjectDescriptor
Caused by: groovy.lang.MissingPropertyException: No such property: logger for class: org.gradle.initialization.DefaultProjectDescriptor
I tried installing yarn add react-native-unimodules but this won't resolve.
I am using NVM to used node version 14.17.3
Android gradle plugin version: 4.1.0
Gradle version: 6.8
Please help me resolving this as I am stuck on this since 2 days now.
I had the same problem I tried different node versions with nvm and also downgrade android studio but none worked for me. also, I tried installing node via homebrew. What I did was to start android studio using
open -a /Applications/Android\ Studio.app
The problem was that android studio couldn't find node so in this case starting with the above command fixed the problem for me and I used nvm
I was able to resolve this issue by fully shutting down my MacBook Pro and starting it up again. Once started I loaded my project in Android Studio once again and let the gradle build finish.
Fixed this by downgrading Android studio to version 4.1.3.
Before that I installed Node through NVM but it didn`t help
I encountered this exact error on a new MacBook M1 where I formerly used Java 8 with Rosetta (from the migration). After installing Zulu Java 8/11 with ARM-64bit support, I could not build the React Native App anymore.
I simply deleted the .gradle folder (e.g. in ~/.gradle) and executed the build command again. It downloaded Gradle from scratch and the build worked.
The real fix is stackoverflow.com/a/70891538/9878385
Run chmod +x /Applications/Android\ Studio.app/Contents/bin/printenv and this actually fixes the problem, rather than just working around the problem.
Check Android Studio for available updates
Android Studio -> Check For Updates
I have updated Android Studio and Tools to the latest version and this solved the problem. Currently I have Android Studio Chipmunk | 2021.2.1 (Build on April 28, 2022)
I was facing the same issue. It could be some problem with permissions on Android Studio installation.
This might help you to open the project without this error, but it doesn't definitively solve the problem. (Ubuntu linux)
cd App_Name/android/
android-studio .
I had same error using ReactNative and NVM. Installing NodeJS through package manager solved the problem. I guess NVM environment wasn't loaded in Android Studio environment.

Android Studio 3.6 : Unable to run apk on emulator or device

After Updating Android Studio to the version 3.6, I am unable to install an app directly to device by using Run button.
It just updates the gradle and shows gradle updated popup that's it.
I tried invalidating cache and recreating the emulator device but no luck yet.
Let me know if anyone could help as am creating APK and installing it manually in emulator.
I have installed the Android Studio 3.6 and suddenly existing project stopped running. I tried the following thing and it worked.
Android Studio -> Run -> Edit Configurations -> Installation options -> Select Nothing instead of Default apk.
I am not able to post this as comment, but maybe someone finds this info useful.
I faced same problem after updating Android Studio to 3.6.1 on Mac OS.
I tried to use gradle task for installing and launching my application and I found strange log in console about missing adb in platform-tools folder.
So, as result: after update folder platform-tools was moved into folder with same name (was: sdk/platform-tools become: sdk/platform-tools/platform-tools). I just move it manually back and everything is worked as a charm.
Hope it helps.
I have installed Android Studio 3.6 yesterday. I have tried both way to install APK.
Directly by Run button. [DEVICE - Working, Emulator - Working]
Generated APK, Drag and Drop to Emulator. (Its also working)
Hope It will work for you too. Just drag n drop APK file to emulator.
Bonus - May your emulator is older, You can update your Emulator from
SDK Manager and Create New.

Android Studio - Gradle build daemon disappeared unexpectedly

This ISSUE persists from last 3 to 4 days. I'm using Android Studio - 2.3.2. But in previous version I had same ISSUE. The whole ERROR is like below.
Error:Failed to complete Gradle execution.
Cause:
Gradle build daemon disappeared unexpectedly (it may have been killed or may have crashed)
Android Studio also crashes frequently.
When Android Studio crashes it gives ERROR like below.
I'm using Ubuntu 14.04 LTS.
What I have tried.
Installed new, latest and fresh Android Studio.
Made another folder for project work space and checked out latest project code from SVN.
Tried to CLEAN, REBUILD and RESTART Android Studio several times.
I think there should be some problem in Ubuntu but don't know how to solve it. Genuine help will be appreciated.

Finish can only be called once : Android

Recently updated Build: 2.3.1, AI-162.3871768, 20170401,
AI-162.3871768, JRE 1.8.0_112-release-b06x64 JetBrains s.r.o, OS Mac OS X(x86_64) v10.11.6 unknown, screens 1440x900; Retina
Switching back to Android 2.2.2 did not help either. Successfully able to build from command Line though(MacOX Terminal)
Delete your $HOME/.gradle directory (or on Windows, %HOME%\.gradle folder). The next execution of gradle will rebuild this. (It will require some downloads, so make sure you have an internet connection).
You can try just deleting $HOME/.gradle/caches, but this will not solve the problem in all cases.
I have similar issue on 2.3.1
I tried using the Android 2.4 Preview 4 but that did not help. I am able to build from command line too.
Android-Studio-2.3.1-Gradle-Sync
It happens when Android Studio creates two instances of gradle. I tried clearing the gradle cache or even deleting the .gradle but did not help. All this problem started when I deleted my old project repo and re-pulled it and imported to my Android Studio.
Best is to delete all your gradle instance from your home directly before your re-import your project Android Studio.
Android Studio started behaving like this after I tried building with the command line(osx) using ./gradlew
What helps is running the studio with sudo:
sudo /Applications/Android\ Studio.app/Contents/MacOS/studio
I wonder if theres a fix to this problem that allows the studio to be started normally as well.

Resources