NathanaelA / nativescript-zxing

ZXing for NativeScript
Other
15 stars 22 forks source link

Could not resolve com.google.zxing:core:3.3.2 #17

Closed corebreaker closed 6 years ago

corebreaker commented 6 years ago

I have errors with NativeScript 4.1.0 :

FAILURE: Build failed with an exception.

* What went wrong:
Could not resolve all files for configuration ':app:debugCompileClasspath'.
> Could not resolve com.google.zxing:android-core:3.3.0.
  Required by:
      project :app
   > Could not resolve com.google.zxing:android-core:3.3.0.
      > Could not get resource 'https://dl.google.com/dl/android/maven2/com/google/zxing/android-core/3.3.0/android-core-3.3.0.pom'.
         > Could not GET 'https://dl.google.com/dl/android/maven2/com/google/zxing/android-core/3.3.0/android-core-3.3.0.pom'.
            > java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
   > Could not resolve com.google.zxing:android-core:3.3.0.
      > Could not get resource 'https://jcenter.bintray.com/com/google/zxing/android-core/3.3.0/android-core-3.3.0.pom'.
         > Could not GET 'https://jcenter.bintray.com/com/google/zxing/android-core/3.3.0/android-core-3.3.0.pom'.
            > java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
   > Could not resolve com.google.zxing:android-core:3.3.0.
      > Could not get resource 'https://repo.maven.apache.org/maven2/com/google/zxing/android-core/3.3.0/android-core-3.3.0.pom'.
         > Could not GET 'https://repo.maven.apache.org/maven2/com/google/zxing/android-core/3.3.0/android-core-3.3.0.pom'.
            > java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
   > Could not resolve com.google.zxing:android-core:3.3.0.
      > Could not get resource 'https://dl.google.com/dl/android/maven2/com/google/zxing/android-core/3.3.0/android-core-3.3.0.pom'.
         > Could not GET 'https://dl.google.com/dl/android/maven2/com/google/zxing/android-core/3.3.0/android-core-3.3.0.pom'.
            > java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
   > Could not resolve com.google.zxing:android-core:3.3.0.
      > Could not get resource 'https://jcenter.bintray.com/com/google/zxing/android-core/3.3.0/android-core-3.3.0.pom'.
         > Could not GET 'https://jcenter.bintray.com/com/google/zxing/android-core/3.3.0/android-core-3.3.0.pom'.
            > java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
   > Could not resolve com.google.zxing:android-core:3.3.0.
      > Could not get resource 'https://repo.maven.apache.org/maven2/com/google/zxing/android-core/3.3.0/android-core-3.3.0.pom'.
         > Could not GET 'https://repo.maven.apache.org/maven2/com/google/zxing/android-core/3.3.0/android-core-3.3.0.pom'.
            > java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
   > Could not resolve com.google.zxing:android-core:3.3.0.
      > Could not get resource 'https://jcenter.bintray.com/com/google/zxing/android-core/3.3.0/android-core-3.3.0.pom'.
         > Could not GET 'https://jcenter.bintray.com/com/google/zxing/android-core/3.3.0/android-core-3.3.0.pom'.
            > java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
   > Could not resolve com.google.zxing:android-core:3.3.0.
      > Could not get resource 'https://repo.maven.apache.org/maven2/com/google/zxing/android-core/3.3.0/android-core-3.3.0.pom'.
         > Could not GET 'https://repo.maven.apache.org/maven2/com/google/zxing/android-core/3.3.0/android-core-3.3.0.pom'.
            > java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
