Pushwoosh / pushwoosh-phonegap-plugin

Pushwoosh PhoneGap Build Plugin
Other
110 stars 139 forks source link

Firebase error while building PGB #318

Closed xale76 closed 5 years ago

xale76 commented 5 years ago

Hello, until 17 june, I was able to build my Phonegap app containing (among others):

pushwoosh-phonegap-plugin vers. 7.8.7

same config,xml, same version of plugin, I didn't change anything, I cannot build since 17 june, it seems there's something wrong with firebase, but I cannot understand: if I use 7.8.7 version, how is it possible? It seems that 7.8.7 version, even if should be the same as in my latest working build, now requires minsdk 16 and this is a problem because it's not compatible with other plugins I use. Please help me

wfhm commented 5 years ago

Hello @xale76,

Checking it!

wfhm commented 5 years ago

Hey @xale76,

Please let me draw your attention to the fact that version 7.8.7 is critically outdated. It is necessary to update it in order to avoid any possible issues since the further versions include important fixes and improvements. Moreover, due to the recent changes from the Google side, you should have at least the version 7.15.2(includes critical fix) of our plugin to be able to build an app. In view of this, please update the version of our plugin in your app to the latest one.

https://github.com/Pushwoosh/pushwoosh-phonegap-plugin/releases/tag/7.16.0

xale76 commented 5 years ago

Thank you but this doesn't solve my problem. My original question is: how is it possibile that I can no longer build even if version of plugin is the same? It needs time to change and include firebase for me, I need to build as I did until 10 days ago. Please help me

wfhm commented 5 years ago

@xale76

The issue is related to major version release of the Google Play Services and Firebase libaries on June 17. These changes made build process even of the apps that were compiling fine before the update fail.

The new library versions have the following requirements:

  • Upgrade com.android.tools.build:gradle to v3.2.1 or later.
  • Upgrade compileSdkVersion to 28 or later.
  • Update your app to use Jetpack (AndroidX)

The first two requirements can be resolved by updating to use cordova-android@8.0.0. The third requires that your Android project migrates to using AndroidX (Jetpack). AndroidX is the successor to the widely-used Android Support Library. AndroidX now used by the latest versions of Play Services/Firebase libraries and the Support library is used by many existing plugins such as cordova-plugin-firebase. The two libraries cannot live side-by-side in the same Android build - doing so will lead to build failure.

We have already rolled out a fix to the issue, so basically you only need to upgrade Pushwoosh plugin to the latest version.

You can find more information on the issue in this Stackoverflow thread.

xale76 commented 5 years ago

hello, please don't abandon me. All day I've been trying to move to version you suggest. I have conflict with a plugin of mine (xwalk), the error is:

Execution failed for task ':transformClassesWithJarMergingForRelease'.

com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: android/support/v4/app/INotificationSideChannel$Stub$Proxy.class

Please can you suggest me which is the library duplicated so I can exclude it from my xwalk plugin? thank you

wfhm commented 5 years ago

@xale76,

Here's the list of frameworks that might conflict with your plugin:

<framework src="com.google.firebase:firebase-core:(+,17.0.0)" /> <framework src="com.google.firebase:firebase-messaging:(+,19.0.0)" /> <framework src="com.android.support:support-v4:27.+" /> <framework src="com.android.support:appcompat-v7:27.+" /> <framework src="com.android.support:recyclerview-v7:27.+" /> <framework src="com.android.support:design:27.+" /> <framework src="com.android.support.constraint:constraint-layout:1.0.2" /> <framework src="com.github.bumptech.glide:glide:4.7.1" /> <framework src="org.jetbrains.kotlin:kotlin-stdlib-jre7:1.1.60" /> <framework src="com.pushwoosh:pushwoosh:5.16.0"/> <framework src="com.pushwoosh:pushwoosh-amazon:5.16.0"/> <framework src="com.pushwoosh:pushwoosh-badge:5.16.0"/> <framework src="com.pushwoosh:pushwoosh-inbox:5.16.0"/> <framework src="com.pushwoosh:pushwoosh-inbox-ui:5.16.0"/>

I assume the one that causes the conflict you mentioned in your last message is <framework src="com.android.support:support-v4:27.+" />.

Please also make sure the versions of Android Support libs in your plugin match the ones in Pushwoosh plugin.