slack-digest/2022-01-01.md
Sat, 01 Jan 2022 08:21:19 GMT
Join the conversation at slack.cordova.io
Fri, 31 Dec 2021 19:17:29 GMT
@john518 says
Hello 👋 , any idea why gradle always appears to be out of date after running
cordova build?
Fri, 31 Dec 2021 19:31:08 GMT
@norman137 says
> Configuration 'compile' in project ':app' is deprecated. Use 'implementation' instead. You have a plugin that is including a gradle resource which is using the
compileapi in gradle which is deprecated. I believe all of Apache maintained plugins have already switched toimplementation, but if not, a bug ticket can be created. You'd have to track down what is adding that part of the gradle code though. This shouldn't be related to the build failure.> Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0 This is generally caused by an upstream dependency of Cordova, the Android Gradle Plugin. This message is safe to ignore. Cordova by default uses gradle wrappers, so regardless of the system gradle version you have installed, it will always install a gradle wrapper at a version it knows is compatible with AGP and other dependencies. Again this, shouldn't be related to the build failure in your screenshot.
Fri, 31 Dec 2021 19:33:39 GMT
@john518 says
Hi Norman, thank you for the info… In that case, is the same true for the following errors? The individual plugin(s) needs to be updated?
Fri, 31 Dec 2021 19:38:33 GMT
@norman137 says
what version of
cordova-androidare you running?
Fri, 31 Dec 2021 19:38:44 GMT
@john518 says
7.1.4
Fri, 31 Dec 2021 19:42:08 GMT
@norman137 says
yah that's pretty old. Looks like you're looking at the project inside android studio. Did you happen to accept any "upgrade" prompts for gradle and such? If so, that will very likely break the project.
Fri, 31 Dec 2021 19:43:00 GMT
@norman137 says
Cordova-android 7.x I think only works with gradle 3 or 4... so you shouldn't be seeing any messages related to gradle 7
Fri, 31 Dec 2021 19:44:20 GMT
@john518 says
I did at one point, but then nuked the project and started again and skipped update but still get an issue… trouble is, if I go with the latest version of
cordova-androidI get errors like this
Fri, 31 Dec 2021 19:44:47 GMT
@john518 says
I’ve been using cordova for a few years now and Android is always a pain to build compared to XCode… Is that the same for you?
Fri, 31 Dec 2021 19:48:43 GMT
@norman137 says
Not really 😅 but I am more familiar with Android stuff than I am with any apple product. ADB is garbage though.
For that error that happens on cordova-android@10, that's because cordova-android@10 enforces androidX support libraries, which are incompatible with the older, now legacy, support libraries, (eg. anything
android.support.package).I think most Apache-maintained plugins again have been updated to use the androidX equivalent libraries but for other third-party plugins that are either slow or unwilling to maintain their plugins for whatever reason, the
cordova-plugin-androidx-adapter[1] usually does a good job of fixing plugins still using the old support libraries.[1] https://www.npmjs.com/package/cordova-plugin-androidx-adapter
Fri, 31 Dec 2021 19:50:52 GMT
@norman137 says
The way Google handled AndroidX stuff is horrible. cordova-android@9 tried to find a way to support both, but it became quite evident it was impossible to support both legacy and androidx at the same time, they simply won't compile together.
Fri, 31 Dec 2021 19:52:59 GMT
@john518 says
Damn. I had no idea, been stuck an an old version for a while now… Does make you worry about the future of cordova. Do you think it’s days are numbered?
Fri, 31 Dec 2021 19:55:31 GMT
@john518 says
FYI: I personally love it, tend to write all my UI stuff in pure JS and use cordova to wrap it
Fri, 31 Dec 2021 19:58:39 GMT
@norman137 says
> Does make you worry about the future of cordova. Do you think it’s days are numbered? We do have limited volunteers compared so we have been downsizing our maintenance load. e.g. deprecating the osx/windows platforms (in favor of the newer electron platform). Personally I'd also like to deprecate the browser platform as well (I don't think the platform makes any sense as unlike inside the native platforms we can't really polyfill much native behaviour in the browser).
I can say that my company can't really afford to rewrite our apps in another technology stack. It could, but it would take us a lot of time that would be better spent elsewhere.
Fri, 31 Dec 2021 20:04:09 GMT
@john518 says
Totally agree about dropping support for the browser, we only use cordova for access to the device. We’re in the same boat in terms of a rewrite, it would take a LOT of effort and I’m not convinced we’d gain anything, the end user would not see the benefit. I’ve always hoped PWAs would gradually get more access to the hardware, and the need for cordova plugins would fade away
Fri, 31 Dec 2021 20:10:05 GMT
@john518 says
My issue is now resolved. I upgraded
cordova-androidto the latest version and addedcordova-plugin-androidx-adapteras you suggested and it now builds 🚀 Thank you for your help!!