> Could not resolve com.google.zxing:core:3.3.2.
  Required by:
      project :app
   > Could not resolve com.google.zxing:core:3.3.2.
      > Could not get resource 'https://dl.google.com/dl/android/maven2/com/google/zxing/core/3.3.2/core-3.3.2.pom'.
         > Could not GET 'https://dl.google.com/dl/android/maven2/com/google/zxing/core/3.3.2/core-3.3.2.pom'.
            > java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
   > Could not resolve com.google.zxing:core:3.3.2.
      > Could not get resource 'https://jcenter.bintray.com/com/google/zxing/core/3.3.2/core-3.3.2.pom'.
         > Could not GET 'https://jcenter.bintray.com/com/google/zxing/core/3.3.2/core-3.3.2.pom'.
            > java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
   > Could not resolve com.google.zxing:core:3.3.2.
      > Could not get resource 'https://repo.maven.apache.org/maven2/com/google/zxing/core/3.3.2/core-3.3.2.pom'.
         > Could not GET 'https://repo.maven.apache.org/maven2/com/google/zxing/core/3.3.2/core-3.3.2.pom'.
            > java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
   > Could not resolve com.google.zxing:core:3.3.2.
      > Could not get resource 'https://dl.google.com/dl/android/maven2/com/google/zxing/core/3.3.2/core-3.3.2.pom'.
         > Could not GET 'https://dl.google.com/dl/android/maven2/com/google/zxing/core/3.3.2/core-3.3.2.pom'.
            > java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
   > Could not resolve com.google.zxing:core:3.3.2.
      > Could not get resource 'https://jcenter.bintray.com/com/google/zxing/core/3.3.2/core-3.3.2.pom'.
         > Could not GET 'https://jcenter.bintray.com/com/google/zxing/core/3.3.2/core-3.3.2.pom'.
            > java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
   > Could not resolve com.google.zxing:core:3.3.2.
      > Could not get resource 'https://repo.maven.apache.org/maven2/com/google/zxing/core/3.3.2/core-3.3.2.pom'.
         > Could not GET 'https://repo.maven.apache.org/maven2/com/google/zxing/core/3.3.2/core-3.3.2.pom'.
            > java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
   > Could not resolve com.google.zxing:core:3.3.2.
      > Could not get resource 'https://jcenter.bintray.com/com/google/zxing/core/3.3.2/core-3.3.2.pom'.
         > Could not GET 'https://jcenter.bintray.com/com/google/zxing/core/3.3.2/core-3.3.2.pom'.
            > java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
   > Could not resolve com.google.zxing:core:3.3.2.
      > Could not get resource 'https://repo.maven.apache.org/maven2/com/google/zxing/core/3.3.2/core-3.3.2.pom'.
         > Could not GET 'https://repo.maven.apache.org/maven2/com/google/zxing/core/3.3.2/core-3.3.2.pom'.
            > java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty

I tried to modify app/App_Resources/Android/app.gradle to add repositories like that:

repositories {
  google()
  jcenter()
  mavenCentral()
}

And like that:

allprojects {
  repositories {
    google()
    jcenter()
    mavenCentral()
  }
}

Notice that i used all recent versions of all (SDK, libs, etc.), so don't ask me which version of something i used, the answer is: «The latest stable version !» (except for NativeScript, i used 4.1.0).

NathanaelA commented 6 years ago

Two things;

  1. which OS? I just tried this on windows; and it built fine with the latest versions of NS...
  2. Have you tried setting to this;
allprojects {
  repositories {
    google()
    mavenCentral()
   jcenter()

  }
}

JCenter should be last..

NathanaelA commented 6 years ago

Also, should note; that unless you are putting that in the TNS copy of the gradle; it won't matter. Your app_resources copy does NOT apply to plugins. Plugins are built using a different version of gradle parameters...

corebreaker commented 6 years ago

OS: Linux Ubuntu 18.04

Indeed, i decided to use https://github.com/Cordobo/angularx-qrcode for generating a QR Code, and i'll use https://github.com/EddyVerbruggen/nativescript-barcodescanner for scanning cause i'm a little in a hurry.

Therefore, i removed the plugin, i'll test your suggestion later.

NathanaelA commented 6 years ago

@corebreaker - I suspect your issue has to do with this: https://stackoverflow.com/questions/6784463/error-trustanchors-parameter-must-be-non-empty

Sounds like in 18.04 they changed the Keystore format and it break Java ssl connections (which Gradle uses to download packages) The second answer looks like it can show you can fix it. ;-)

corebreaker commented 6 years ago

ok thanks, i'll try it later.

NathanaelA commented 6 years ago

I assume you have resolved your issue. Please let me know if you are still stuck.