Android Studio can never download fastutil-7.2.0.jar - android

Similar question: Android studio gradle stuck at Fastutil.7.2.0.jar
When I'm building my first Android App in Java, Android Studio 4.0 is always complaining:
Could not GET 'https://jcenter.bintray.com/it/unimi/dsi/fastutil/7.2.0/fastutil-7.2.0.jar'. Received status code 400 from server: Bad Request
Enable Gradle 'offline mode' and sync project
However, it's possible to download the jar with the browser.
If I remove jcenter()in build.gradle, a similar error occurs:
Could not HEAD 'https://dl.google.com/dl/android/maven2/org/jetbrains/kotlin/kotlin-stdlib-jdk8/1.3.72/kotlin-stdlib-jdk8-1.3.72.pom'. Received status code 400 from server: Bad Request
Enable Gradle 'offline mode' and sync project
This file doesn't even exist.
I tried modifying build.gradle or setting up proxy, but neither works.
gradle.build file:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath "com.android.tools.build:gradle:4.0.0"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
UPDATE:
Solved. Proxy's fault. Check C:\Users\USERNAME\.gradle\gradle.properties.

Make sure you have installed Command line tools
if not install from
sdk manager > sdk tools > check command line tools and apply

Related

Gradle 'MyApplication' project refresh failed in android studio 2.3.2

Error: Access is denied
I have recently installed Android Studio and I am running it from behind my organisation proxy. I have gone through 100 of links for this problem and I am not able to find the solution.
What I have done till now :
In gradle.properties I have written following lines
systemProp.http.proxyHost=sy*********om
systemProp.http.proxyPort=80
systemProp.http.proxyUser=RAGU
systemProp.http.proxyPassword=W********
systemProp.http.auth.ntlm.domain=*****om
systemProp.https.proxyHost=sy**********om
systemProp.https.proxyPort=80
systemProp.https.proxyUser=RAGU
systemProp.https.proxyPassword=W********
systemProp.https.auth.ntlm.domain=*****om
In Project Structure in JDK location I have entered the location of my jdk ie. C:\Program Files\Java\jdk1.8.0_66 instead of using the embedded JDK.
My build.gradle :
// Top-level build file where you can add configuration options
common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.2'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
My logs
you can see the logs via this link : https://drive.google.com/open?id=0B7ZLoWnEHDkac2thbXRTNEduTkZPSkFYNW56UVV3UzhmZ3NZ
Whenever I try to sync the gradle this error pops up . What can I do to resolve this error.
I had very ugly issues with gradle wrapper and gradle-wrapper.properties until i found this Gradle proxy configuration. I tested it and it worked like a sharm.The command was this
gradle -Dhttp.proxyHost=proxy -Dhttp.proxyPort=3128 -Dhttp.proxyUser=username -Dhttp.proxyPassword=password -Dhttps.proxyHost=proxy -Dhttps.proxyPort=3128 -Dhttps.proxyUser=username -Dhttps.proxyPassword=password wrapper
I ran it in the Android Studio terminal with Windows proxy disable.My PC is running on Windows 10 x64 VersiĆ³n 10.0.16299.15 with Android Studio 3.0.1
I hope this help you out there.Happy new year!!

Failed to apply plugin Android Gradle plugin 3.0.0-alpha5 must not be applied to project

