How to download gradle manually? - android

I'm using Android Studio version 1.4 and stuck at "Gradle: resolve dependencies ':app:_releaseCompile'"
I think it cause by proxy (I don't have access to proxy) so i want to know how to download gradle maunally
I've tried all method that I found changing properties file, edit parameters but won't work anyway.
Error log:
Error:A problem occurred configuring project ':app'.
>Could not resolve all dependencies for configuration ':app:_debugUnitTestCompile'.
> Could not resolve junit:junit:4.12.
Required by:
prototype1:app:unspecified
> Could not resolve junit:junit:4.12.
> Could not get resource 'jcenter.bintray.com/junit/junit/4.12/junit-4.12.pom'.
> Could not GET 'jcenter.bintray.com/junit/junit/4.12/junit-4.12.pom'.
> Connection to jcenter.bintray.com refused

Related

Cordova Android Build Issue: Could not HEAD '...packages...' > Socket Closed error

I cannot get a cordova app to build. Below you can see the stack trace:
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'android'.
> Could not resolve all files for configuration ':classpath'.
> Could not resolve org.ow2.asm:asm-analysis:6.0.
Required by:
project : > com.android.tools.build:gradle:3.2.0
> Could not resolve org.ow2.asm:asm-analysis:6.0.
> Could not get resource 'https://maven.google.com/org/ow2/asm/asm-analysis/6.0/asm-analysis-6.0.pom'.
> Could not HEAD 'https://maven.google.com/org/ow2/asm/asm-analysis/6.0/asm-analysis-6.0.pom'.
> Socket closed
> Could not resolve org.ow2.asm:asm-analysis:6.0.
> Could not get resource 'https://jcenter.bintray.com/org/ow2/asm/asm-analysis/6.0/asm-analysis-6.0.pom'.
> Could not HEAD 'https://jcenter.bintray.com/org/ow2/asm/asm-analysis/6.0/asm-analysis-6.0.pom'.
> Socket closed
Anyone have any ideas? I'm not being blocked by a firewall and I'm not behind a proxy. I can't find any resources that help point to why these dependencies won't resolve.
Any help is greatly appreciated. Thanks.
EDIT: I tried a cordova clean and am having a similar issue, just a different package starts off the error stack trace:
$ cordova clean
Android Studio project detected
ANDROID_HOME=/Users/[my user folder]/Library/Android/sdk
JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_181.jdk/Contents/Home
Subproject Path: CordovaLib
Subproject Path: app
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'android'.
> Could not resolve all files for configuration ':classpath'.
> Could not download gradle-api.jar (com.android.tools.build:gradle-api:3.2.0)
> Could not get resource 'https://maven.google.com/com/android/tools/build/gradle-api/3.2.0/gradle-api-3.2.0.jar'.
> Could not HEAD 'https://maven.google.com/com/android/tools/build/gradle-api/3.2.0/gradle-api-3.2.0.jar'.
> Socket closed
> Could not download sdklib.jar (com.android.tools:sdklib:26.2.0)
> Could not get resource 'https://maven.google.com/com/android/tools/sdklib/26.2.0/sdklib-26.2.0.jar'.
> Could not HEAD 'https://maven.google.com/com/android/tools/sdklib/26.2.0/sdklib-26.2.0.jar'.
> Socket closed
> Could not download repository.jar (com.android.tools:repository:26.2.0)
> Could not get resource 'https://maven.google.com/com/android/tools/repository/26.2.0/repository-26.2.0.jar'.
> Could not HEAD 'https://maven.google.com/com/android/tools/repository/26.2.0/repository-26.2.0.jar'.
> Socket closed
> Could not download jetifier-processor.jar (com.android.tools.build.jetifier:jetifier-processor:1.0.0-alpha10)
> Could not get resource 'https://maven.google.com/com/android/tools/build/jetifier/jetifier-processor/1.0.0-alpha10/jetifier-processor-1.0.0-alpha10.jar'.
> Could not HEAD 'https://maven.google.com/com/android/tools/build/jetifier/jetifier-processor/1.0.0-alpha10/jetifier-processor-1.0.0-alpha10.jar'.
> Socket closed
I found the solution to my problem.
The gradle version the cordova app I'm running is on gradle version 3.0.1 which expects the ndk to have a specific folder in it, that provides some deprecated tooling. An answer in this stack overflow fixes that problem: Error: No toolchains found in the NDK toolchains folder for ABI with prefix: llvm
In addition, the repo lines in the gradle files needed updated to include google() in order to find all the dependencies, making it include all of the following :
mavenCentral()
google()
jcenter()
after that, the project built fine. Probably need to update the gradle version so I don't have to make deprecated stuff work. :/

project build failed in android studio

while I installed android studio I faced so many errors! the last one is in building the project and I got this error I don't know how to fix it:
Error:A problem occurred configuring project ':app'.
Could not resolve all dependencies for configuration ':app:_debugAndroidTestApkCopy'.
Could not resolve org.hamcrest:hamcrest-library:1.3.
Required by:
MyApplication:app:unspecified > com.android.support.test.espresso:espresso-core:2.2.2
Could not resolve org.hamcrest:hamcrest-library:1.3.
Could not get resource 'https: //jcenter.bintray.com/org/hamcrest/hamcrest-library/1.3/hamcrest-library-1.3.pom'.
Could not GET 'https: //jcenter.bintray.com/org/hamcrest/hamcrest-library/1.3/hamcrest-library-1.3.pom'.
jcenter.bintray.com
Could not resolve org.hamcrest:hamcrest-integration:1.3.
Required by:
MyApplication:app:unspecified > com.android.support.test.espresso:espresso-core:2.2.2
Could not resolve org.hamcrest:hamcrest-integration:1.3.
Could not get resource 'https://jcenter.bintray.com/org/hamcrest/hamcrest-integration/1.3/hamcrest-integration-1.3.pom'.
Could not GET 'https: //jcenter.bintray.com/org/hamcrest/hamcrest-integration/1.3/hamcrest-integration-1.3.pom'.
jcenter.bintray.com

react-native-git-upgrade not working

I just tried to run react-native-git-upgrade by following the documentation here. After running the upgrade, I then tried to start my project using react-native run-android but got the following errors (see below).
I also tried to follow the "Alternative" way of upgrading from that documentation but eventually ended up with the same error shown below.
How should I proceed to get the upgrade working properly?
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring project ':app'.
> Could not resolve all dependencies for configuration ':app:_debugApkCopy'.
> Could not resolve com.facebook.fresco:fresco:1.0.1.
Required by:
OrderEntry:app:unspecified > com.facebook.react:react-native:0.43.3
> Could not resolve com.facebook.fresco:fresco:1.0.1.
> Could not get resource 'https://jcenter.bintray.com/com/facebook/fresco/fresco/1.0.1/fresco-1.0.1.pom'.
> Could not GET 'https://jcenter.bintray.com/com/facebook/fresco/fresco/1.0.1/fresco-1.0.1.pom'.
> jcenter.bintray.com
> Could not resolve com.facebook.fresco:imagepipeline-okhttp3:1.0.1.
Required by:
OrderEntry:app:unspecified > com.facebook.react:react-native:0.43.3
> Could not resolve com.facebook.fresco:imagepipeline-okhttp3:1.0.1.
> Could not get resource 'https://jcenter.bintray.com/com/facebook/fresco/imagepipeline-okhttp3/1.0.1/imagepipeline-okhttp3-1.0.1.pom'.
> Could not GET 'https://jcenter.bintray.com/com/facebook/fresco/imagepipeline-okhttp3/1.0.1/imagepipeline-okhttp3-1.0.1.pom'.
> jcenter.bintray.com
I was finally able to resolve this. It turned out to be an issue with gradle not being able to access the google repositories due to proxy issues. To resolve it, I added a gradle.properties file to my C:\Users\my_user_id>\.gradle folder with the following values:
systemProp.http.proxyHost=your_proxy.com
systemProp.http.proxyPort=80
systemProp.https.proxyHost=your_proxy.com
systemProp.https.proxyPort=80
Once I added that file, I actually ran into more problems which you can read about here, but I finally got things running.
I am not sure why the project ran ok on the previous react-native version without needing the gradle.properties file. Anyway, hope this helps if anyone has the same problem.

Sync failed - Could not find com.google.android.gms:play-services:9.4.0

I tried to run a project which was generated on someone else's PC, but sync fails and I get this error when cleaning the project:
Error:A problem occurred configuring project ':app'.
> Could not resolve all dependencies for configuration ':app:_debugCompile'.
> Could not find com.google.android.gms:play-services:9.4.0.
Searched in the following locations:
https://jcenter.bintray.com/com/google/android/gms/play-services/9.4.0/play-services-9.4.0.pom
https://jcenter.bintray.com/com/google/android/gms/play-services/9.4.0/play-services-9.4.0.jar
file:/C:/Users/win7/AppData/Local/Android/sdk1/extras/android/m2repository/com/google/android/gms/play-services/9.4.0/play-services-9.4.0.pom
file:/C:/Users/win7/AppData/Local/Android/sdk1/extras/android/m2repository/com/google/android/gms/play-services/9.4.0/play-services-9.4.0.jar
file:/C:/Users/win7/AppData/Local/Android/sdk1/extras/google/m2repository/com/google/android/gms/play-services/9.4.0/play-services-9.4.0.pom
file:/C:/Users/win7/AppData/Local/Android/sdk1/extras/google/m2repository/com/google/android/gms/play-services/9.4.0/play-services-9.4.0.jar
Required by:
Map:app:unspecified
was generated on someone other's PC on mine
They probably have the SDK repositories installed and you do not.
Seems like you are missing the Google Play Services Repository.

Gradle cannot resolve dependencies when Building an Android Studio project

I am used to Eclipse and recently tried to import and build a project in Android Studio using Gradle. For some reason, it is not downloading the dependencies.
Error:A problem occurred configuring project ':app'.
> Could not resolve all dependencies for configuration ':app:_debugCompile'.
> Could not resolve com.squareup.dagger:dagger:1.2.1.
Required by:
nxt-freemarket-lite:app:unspecified
> Could not GET 'https://jcenter.bintray.com/com/squareup/dagger/dagger/1.2.1/dagger-1.2.1.pom'.
> Connection to https://jcenter.bintray.com refused
> Could not resolve com.jakewharton:butterknife:5.1.1.
Required by:
nxt-freemarket-lite:app:unspecified
> Could not GET 'https://jcenter.bintray.com/com/jakewharton/butterknife/5.1.1/butterknife-5.1.1.pom'.
> Connection to https://jcenter.bintray.com refused
> Could not resolve com.squareup.dagger:dagger-compiler:1.2.1.
Required by:
nxt-freemarket-lite:app:unspecified
> Could not GET 'https://jcenter.bintray.com/com/squareup/dagger/dagger-compiler/1.2.1/dagger-compiler-1.2.1.pom'.
> Connection to https://jcenter.bintray.com refused
I can download all the .pom files in my browser. I have tried running Android Studio as Administrator, and disabled my Windows Firewall. Why can't it get these deps?

Categories

Resources