0

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
tpoppen
  • 41
  • 3

1 Answers1

0

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. :/

tpoppen
  • 41
  • 3