4 Replies Latest reply on Mar 14, 2018 1:29 PM by jos21785247

    Cordova: can't run project on Android.

    jos21785247 Level 1

      I'm trying to run cordova project on Android. After I've got this problem I put gradile 4.6 in my Ubuntu, with path to it in.bashrc. (I didn't forgetsource ~.bashrc) Also I editedclasspath 'com.android.tools.build:gradle:3.0.0'to...gradile:4.6` and still getting this problem.

       

      cordova run android --stacktrace`
        
      Android Studio project detected
        ANDROID_HOME
      =/home/joe/Android/SDK
        JAVA_HOME
      =/usr/lib/jvm/java-8-openjdk-amd64
        studio
        
      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 resolve com.android.tools.build:gradle:4.6.
        
      Required by:
        project
      :
        
      > Could not resolve com.android.tools.build:gradle:4.6.
        
      > Could not get resource 'https://jcenter.bintray.com/com/android/tools/build/gradle/4.6/gradle-4.6.pom'.
        
      > Could not GET 'https://jcenter.bintray.com/com/android/tools/build/gradle/4.6/gradle-4.6.pom'.
        
      > java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
        
      > Could not resolve com.android.tools.build:gradle:4.6.
        
      > Could not get resource 'https://maven.google.com/com/android/tools/build/gradle/4.6/gradle-4.6.pom'.
        
      > Could not GET 'https://maven.google.com/com/android/tools/build/gradle/4.6/gradle-4.6.pom'.
        
      > java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty

        
      * 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
      1s
        
      (node:23645) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: /home/joe/CordovaProjects/TestApp/platforms/android/gradlew: 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 files for configuration ':classpath'.
        
      > Could not resolve com.android.tools.build:gradle:4.6.
        
      Required by:
        project
      :
        
      > Could not resolve com.android.tools.build:gradle:4.6.
        
      > Could not get resource 'https://jcenter.bintray.com/com/android/tools/build/gradle/4.6/gradle-4.6.pom'.
        
      > Could not GET 'https://jcenter.bintray.com/com/android/tools/build/gradle/4.6/gradle-4.6.pom'.
        
      > java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
        
      > Could not resolve com.android.tools.build:gradle:4.6.
        
      > Could not get resource 'https://maven.google.com/com/android/tools/build/gradle/4.6/gradle-4.6.pom'.
        
      > Could not GET 'https://maven.google.com/com/android/tools/build/gradle/4.6/gradle-4.6.pom'.
        
      > java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty