I'm trying to execute the "Hello World" example from Android Studio but I get this error
Android Studio: 1.5.1
Gradle: 2.12
Apache Ant: 1.10.3
I have no admin privileges and I'm under a proxy (I got the configuration IP, user/pass correctly added in the settings section).
Here are some screenshots.
Thanks in advance for your help!
Old configuration, old Android studio. Update to the newest official one:
Android Studio: 3.1.2, Gradle: 3.1.2
Also edit the file gradle-wrapper.properties and change the url to this:
distributionUrl=https://services.gradle.org/distributions/gradle-4.4-all.zip
And delete all directory versions of gradle in the directory .gradle\, like .gradle\4.1, .gradle\2.12, and so on.
After that, try to sync your project again and clean+rebuild the whole project.
Related
I am importing constraint-layout-start to android studio 3.0. I have kept in androidstudioproject folder that's the the path where all my android studio projects are stored. after importing its showing connection reset error. Here is the log file link: https://drive.google.com/file/d/1W1mGmIc67baZb4C5nGGecWm15ggB0Wp5/view?usp=sharing
i have all the SDK installed. tried to manually change the sdk verion to 21 which was running perfectly for my other projects, but here it didn't work.
i checked all the files are okay, i am not getting why this error occurs.
images of gradle page are given below.
build.gradle
gradle
Add google repository to your gradle file:
repositories {
maven()
//other repositories...
google()
}
Try to download from SDK manager:
SDK Manager Android Studio
Check your gradle and plugin version:
https://developer.android.com/studio/releases/gradle-plugin.html#updating-gradle
For Android studio 3.0.0
required Gradle version: 4.1
File > Project Structure > Project
required Build Tools 26.0.2
For Android Studio 3.4 Canary 8
Hope it will helpful!
Go To File>Settings>Build, Execution, Deployment>Gradle
and set your Android studio local gradle path like below image
i solve this problem in this way. be careful it causes with different problems like using proxy, dns connection windows , fire wall block , ....
anyway, i use proxy in file/settings/proxy in android studio and after that i set no proxy. after that whenever use kerio vpn or cisco gradle didnt work.
solution :open gradle.properties and remove every proxy script from there and sync gradle and work fine
I am using android studio for my android projects.I just got a problem when i imported an android studio project.The problem is that gradle is downloading wrapper 2.4 and i have 2.1.0. Is there a way to use older version by changing setting. I searched about it but i didn't find solutions specific to the problem.what i got is
How to set gradle home while importing existing project in Android studio
How to use gradle zip in local system without downloading when using gradle-wrapper
In my case, i don't have version 2.4 and want to use existing 2.1.0
Try to change the distributionUrl values with your currently version (2.1.0) and then :
./gradlew clean assemble
Remove .idea folder and all .iml files and import the project
as new one.
check this answer too:
https://stackoverflow.com/a/22366006/4409113
And: Force Android Studio to download and install gradle 1.10 or 1.1
Is it possible to build a crosswalk-cordova app inside of android studio?
It looks like you need to use ANT at this point.
Does anyone know if this is on the roadmap now that android studio is out of beta?
Our team just built an android wear app so we need to use android studio to create a build and we'd like to start using crosswalk.
I put together some instructions here: https://diego.org/2015/01/07/embedding-crosswalk-in-android-studio/
You can do this with gradle by adding the maven repo:
repositories {
maven {
url 'https://download.01.org/crosswalk/releases/crosswalk/android/maven2'
}
}
And then the version of crosswalk that you want:
compile 'org.xwalk:xwalk_core_library:10.39.235.15'
Sample Code: https://github.com/dougdiego/CrosswalkDemo
I was able to get this working. You need to re-arrange the project structure a bit and use "modules" I created a CordovaLib module and a xwalk_core_library module both "Android Libraries" and i referenced CordovaLib from my main project and set xwalk_core_library as a dependability for cordovalib.
Make sure to create the xwalk_core_library under the package name org.xwalk.core.
See screen shot for project stucture and the xwalk_core_library gradle file.
Put the .so files into a jniLibs directory and the android build correctly packages them into your app.
I followed this article to help with building. I plan on setting up seperate builds for x86 and arm.
http://ph0b.com/android-studio-gradle-and-ndk-integration/#mygradlefile
I have this working in this github project. Let me know if you run into any issues.
https://github.com/twilly86/CrossWalkAndroidStudio
In my case, the project with cordova android platform version 4.1.1 (For example Cordova CLI version 5.2.0) works, the Android Studio can build the project.
However, the project with cordova android platform version 5.1.1 (For example Cordova CLI version 6.2.0) has the issue, the Android Studio can not build the project because the Gradle sync brings the error such as
exception during working with external system: ndk
The critical difference between 4.1.1 and 5.1.1 is the build.gradle file.
In 4.1.1 the build.gradle file choose appropriate gradle version and android plugin version. (like gradle version 2.2 and plugin version 1.0.0+).
In 5.1.1 the build.gradle file does not do such a thing.
I fix this issue by manually setting the gradle version to 2.2 and plugin version 1.0.0. This can be done in the Android studio by opening the dialog
File > Project Structure > Project.
I have a project that was originally from IntelliJ.
I followed the instructions below.
http://tools.android.com/tech-docs/new-build-system/migrating-from-intellij-projects
I'm not sure what to do next. When I load my project in Android Studio it still asks if I want to migrate to gradle. What did I miss?
I am able to use Gradle in the command prompt to build my project, so I assume I just need to tell Android Studio to use Gradle instead of Ant.
I next imported my existing project and it recognized it as a gradle project. I also had to change the gradle version in the gradle.build file to work with the newer version of Android Studio.
Just updated Android-Studio to version 0.2.7 an now I get the error message from the title:
In the log window there is link to the grade setup:
No matter which option I use the error message stays the same.
I deleted my ~/.gradle directory and projects **/.gradle directories.
It seems that nothing helps.
Nitpick: compile on the command-line using \opt\gradle\1.6\bin\gradle.bat build works fine.
Go to Preferences > Project Settings > Gradle and choose "Use gradle wrapper" instead of the bundled option
Open your gradle-wrapper.properties and change the distributionUrl to use 1.7 if it is not already (mine was 1.6), i.e. distributionUrl=http\://services.gradle.org/distributions/gradle-1.7-bin.zip
I managed to fix my project through some combination of invalidating Android Studio cache, deleting .idea and .gradle directories and .iml files, restarting Studio, and reimporting the project:
on Mac OSX using Homebrew, brew install gradle then pick local gradle distribution and point to /usr/local/Cellar/gradle/1.7/libexec for gradle home:
You do not want to manage gradle at a system level, it is better handled per project. Android Studio projects already setup gradle wrapper handling when creating new projects but if you have an older one you can add the same file that Android Studio does. Think of this as an gradle bootstrap file that will download the correct gradle version per project. You can also read up on Gradle Wrapper and generate a shell script called gradlew that will provide gradle-free bootstrapping.
In gradle/wrapper/gradle-wrapper.properties in your project directory make sure you have:
#
#Tue Oct 08 13:40:54 CEST 2013
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=http\://services.gradle.org/distributions/gradle-1.7-bin.zip
Then when you go into Gradle you can set it to use the gradle wrapper. This is the default when creating new projects in Android Studio.
There are at least three approaches to migration or adding Gradle properly and using the new project structure Google and Android Studio has introduced.
Create a new project and copy over the code
Export from Eclipse to Gradle (deprecated)
Import code into Android Studio (recommended)
Try to manually get everything in order by creating the correct gradle files and reorganizing the project.
For now I'm copying the files over to a new project until the tools get a bit better.
We have two computers, one of which gave that same message after upgrading to Android Studio 0.2.7. We noticed that the computer which could still build had Gradle installed independently of Android Studio.
Installing Gradle 1.6 downloaded from the Gradle web site fixed this issue on the computer that wouldn't build.
My fix was basically what Abe did but I wanted to give a bit more explanation:
Download gradle 1.6 from the gradle website
Extract somewhere on your pc/mac
Open up android studio, go to Preferences -> Gradle (left panel) -> and chooose Local gradle distribution.
Point Gradle home to the location where you extracted gradle.
This fixed the issue for me. Using the gradle wrapper and the bundled gradle distribution both failed
In my case, i updated gradle to the latest version (1.8) and then changed the gradle.build files (for my project and for the libraries i was using) like these:
dependencies {
classpath 'com.android.tools.build:gradle:0.6.1+'
}
The Synchronize files and Refresh/Invalidate cache. This seems to solve the problem. I think that Gradle in order to determine the minimum required version just reads the above value.
Here's what I did to get my project working:
Installed Gradle 1.7 on my OS (OS X users can use brew for this)
Added this to my local.properties file: sdk.dir=/Applications/Android\ Studio.app/sdk
Created gradle wrappers with gradle wrapper command.
Chose "Use gradle wrapper (recommended)" option in Android Studio.