Cordova build failed : Could not find support-v4.jar

992 views Asked by At

I don't know what i did but my build fail until 3 hours on android and I can't fix it ... There is the log :

ANDROID_HOME= C:\Users\User\AppData\Local\Android\Sdk JAVA_HOME=C:\Program Files\Java\jdk1.8.0_121 Subproject Path: CordovaLib The Task.leftShift(Closure) method has been deprecated and is scheduled to be removed in Gradle 5.0. Please use Task.doLast(Action) instead. at.build_bxct3n5fn9ey9qgc57qreulsp.run(C:\Users\User\MyProject\application\platforms\android\build.gradle:143)

The JavaCompile.setDependencyCacheDir() method has been deprecated and is scheduled to be removed in Gradle 4.0.

Incremental java compilation is an incubating feature.

The TaskInputs.source(Object) method has been deprecated and is scheduled to be removed in Gradle 4.0. Please use TaskInputs.file(Object).skipWhenEmpty() instead.

WARNING: Module 'com.android.support:support-v4:26.1.0' depends on one or more Android Libraries but is a jar

FAILURE: Build failed with an exception.

  • What went wrong: A problem occurred configuring root project 'android'.

    Could not find support-v4.jar (com.android.support:support-v4:26.1.0). Searched in the following locations: BUILD FAILED

Total time: 1.569 secs

  https://jcenter.bintray.com/com/android/support/support-v4/26.1.0/support-v4-26.1.0.jar
  • Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. 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 find support-v4.jar (com.android.support:support-v4:26.1.0). Searched in the following locations: https://jcenter.bintray.com/com/android/support/support-v4/26.1.0/support-v4-26.1.0.jar

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

I use (edited :)[email protected] and cordova 8.1.2([email protected])

Hope someone can help me...

2

There are 2 answers

0
Lina M On BEST ANSWER

OK THEN, After update my gradle and set the environment variable on Windows 7 of the /bin gradle folder (yes, i didn't), upgraded Android Studio, upgraded Cordova to 8.1.2, do "cordova platform rm android" and "cordova platform add [email protected]" on any change i finaly found the issue.

I just uninstalled NDK in SDK Manager. For me it works, i don't know if it is for all but i finaly built my project !

enter image description here

Sorry for english and ty for reply all

5
a--m On

Changing build.gradle repositories to use maven repository solves this issue:

allprojects {
    repositories {
        mavenCentral()
        maven {
            url "https://maven.google.com"
        }
        jcenter()
    }
}

This file can be found on platforms/android/build.gradle.