I am getting below error while build apk on one-signal mentioned version ==> "ionic-native/onesignal": "^4.2.1", "onesignal-cordova-plugin": "^2.2.0"
[ERROR] An error occurred while running cordova build android (exit code 1):
ANDROID_HOME=C:\Users\XYZ\AppData\Local\Android\sdk
JAVA_HOME=C:\Program Files\java\jdk1.8.0_31
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_au2kwlovcls6rtccq7cz9s5fi.run(D:\test\platforms\android\build.gradle:138)
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.
javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building
failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid
certification path to requested target
Failed to download any source lists!
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'android'.
> Could not resolve all dependencies for configuration ':_debugApkCopy'.
> Could not resolve com.android.support:support-v4:[26.0.0,26.1.0).
Required by:
project : > com.onesignal:OneSignal:3.6.1
> Could not resolve com.android.support:support-v4:[26.0.0,26.1.0).
> Failed to list versions for com.android.support:support-v4.
> Unable to load Maven meta-data from
https://maven.google.com/com/android/support/support-v4/maven-metadata.xml.
> Could not GET
'https://maven.google.com/com/android/support/support-v4/maven-metadata.xml'.
> sun.security.validator.ValidatorException: PKIX path building failed:
sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path
to requested target
> Could not resolve com.android.support:customtabs:[26.0.0,26.1.0).
Required by:
project : > com.onesignal:OneSignal:3.6.1
> Could not resolve com.android.support:customtabs:[26.0.0,26.1.0).
> Failed to list versions for com.android.support:customtabs.
> Unable to load Maven meta-data from
https://maven.google.com/com/android/support/customtabs/maven-metadata.xml.
> Could not GET
'https://maven.google.com/com/android/support/customtabs/maven-metadata.xml'.
> sun.security.validator.ValidatorException: PKIX path building failed:
sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path
to requested target
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more
log output.
BUILD FAILED
Total time: 29.031 secs
Error: 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 resolve all dependencies for configuration ':_debugApkCopy'.
> Could not resolve com.android.support:support-v4:[26.0.0,26.1.0).
Required by:
project : > com.onesignal:OneSignal:3.6.1
> Could not resolve com.android.support:support-v4:[26.0.0,26.1.0).
> Failed to list versions for com.android.support:support-v4.
> Unable to load Maven meta-data from
https://maven.google.com/com/android/support/support-v4/maven-metadata.xml.
> Could not GET
'https://maven.google.com/com/android/support/support-v4/maven-metadata.xml'.
> sun.security.validator.ValidatorException: PKIX path building failed:
sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path
to requested target
> Could not resolve com.android.support:customtabs:[26.0.0,26.1.0).
Required by:
project : > com.onesignal:OneSignal:3.6.1
> Could not resolve com.android.support:customtabs:[26.0.0,26.1.0).
> Failed to list versions for com.android.support:customtabs.
> Unable to load Maven meta-data from
https://maven.google.com/com/android/support/customtabs/maven-metadata.xml.
> Could not GET
'https://maven.google.com/com/android/support/customtabs/maven-metadata.xml'.
> sun.security.validator.ValidatorException: PKIX path building failed:
sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path
to requested target
cli packages: (C:\Users\XYZ\AppData\Roaming\npm\node_modules)
@ionic/cli-utils : 1.9.2
ionic (Ionic CLI) : 3.9.2
global packages:
Cordova CLI : 7.0.1
local packages:
@ionic/app-scripts : 2.1.4
Cordova Platforms : android 6.2.3
Ionic Framework : ionic-angular 3.6.0
System:
Node : v6.9.5
npm : 3.10.10
OS : Windows 10
With old version "ionic-native/onesignal": "^3.12.1","onesignal-cordova-plugin": "^2.1.2" , it's working fine.