I have downloaded android studio and sdk and everything required but when I start a new project studio starts downloading gradle which is already downloaded with android studio. If I try to stop that download, it can't be stopped, I need to shutdown my laptop.
Please tell me why this happens!
And if I import any project then it shows a message that gradle build failed and tells me to install build tools API Level 7 which NOBODY uses now a days. What's wrong with this studio??
I am using Ubuntu 14.04, .gradle directory of my home folder has files of more than 300 Mb I don't understand what this android studio keeps downloading.
Please help me fixing this problem
That is normal one time download of maven gradle dependencies and packages. However it usually takes a long time to download and build. Not sure what are the reasons for this.
Android studio contains gradle essentials, but for some reasons that is insufficient to run command line tools.
There is a workaround to skip this download by adding gradle repo directory to android studio settings (Configure --> Settings --> Gradle). You have to manually add GRADLE_HOME to the system PATH variable according to your operating system. Run gradle-v in command line to confirm everything works right.
Related
I just upgraded my android studio version and gradle version to the new one as AS suggest me. But now every time I try to build my project gradle has this error:
Could not create parent directory for lock file /opt/android-studio/plugins/gradle/wrapper/dists/gradle-7.5-bin/f1w0cc9nuo0eivz97x2xlu9sv/gradle-7.5-bin.zip.lck
Of course it worked perfectly fine before upgrade and I didn't change anything manually in path or version used.
I know it's a permission error, but I tried to build it as sudo, it downloaded and installed correctly but once I went back to a normal user process, it can't recognize that gradle has already been installed on my system. I have this error
The specified Gradle distribution 'https://services.gradle.org/distributions/gradle-7.5-bin.zip' does not exist.
knowing I didn't change anything in my path or used version while swapping between sudo and normal user.
Does anyone know how to force AS to detect and use already installed gradle version?
One option will be to open Android Studio's settings:
Build, Excecution, Deployment > Build Tools > Gradle
and from there you can specify whether to use Gradle from gradle-wrapper.properties file or from a specified location. The latter should fit your needs.
Tested with AS Chipmunk and Dolphin.
I am using Android Studio 3.0.1 with default gradle version 4.1 on windows
but every time I start new project I have to change gradle home path as following image
my question is how I can make this path the default path for all new project
fixed with follwing steps
This usually happens when something goes wrong in Android Studio's
first launch (eg. system crash, connection loss or whatever).
To resolve this issue close Android Studio and delete the following
directory's content, necessary files will be downloaded on IDE's next
launch.
macOS: ~/.gradle/wrapper/dists
Windows: C:\Users\your-username.gradle\wrapper\dists
While downloading Gradle manually works, I recommend letting Android
Studio itself to do it.
got the answer from here
Error:Failed to open zip file. Gradle's dependency cache may be corrupt
I've downloaded Android Studio and using it for like a year, things get annoying when you repeatedly see gradle is being downloaded.
I have a built-in gradle distribution somewhere inside 'Android Studio.app'.
When I need to import a eclipse ADT project, it's downloading another gradle dist to
~/.gradle/wrapper/gradle-2.2.1-all/[WTFstring]/...
When I go to the project dir, and execute ./gradlew, again, it starts to download gradle.
And when I add ~/.gradle/wrapper/gradle-2.2.1-all/[WTFstring]/gradle-2.2.1/bin to
path, then execute 'gradle tasks' in the project dir, again, it's
again downloading gradle!!
Not sure if you have experienced something similar? This is really frustrating.
Enable offline mode in Android Studio to disable checking for updates everytime.
Go to Settings>Compiler>Gradle>Offline mode.
If this is enabled the gradle will be told not to connect to internet and check for updates.
I accidentally deleted some gradle files from where i Android studio is installed. I was following this tutorial to resolve another issue but it now even deleted some gradle files i cant even create a new project in Android studio. And cant build run or do anything. When i start android studio it shows me this error in following image:
If i open plugin manager it shows android support, cloud disabled like in this image:
In settings build tools it not does show gradle:
And in module settings it shows this:
Please someone guide me in this. I cant reinstall android studio, sdk and everything again as I have done many settings(installed plugins and git configs etc) in studio, so reinstalling everything is not an option. Any help?
One non-technical solution is to install another instance of Android Studio at different location on your system. You can then compare the directories of where where you deleted the files and copy over the files that are not there in your original installation.
My windows XP development environment has no internet access. So I need to install Android Studio without internet connection. (Formerly I used 1-2 months IntelliJ IDEA 12 for android development)
The steps I made:
I downloaded studio 0.2.x installation files from developer site (http://developer.android.com/sdk/installing/studio.html).
I downloaded JDK and installed.
I already installed Android SDK package installer, downloaded API files and installed that files by using this package installer. (http://siddharthbarman.com/apd/)
I tried to create new project. I get "gradle" error. It seems like gradle is bundled inside studio but because of error exists, I downloaded gradle-1.6.zip from their website. (http://www.gradle.org/downloads) I added gradle\bin to my PATH environment variable.
Then I still get new errors that maven is missing. It seems like I need to download maven but I even don't know the version.
Can you write step by step that how many more programs / libraries should I download to get Hello world from Android studio and Android emulator ?
Note: I download files from a machine that has internet connection, copy them to flash disk and move to my development machine.
There is no need to download Maven. Android Studio only uses Gradle. However, the first time you build your project, you'd need to have a internet connection so that the Android Gradle plugin and all its dependencies are downloaded and cached on your local disk. With an active internet connection, do:
$ cd /path/to/project
$ /path/to/gradle assembleDebug
Once that works, then you shouldn't need an internet connection.
Android Studio will eventually support such an offline mode.
Android Studio 0.4.0 now includes support for offline:
http://tools.android.com/recent/androidstudio040released
"You can now open the Compiler > Gradle options and enable Offline mode, which will tell Gradle to ignore update-to-date checks"
It doesn't work offline for creating new projects, so this is what I do and it works 100% offline!
Download Gradle and setup Environment variables
Create/Load project in Eclipse
File > Export
Select 'Generate Gradle build files'
Select project
Open AndroidStudio or IntelliJ13
Import project
Select 'Create project from existing sources'
Done!
But I preferred to use 'android create project' command, then setup 'build.gradle' file manually.