location of gradle version in Android Studio - android

From where does the Android Studio picks the already downloaded gradle version ,There are three places where the gradle is visbile :
in the C:\Users\.gradle\caches\
in the C:\Program Files\Android\Android Studio\gradle\m2repository\com\android\tools\build\gradle
or if provided in the gradle -wrapper properties of the project. : distributionUrl=file:///c:gradle-2.14.1-all.zip
Same from where the Android Studio picks up the Android Plugin Version :
is it from C:\Program Files\Android\Android Studio\gradle\m2repository\com\android\tools\build\gradle
I wanted to know these to build the project offline and need to copy these things from one PC to another.

I think all version saved, are here:
C:\Users\Admin\.gradle
C:\Users\Admin\.gradle\caches

You can download gradle from https://gradle.org/install/
If you want to work offline extract it in your hard drive or you can also copy the files from caches.
Then follow these steps:
goto Files>Settings in Android Studio.
goto Build,Execution,Development>Gradle
choose your gradle path
See this image

Related

Unable to find bundled Java version, after update android studio

I have updated android studio, after that i am getting this error.
Unable to find bundled Java version.
unable to find bundle java version
for solving this error on mac just go to finder>Apllications>Android studio:
right click and click show package contents
open the folder of contents
create a new folder called jre
copy the contents of the jbr folder and paste them into jre folder
delete jbr folder
run flutter doctor your error is solved 😊
Try restarting the Studio, reinstall it or Invalidate Caches from File. I am sure one of it will work. The package could be missing in the update. If it doesn't work, open a issue at here
If Just kidding's answer does not work you can just reinstall Android Studio (don't forget to load the Flutter and Dart plugins) and it should be fine again.
My path to java was broken after updating AS to latest version (2020.3.1) and I had to fix it manually. Your issue seems related. Check your Android Studio -> Preferences -> Build, Execution, Deployment -> Build Tools -> Gradle and see if gradle jdk path is set correctly (to your java installation on your mac).

Download and install Android studio gradle offline

I have been having internet issues, so installing gradle for android studio has been a big issue, so I downloaded the zip file. However, I dont know how to install it offline and set Android studio to use the offline version. I need help.
1st open below link and download the latest complete version of Gradle
https://gradle.org/releases/
Now you find your path where your android studio install
then Find .gradle folder, normally gradle is present here...
C:\Users\**YourAccountFolder**\.gradle\wrapper\dists\
Now paste your .zip file in dists folder and Extract.
Now open android Studio Go to
File > Settings > Build, Execute, Deployment > Gradle >
Now in Dialog select Use Local gradle distribution and paste path of your folder where extract .zip file.
then apply and OK
now you can update your gradle(app) And Go to file, setting same as like above path and in dialog SELECT Offline work
Apply and Ok.
Download gradle zip file
Open the gradle-wrapper.properties file from your android project, path specified below
my-app\gradle\wrapper\gradle-wrapper.properties
Set the distributionUrl to point to the download zip location, for example
distributionUrl=file:///C:/Users/username/Downloads/Compressed/gradle-4.10.2-all.zip
Done!
Now build the project and Android Studio will install the gradle.
In June 2021 im using Android Studio 4.2.1 and I could enable gradle offline mode using the method outlined in the docs below.
https://developer.android.com/studio/releases#3.6-gradle-offline-ui
Common link for all versions of Android Studio depending on Platforms. Also options like with SDK or without SDK can be chosen.
All Downloads are offline Installers.
Download Studio from here

Cordova gradle wrapper missing in android sdk