Using the latest Android Studio 3.0 Canary 5
Here's the error:
Error:(1, 1) A problem occurred evaluating project ':app'.
Failed to apply plugin [class 'com.android.build.gradle.api.AndroidBasePlugin']
Android Gradle plugin 3.0.0-alpha5 must not be applied to project [path_to_my_project] since version 3.0.0-alpha5 was already applied to this project
Tried: cleaning, rebuilding, opening/closing. Not working.
any ideas ?
[LATER EDIT]
Solution: Migrate to Canary 8+ and all should be ok.
From this reddit thread, killing daemons fixed the problem for me.
./gradlew --stop
This worked for me:
Deactivate Configuration On Demand
In gradle.properties:
org.gradle.configureondemand=false
Then stop the daemon in a terminal window:
gradlew.bat --stop
Now everything works again.
Versions used:
Android Studio 3.0 Canary 5
gradle: gradle-4.1-milestone-1
android gradle plugin: com.android.tools.build:gradle:3.0.0-alpha5
UPDATE
After upgrading to Android Studio 3.0 Beta 2 I can reactivate Configuration on Demand and everything works fine.
Migrating the gradle version from 3.0.0-alpha5 to 3.0.0-alpha7 saved my day !!
I got the issue and realized the issue related with caches.
You have to invalidate caches of Android studio by select File-> Invalidate Caches/Restart.
It worked for me. The issue was resolved.
Open a terminal and write
./gradlew --stop
In gradle.properties make sure you don't have funny stuff
Notice that there are no custom jvmargs...
org.gradle.daemon=true
org.gradle.parallel=true
org.gradle.configureondemand=false
Include the google() repo in build.gradle (project one)
there's how mine look like
build.gradle
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
google()
maven { url "http://objectbox.net/beta-repo/" }
}
dependencies {
classpath 'io.objectbox:objectbox-gradle-plugin:0.9.12.1'
classpath 'com.android.tools.build:gradle:3.0.0-alpha5'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
maven { url 'https://jitpack.io' }
jcenter()
google()
maven { url "http://objectbox.net/beta-repo/" }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
lastly the support library versions in the app build.gradle file
build.gradle
...
//----- Support Libs
implementation 'com.android.support:appcompat-v7:26.0.0-beta2'
implementation "com.android.support:design:26.0.0-beta2"
implementation "com.android.support:recyclerview-v7:26.0.0-beta2"
implementation "com.android.support:cardview-v7:26.0.0-beta2"
...
I had the same issue, I closed Android Studio and opened again, I noticed that it automatically applied these changes to the following files and everything worked fine:
build.gradle: changed the class path of Gradle from:
dependencies {
classpath 'com.android.tools.build:gradle:2.3.1'
}
to
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0-alpha5'
}
gradle-wrapper.properties: from
distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip
to
distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-milestone-1-all.zip
I already tried all the solutions including
Clean,
Rebuild,
Invalidate Project
But nothing is working but i figured it out.
For temporary just downgrade your gradle plugin version to stable version
classpath 'com.android.tools.build:gradle:2.3.2'
Replace your alpha line with this line. And have fun.. :)

Android Studio 2.2.3 Gradle Build Running Stuck

