Closed kevinmcody closed 1 month ago
I will generate a fresh Cordova project and attempt to reproduce.
You should really migrate away from Cordova.
I support Capacitor, React Native and Flutter (my favourite).
Thanks.
I worked around it temporarily by doing something my IT security folks should never know about (a Gradle plugin that ignores SSL errors while pulling in external repos): https://stackoverflow.com/questions/51658086/how-to-configure-gradle-to-bypass-ssl-certificate-validation
(As for Cordova, LOL I 100% agree! Sadly the suits that manage my time have other priorities)
Update - the temporary workaround did not, in fact, work. Nor did several other attempts I made to force Gradle / Java to ignore cert validation errors.
Any luck reproducing this?
I just generated a fresh Cordova app, added the plugin, pasted the example and it works fine. The plugin requests permissions at app launch (you're probably not even getting the android app to build)
$ cordova platforms
Installed platforms:
android 12.0.1
I'm grasping at very thin straws right now: what version of Gradle are you using?
platforms/android/gradle/gradle-wrapper.properties
distributionUrl=https://services.gradle.org/distributions/gradle-7.6-all.zip
I think I fixed this by changing JDKs, which sounds kinda crazy but hear me out:
The Huawei stuff that was being pulled in was all at developer.huawei.com, which apparently redirects to a CDN called "akamai.net". When I went to the repos directly in a browser I was able to download them without issue; it was just Gradle running in Powershell that was complaining. I'm thinking maybe the Java HttpClient simply was not smart enough to navigate the redirects.
I switched my JAVA_HOME environment variable from OpenJDK11 to the JetBrains Java Runtime that ships with Android Studio, and now it successfully pulls in all the repos and builds.
and now it successfully pulls in all the repos and builds.
Awesome, well done. You're a champ!
Your Environment
cordova -v
): 12.0.0cordova platform ls
): 12.0.1#ready
: N/AExpected Behavior
I should be able to build the project
Actual Behavior
The project fails to build, with many errors regarding developer.huawei.com, all similar to the what I pasted in the "logs" section below:
Steps to Reproduce
Context
Build the project. Note that this worked perhaps a month or two ago.
Debug logs
Logs
``` > Could not resolve all files for configuration ':app:debugRuntimeClasspath'. > Could not resolve com.huawei.hms:availableupdate:6.5.0.300. Required by: project :app > com.huawei.hms:location:6.9.0.300 > com.huawei.hms:base:6.5.0.300 > Could not resolve com.huawei.hms:availableupdate:6.5.0.300. > Could not get resource 'https://developer.huawei.com/repo/com/huawei/hms/availableupdate/6.5.0.300/availableupdate-6.5.0.300.pom'. > Could not GET 'https://developer.huawei.com/repo/com/huawei/hms/availableupdate/6.5.0.300/availableupdate-6.5.0.300.pom'. > Certificate for