Skip to main content

OracleJet Grunt Build Fails with Could not resolve com.android.tools.build:gradle:2.1.0.

While doing a grunt build of a oraclejet project in NetBeans, I was getting the below error. To resolve this, added

systemProp.https.proxyHost=<proxy host="">
systemProp.https.proxyPort=<proxy host="" port="">

to gradle.properties in <user home="">/.gradle/ directory


"D:\Program Files\nodejs\grunt.cmd" "oraclejet-build"
Running "oraclejet-build" task
Oracle JET Grunt plugin
Processing Grunt command...
[Warning] Missing platform. Default to android.
Theme Name:Platform - alta:android
Theme Version - 2.1.0
cleaning staging path.....
copy files to staging directory.....
copy finished...
compiling sass....
sass compile skipped...
running theme copy task.....
theme copy finished...
running theme injection task.....
indexHtml theme path injection finished..
injecting index.html with cordova script...
running injection task.....
mainJs paths injection finished..
invoke cordova prepare.....
cordova prepare finished....
invoke cordova compile.....
ANDROID_HOME=D:\android-sdks\sdk

JAVA_HOME=D:\jdk1.7.0_45

Starting a new Gradle Daemon for this build (subsequent builds will be faster).




BUILD FAILED



Total time: 1 mins 26.208 secs

Cordova compile finished....
>> Error: Command failed: C:\windows\system32\cmd.exe /s /c "cordova compile android --debug --emulator"
>>

>> FAILURE: Build failed with an exception.

>>

>> * What went wrong:

>> A problem occurred configuring root project 'android'.

>> > Could not resolve all dependencies for configuration ':classpath'.

>>    > Could not resolve com.android.tools.build:gradle:2.1.0.

>>      Required by:

>>          :android:unspecified

>>       > Could not resolve com.android.tools.build:gradle:2.1.0.

>>          > Could not get resource 'https://repo1.maven.org/maven2/com/android/tools/build/gradle/2.1.0/gradle-2.1.0.pom'.

>>             > Could not GET 'https://repo1.maven.org/maven2/com/android/tools/build/gradle/2.1.0/gradle-2.1.0.pom'.

>>                > Connect to repo1.maven.org:443 [repo1.maven.org/151.101.36.209] failed: Connection timed out: connect

>>       > Could not resolve com.android.tools.build:gradle:2.1.0.

>>          > Could not get resource 'https://jcenter.bintray.com/com/android/tools/build/gradle/2.1.0/gradle-2.1.0.pom'.

>>             > Could not GET 'https://jcenter.bintray.com/com/android/tools/build/gradle/2.1.0/gradle-2.1.0.pom'.

>>                > Connect to jcenter.bintray.com:443 [jcenter.bintray.com/5.153.35.248] failed: Connection timed out: connect

>>

>> * Try:

>> Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

>> Error: cmd: Command failed with exit code 1 Error output:
>> FAILURE: Build failed with an exception.

>>

>> * What went wrong:

>> A problem occurred configuring root project 'android'.

>> > Could not resolve all dependencies for configuration ':classpath'.

>>    > Could not resolve com.android.tools.build:gradle:2.1.0.

>>      Required by:

>>          :android:unspecified

>>       > Could not resolve com.android.tools.build:gradle:2.1.0.

>>          > Could not get resource 'https://repo1.maven.org/maven2/com/android/tools/build/gradle/2.1.0/gradle-2.1.0.pom'.

>>             > Could not GET 'https://repo1.maven.org/maven2/com/android/tools/build/gradle/2.1.0/gradle-2.1.0.pom'.

>>                > Connect to repo1.maven.org:443 [repo1.maven.org/151.101.36.209] failed: Connection timed out: connect

>>       > Could not resolve com.android.tools.build:gradle:2.1.0.

>>          > Could not get resource 'https://jcenter.bintray.com/com/android/tools/build/gradle/2.1.0/gradle-2.1.0.pom'.

>>             > Could not GET 'https://jcenter.bintray.com/com/android/tools/build/gradle/2.1.0/gradle-2.1.0.pom'.

>>                > Connect to jcenter.bintray.com:443 [jcenter.bintray.com/5.153.35.248] failed: Connection timed out: connect

>>

>> * Try:

>> Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

Done.

Comments

Popular posts from this blog

Java Agent

Starting with JDK 1.5, the javaagent feature has been around which provides for a hook to get access to the classes as they are loaded and consequently do instrumentation of the class to serve your purpose. This along with Javassist will allow you to achieve some useful tasks like enabling specific debugging etc. Below are some useful links for the same http://www.csg.ci.i.u-tokyo.ac.jp/~chiba/javassist/tutorial/tutorial.html http://blog.javabenchmark.org/2013/05/java-instrumentation-tutorial.html https://today.java.net/article/2008/04/22/add-logging-class-load-time-java-instrumentation I used to face issues related to the agent class not been able to find javassist related classes. To tackle this you can add an index file to the agent jar like below. jar -i agent.jar lib\javassist.jar and ensure that during deployment the javassist.jar file is in the lib folder which itselfs exists in the same directory as the agent jar. The  insertBefore and  insertAfter method...

Find Bugs Plugin

Findbugs provides for a quick method of doing static code analysis. It can operate in a stand alone mode and integrates well with eclipse as well. More information on this can be found at http://findbugs.sourceforge.net/ The installation comes with a number of built-in detectors. Additional detectors can be found at http://fb-contrib.sourceforge.net/ While these detectors are useful, the real power of FB can be unlocked by writing a custom detector for you code. Below is a step by step tutorial that you can refer to for writing a custom detector for your code. https://code.google.com/p/findbugs/wiki/DetectorPluginTutorial http://www.ibm.com/developerworks/library/j-findbug2/ To write your own detectors you would need to know the byte code being generated for your classes and then based on those patterns write a detector which will serve your purpose. One good plug-in to view the byte code for your classes is the Dr. Garbage Byte Code Visualizer. It is available as a eclipse...