I download android studio 2.2.3 and load my project. But Gradle Build Running Stuck. It continuously shows that and i am not able to run my app. what is the issue can any one help me with that?
Executing tasks: [:app:generateDebugSources, :app:generateDebugAndroidTestSources, :app:mockableAndroidJar, :app:prepareDebugUnitTestDependencies]
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
classpath 'com.google.gms:google-services:3.0.0'
}
}
allprojects {
repositories {
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
If you are behind a proxy, create a gradle.properties file next to your build.gradle file with this :
systemProp.http.proxyHost=YOUR_PROXY
systemProp.http.proxyPort=YOUR_PORT
systemProp.http.proxyUser=USERNAME
systemProp.http.proxyPassword=PASSWORD
systemProp.https.proxyHost=YOUR_PROXY
systemProp.https.proxyPort=YOUR_PORT
systemProp.https.proxyUser=USERNAME
systemProp.https.proxyPassword=PASSWORD
systemProp.http[s].proxyUser and systemProp.http[s].proxyPassword are not required if you don't need to login for your proxy. In such a case, remove these lines.
Make sure you have a internet connection.
If you have it , so maybe android studio couldn't download classes from Jcenter. So you have to force android studio to download classes from other resource like Maven.
To do that open gradle.build file and change the two jcenter() text with mavenCentral() ("C" in maven"C"entral() must be typed in uppercase) and try syncing with gradle again.
You don't need to do that every time you open your project. Just do this every time you create a new project in Android studio.
Solutions:
1. update your Build tools.
2. Reinstall sdk.
In my case, all the executable ".exe" files in "sdk\build-tools\25.0.3" folder were corrupted by virus. solution 2 worked for my perfectly. :)

Jenkins Android Gradle build time download error

Linux environment using jenkins android gradle project to build an error
* What went wrong:
A problem occurred configuring project ':app'.
> Could not download glide.jar (com.github.bumptech.glide:glide:3.7.0)
> Could not get resource 'https://jcenter.bintray.com/com/github/bumptech/glide/glide/3.7.0/glide-3.7.0.jar'.
> Could not GET 'https://jcenter.bintray.com/com/github/bumptech/glide/glide/3.7.0/glide-3.7.0.jar'.
> repo.jfrog.org: unknown error
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
I tried to use the wget way to download the link will prompt an error, then I use the sudo way to download the link successfully. So, how can I make jenkins gradle also use the sudo download, or use other solutions
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.1'
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
classpath 'me.tatarka:gradle-retrolambda:3.2.5'
classpath 'me.tatarka.retrolambda.projectlombok:lombok.ast:0.2.3.a2'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
// Exclude the version that the android plugin depends on.
configurations.classpath.exclude group: 'com.android.tools.external.lombok'
}
allprojects {
repositories {
jcenter()
mavenCentral()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Please help me, thanks.
You can try upload your local library (in user/.gradle/caches) to Jenkins server, It 's work for me.
I don't think that run the build with super user rights is a good solution, because it's not seems to be possible to resolve dependencies.
Just a suggestion how to solve it: Gradle has it's own local cache for dependencies and doesn't need to download them on every build. So you may use the same Gradle distribution, which is used by Jenkins, and once build your application manually with su rights, to resolve all dependencies and cache them.
Just to note, by default dependencies with dynamic versions are cached for 24 hours only, as it's said in the official docs, but you can change it as:
configurations.all {
resolutionStrategy.cacheDynamicVersionsFor 10, 'minutes'
resolutionStrategy.cacheChangingModulesFor 4, 'hours'
}

Jenkins with Android Gradle Could not resolve com.android.tools.build:gradle:1.3.1

I am having trouble setting up an Android project on Jenkins using the Gradle plugin. I am getting the following error message:
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'tablet_optimizations'.
> Could not resolve all dependencies for configuration ':classpath'.
> Could not resolve com.android.tools.build:gradle:1.3.1.
Required by:
:tablet_optimizations:unspecified
> Could not resolve com.android.tools.build:gradle:1.3.1.
> Could not get resource 'https://jcenter.bintray.com/com/android/tools/build/gradle/1.3.1/gradle-1.3.1.pom'.
> Could not GET 'https://jcenter.bintray.com/com/android/tools/build/gradle/1.3.1/gradle-1.3.1.pom'. Received status code 403 from server: Forbidden
This is pulling a repo from SVN through a proxy, both of which seem to be set up properly. But maybe that could be an issue here. I am also pointing towards Gradle 2.4 for this project. I have seen a few issues similar to this on here but nothing seems to be helping. I will update with any additional info if needed! Please Help!!! Thanks!
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.3.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
You are getting a 403 error.
Status code 403 responses are the result of the web server being
configured to deny access, for some reason, to the requested resource
by the client.
I had the same issue, because I was behind a firewall that just didn't allow the repository site.
Also your build.gradle should look like this:
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.3.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
Okay, so this turned out to be an issue getting through the proxy. The error message was a little misleading and made me believe this was a Gradle issue. I will post my config below in hopes it will help someone.
In the Manage Jenkins/Configure System page create a new "Environment Variable" under the "Global Properties" section:
name: GRADLE_OPTS
value: -Dhttp.proxyHost=<your proxy> -Dhttp.proxyPort=<your port> -Dhttps.proxyHost=<your proxy> -Dhttps.proxyPort=<your port> -Dorg.gradle.java.home=<your path to java jdk>
Maybe this can help someone with a similar issue!

Categories

Resources