3

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 :)cordova-android@6.4.0 and cordova 8.1.2(cordova-lib@8.1.1)

Hope someone can help me...

Lina M
  • 103
  • 1
  • 11

2 Answers2

1

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.

a--m
  • 4,716
  • 1
  • 39
  • 59
  • @ACES it did work for me. Do you still see the same error, trying to download dependencies from https://jcenter.bintray.com ? – a--m Oct 23 '18 at 21:18
  • Ty @a--m, don't know if it working or if i have another issue but my build fail with this message : "No toolchains found in the NDK toolchains folder for ABI with prefix: mips64el-linux-android" I installed NDK and CMake with Android Studio but it's the same, any idea ? :( – Lina M Oct 24 '18 at 08:32
  • @JoshuaTorri this should fix the problem described by the OP where the resources load from jcenter fail. You should be seing an error like the one in the question, like: `Searched in the following locations: https://jcenter. ....`. This solution fixed this error. – a--m Oct 24 '18 at 08:35
  • Nope @a--m , now i have this error : BUILD FAILED in 2s 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'. > No toolchains found in the NDK toolchains folder for ABI with prefix: mips64el-linux-android * Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. * Get more help at https://help.gradle.org BUILD FAILED in 2s – Lina M Oct 24 '18 at 08:41
  • 1
    @JTorri Looks different. Not sure if it could relate somehow, but did not experience this. You may want to check this thread to see if anything helps: https://github.com/google/filament/issues/15 – a--m Oct 24 '18 at 09:00
0

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 android@6.4.0" 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

Lina M
  • 103
  • 1
  • 11