I'm on windows7 x64, installed today's latest stable release of android sdk studio (through android studio bundle, since it's shipped together now apparently). I have properly configured the environment variables as you'll see above.
This is what I get when issuing the following command
$ cordova build android
ANDROID_HOME=G:\installs\Android\sdk
JAVA_HOME=C:\Program Files\Java\jdk1.8.0_121
Error: Could not find gradle wrapper within Android SDK. Might need to update your Android SDK.
Looked here: G:\installs\Android\sdk\tools\templates\gradle\wrapper
And indeed, the "templates" directory doesn't even exist in my sdk install.
I've already tried the suggestions (setting the right path, uninstall/reinstall) of this question here but nothing applies to my case, and I find that manually copying and pasting packages is not really a solution, since there's a package manager in place.
If anybody has an answer as of today's android install, would be very much appreciated.
If still not working then copy all file from gradle\wrapper from Android Studio installation folder
C:\Program Files\Android\Android
Studio\plugins\android\lib\templates\gradle\wrapper
and paste it in your Android SDK gradle\wrapper then run same command.
E:\android-sdk\tools\templates\gradle\wrapper
This is a known issue; see CB-12544. For now you'll need to downgrade.
I downloaded Android SDK r25 manually and placed templates folder inside Android/sdk/tools. This solved the issue for me.
You can get it from https://dl.google.com/android/repository/tools_r25.2.3-macosx.zip
For Windows:
https://developer.android.com/studio/index.html
Go to the section :"Get just the command line tools"
There is a link 'sdk-tools-darwin-3859397.zip' for Mac, Unfortunately that didn't have the templates folder with Gradle Wrapper. So for Mac users, i will suggest not to go for this zip.

Studio: Gradle project sync failed.

I tried some solutions but none of them helped.
I can't compile anything because of gradle's error:
Error:C:\Program Files\Android\Android Studio\gradle\gradle-2.8\native\jna\win32-amd64\jnidispatch.dll (System can't find this path)
In Settings I tried to check "Use default gradle wrapper (recommended)" but it comes back to "Use local gradle distribution" with path C:\Program Files\Android\Android Studio\gradle\gradle-2.8
I downloaded gradle 2.8 from the official site but there's no "native" directory.
I updated everything with SDK and restart Studio but it also didn't help.
Android Studio 1.5.1, it's the same with all projects, even the new ones.
How can I fix this?
I got the same problem when switch to another computer. It's because project is keeping the reference to another computer paths.
For fix it i did:
I deleted the .idea folder from the project, like the highlight from image bellow.
Then you have to remove the project from android studio and open it again.

Missing Gradle in Android SDK (using cordova + ionic)

Yep, i searched about this but nothing, just things about the ANDROID_HOME path, but in my case i don't think this is the real problem. When i try to do ionic build android i get this error:
Error: Could not find gradle wrapper within android sdk. Might need to update yo
ur Android SDK.
Looked here: C:\Android\sdk\tools\templates\gradle\wrapper
And found that in C:\Android\sdk\tools i dont have "templates" folder, just this:
I see gradle wrapper only in this path C:\Android\sdk\temp\ToolPackage.old01\templates\gradle\wrapper
Why i don't have Gradle in my sdk folder? i am missing something? in SDK manager i have this installed:
Thanks in advance
Had exactly the same problem. This thread points out the reason behind it, and this one actually shows what to do.
In short:
in Android Studio uninstall Android SDK Tools
Download tools_r25.2.3-yourOPsystem.zip from Android Downloads. Basicly same thing, older version.
insert downloaded extracted tools folder in Android/sdk/ folder
(MAC: /Users/username/Library/Android/sdk/tools
Win: C:\Users\username\AppData\Local\Android\sdk\tools)
In project folder run:
$ cordova platforms remove android
$ cordova platforms add android
On Linux android studio version-162.3871768-linux
copy paste
\Android Studio\plugins\android\lib\templates\
to Sdk/tools/
You need to update ANDROID_HOME variable to point the android-sdk folder
https://stackoverflow.com/a/32507036/344895
you have to upgrade your cordova library
cordova platform update android#6.2.1
I tested upgrade cordova to version 6.5 and extract tools SDK. Nothing helps.
In my case I have Android Studio installation.
SOLUTION: Please find file gradle-wrapper.jar in your Android Studio installation (in may case ..\Android Studio\plugins\android\lib\templates\gradle\wrapper\gradle\wrapper\ ). Then copy whole directory templates to SDK location in subfolder tools.
Set ANDROID_HOME to the SDK Path displayed in your Android SDK Manager. The default location is C:\Program Files (x86)\Android\android-sdk if you didn't change it.
go to https://developer.android.com/studio/index.html
cheak Download Option and download tools only
extact file and copy the templates folder
and paste in C:\Users(yourunername)\AppData\Local\Android\sdk\tools
update your sdk tools download tools_r25.2.3-yourOPsystem.zip.
[direct download link][1]
/Users/username/Library/android/sdk/tools
You cant find gradle in latest sdk. So try to install it manually. Follow this link
https://gradle.org/install

Categories

Resources