Closed davidofwatkins closed 2 years ago
@davidofwatkins Thanks for the suggestion! We will check if this solution works as expected and, if it does, this will be added with the next release. I will provide a status update shortly.
Did you have time to check this, @wfhm? It affects a project I'm working on as well. Right now I have to script removal of the duplicate apply plugin
line during automated builds.
@larskinn yes, we've tested it, and it works fine in Cordova projects, however, it is a bit more complicated for us since we have to make sure that all supported Cordova-based frameworks (specifically, Outsystems MABS) work as expected with this change. We've temporarily put this task on hold, but I believe we can still implement it or at least give you a definitive answer on whether we will do it or not by the end of 2021.
@wfhm Thanks for the update. For now, I've added an after_plugin_install
hook to fix the issue in our build.
UPDATE: Actually, "fixing" it this way leads to the following compilation error
Could not determine the dependencies of task ':app:compileReleaseJavaWithJavac'.
> In project 'app' a resolved Google Play services library dependency depends on another at an exact version (e.g. "[1.0.0
, 1.2.99]", but isn't being resolved to that version. Behavior exhibited by the library will be unknown.
Dependency failing: com.pushwoosh:pushwoosh-amazon:6.3.3 -> androidx.annotation:annotation@[1.0.0, 1.2.99], but annotati
on version was 1.1.0.
However, removing the apply plugin
line from platforms/android/app/build.gradle
in a after_platform_add
hook works fine. Seems like a more hacky workaround, though.
@larskinn @davidofwatkins the plugin uses GradlePluginGoogleServicesEnabled and GradlePluginGoogleServicesVersion preferences starting with the 8.3.0.
Cordova introduced
GradlePluginGoogleServicesEnabled
andGradlePluginGoogleServicesVersion
in cordova-android 9:This avoids conflicting versions of Google Services between Cordova plugins in projects like mine that use several of them. If I build my app after upgrading cordova-android and adding
GradlePluginGoogleServicesEnabled
to my config.xml, I get the following error:I was able to resolve this by removing the following lines from Pushwoosh's
build.gradle
:https://github.com/Pushwoosh/pushwoosh-phonegap-plugin/blob/59bbd7371b093edebb6e915a7db51c2ac45ce5cb/build.gradle#L18-L22