This library depends on the latest of com.google.android.gms and com.google.firebase:firebase-messaging which on their turn have been updated to use androidx libraries. Since React-Native is not yet ready for AndroidX (currently on RC). Using this library crashes every build of your app. The solution would be to not use latest as dependencies in build.gradle for this project. Our for every project that uses this project define this in buildscript { ext { ... } }:
googlePlayServicesVersion = "16.0.0"
firebaseVersion = "17.0.0"
`
Execution failed for task ':app:processDebugManifest'.
Manifest merger failed : Attribute application@appComponentFactory value=(android.support.v4.app.CoreComponentFactory) from [com.android.support:support-compat:28.0.0] AndroidManifest.xml:22:18-91
is also present at [androidx.core:core:1.0.0] AndroidManifest.xml:22:18-86 value=(androidx.core.app.CoreComponentFactory).
Suggestion: add 'tools:replace="android:appComponentFactory"' toelement at AndroidManifest.xml:7:5-138 to override.
`
The dependencies for react-native-push-notification:
+--- project :react-native-push-notification
| +--- com.android.support:appcompat-v7:28.0.0 (*)
| +--- com.facebook.react:react-native:+ -> 0.59.9 (*)
| +--- com.google.android.gms:play-services-gcm:+ -> 17.0.0
| | +--- androidx.collection:collection:1.0.0
| | | \--- androidx.annotation:annotation:1.0.0
| | +--- androidx.core:core:1.0.0
| | | +--- androidx.annotation:annotation:1.0.0
| | | +--- androidx.collection:collection:1.0.0 (*)
| | | +--- androidx.lifecycle:lifecycle-runtime:2.0.0
| | | | +--- androidx.lifecycle:lifecycle-common:2.0.0
| | | | | \--- androidx.annotation:annotation:1.0.0
| | | | +--- androidx.arch.core:core-common:2.0.0
| | | | | \--- androidx.annotation:annotation:1.0.0
| | | | \--- androidx.annotation:annotation:1.0.0
| | | \--- androidx.versionedparcelable:versionedparcelable:1.0.0
| | | +--- androidx.annotation:annotation:1.0.0
| | | \--- androidx.collection:collection:1.0.0 (*)
| | +--- androidx.legacy:legacy-support-core-utils:1.0.0
| | | +--- androidx.annotation:annotation:1.0.0
| | | +--- androidx.core:core:1.0.0 (*)
| | | +--- androidx.documentfile:documentfile:1.0.0
| | | | \--- androidx.annotation:annotation:1.0.0
| | | +--- androidx.loader:loader:1.0.0
| | | | +--- androidx.annotation:annotation:1.0.0
| | | | +--- androidx.core:core:1.0.0 (*)
| | | | +--- androidx.lifecycle:lifecycle-livedata:2.0.0
| | | | | +--- androidx.arch.core:core-runtime:2.0.0
| | | | | | +--- androidx.annotation:annotation:1.0.0
| | | | | | \--- androidx.arch.core:core-common:2.0.0 (*)
| | | | | +--- androidx.lifecycle:lifecycle-livedata-core:2.0.0
| | | | | | +--- androidx.lifecycle:lifecycle-common:2.0.0 (*)
| | | | | | +--- androidx.arch.core:core-common:2.0.0 (*)
| | | | | | \--- androidx.arch.core:core-runtime:2.0.0 (*)
| | | | | \--- androidx.arch.core:core-common:2.0.0 (*)
| | | | \--- androidx.lifecycle:lifecycle-viewmodel:2.0.0
| | | | \--- androidx.annotation:annotation:1.0.0
| | | +--- androidx.localbroadcastmanager:localbroadcastmanager:1.0.0
| | | | \--- androidx.annotation:annotation:1.0.0
| | | \--- androidx.print:print:1.0.0
| | | \--- androidx.annotation:annotation:1.0.0
| | +--- com.google.android.gms:play-services-base:17.0.0
| | | +--- androidx.collection:collection:1.0.0 (*)
| | | +--- androidx.core:core:1.0.0 (*)
| | | +--- androidx.fragment:fragment:1.0.0
| | | | +--- androidx.core:core:1.0.0 (*)
| | | | +--- androidx.legacy:legacy-support-core-ui:1.0.0
| | | | | +--- androidx.annotation:annotation:1.0.0
| | | | | +--- androidx.core:core:1.0.0 (*)
| | | | | +--- androidx.legacy:legacy-support-core-utils:1.0.0 (*)
| | | | | +--- androidx.customview:customview:1.0.0
| | | | | | +--- androidx.annotation:annotation:1.0.0
| | | | | | \--- androidx.core:core:1.0.0 (*)
| | | | | +--- androidx.viewpager:viewpager:1.0.0
| | | | | | +--- androidx.annotation:annotation:1.0.0
| | | | | | +--- androidx.core:core:1.0.0 (*)
| | | | | | \--- androidx.customview:customview:1.0.0 (*)
| | | | | +--- androidx.coordinatorlayout:coordinatorlayout:1.0.0
| | | | | | +--- androidx.annotation:annotation:1.0.0
| | | | | | +--- androidx.core:core:1.0.0 (*)
| | | | | | \--- androidx.customview:customview:1.0.0 (*)
| | | | | +--- androidx.drawerlayout:drawerlayout:1.0.0
| | | | | | +--- androidx.annotation:annotation:1.0.0
| | | | | | +--- androidx.core:core:1.0.0 (*)
| | | | | | \--- androidx.customview:customview:1.0.0 (*)
| | | | | +--- androidx.slidingpanelayout:slidingpanelayout:1.0.0
| | | | | | +--- androidx.annotation:annotation:1.0.0
| | | | | | +--- androidx.core:core:1.0.0 (*)
| | | | | | \--- androidx.customview:customview:1.0.0 (*)
| | | | | +--- androidx.interpolator:interpolator:1.0.0
| | | | | | \--- androidx.annotation:annotation:1.0.0
| | | | | +--- androidx.swiperefreshlayout:swiperefreshlayout:1.0.0
| | | | | | +--- androidx.annotation:annotation:1.0.0
| | | | | | +--- androidx.core:core:1.0.0 (*)
| | | | | | \--- androidx.interpolator:interpolator:1.0.0 (*)
| | | | | +--- androidx.asynclayoutinflater:asynclayoutinflater:1.0.0
| | | | | | +--- androidx.annotation:annotation:1.0.0
| | | | | | \--- androidx.core:core:1.0.0 (*)
| | | | | \--- androidx.cursoradapter:cursoradapter:1.0.0
| | | | | \--- androidx.annotation:annotation:1.0.0
| | | | +--- androidx.legacy:legacy-support-core-utils:1.0.0 (*)
| | | | +--- androidx.annotation:annotation:1.0.0
| | | | +--- androidx.loader:loader:1.0.0 (*)
| | | | \--- androidx.lifecycle:lifecycle-viewmodel:2.0.0 (*)
| | | +--- com.google.android.gms:play-services-basement:17.0.0
| | | | +--- androidx.collection:collection:1.0.0 (*)
| | | | +--- androidx.core:core:1.0.0 (*)
| | | | \--- androidx.fragment:fragment:1.0.0 (*)
| | | \--- com.google.android.gms:play-services-tasks:17.0.0
| | | \--- com.google.android.gms:play-services-basement:17.0.0 (*)
| | +--- com.google.android.gms:play-services-basement:17.0.0 (*)
| | +--- com.google.android.gms:play-services-iid:[17.0.0] -> 17.0.0
| | | +--- androidx.collection:collection:1.0.0 (*)
| | | +--- androidx.core:core:1.0.0 (*)
| | | +--- com.google.android.gms:play-services-base:17.0.0 (*)
| | | +--- com.google.android.gms:play-services-basement:17.0.0 (*)
| | | +--- com.google.android.gms:play-services-stats:17.0.0
| | | | +--- androidx.legacy:legacy-support-core-utils:1.0.0 (*)
| | | | \--- com.google.android.gms:play-services-basement:17.0.0 (*)
| | | \--- com.google.android.gms:play-services-tasks:17.0.0 (*)
| | \--- com.google.android.gms:play-services-stats:17.0.0 (*)
| +--- me.leolin:ShortcutBadger:1.1.8
| \--- com.google.firebase:firebase-messaging:+ -> 19.0.0
| +--- androidx.collection:collection:1.0.0 (*)
| +--- androidx.core:core:1.0.0 (*)
| +--- com.google.android.gms:play-services-basement:17.0.0 (*)
| +--- com.google.android.gms:play-services-tasks:17.0.0 (*)
| +--- com.google.firebase:firebase-common:18.0.0
| | +--- androidx.annotation:annotation:1.0.0
| | +--- androidx.collection:collection:1.0.0 (*)
| | +--- androidx.core:core:1.0.0 (*)
| | +--- com.google.android.gms:play-services-basement:17.0.0 (*)
| | +--- com.google.android.gms:play-services-tasks:17.0.0 (*)
| | \--- com.google.auto.value:auto-value-annotations:1.6.3
| +--- com.google.firebase:firebase-iid:[19.0.0] -> 19.0.0
| | +--- androidx.collection:collection:1.0.0 (*)
| | +--- androidx.core:core:1.0.0 (*)
| | +--- androidx.legacy:legacy-support-core-utils:1.0.0 (*)
| | +--- com.google.android.gms:play-services-basement:17.0.0 (*)
| | +--- com.google.android.gms:play-services-stats:17.0.0 (*)
| | +--- com.google.android.gms:play-services-tasks:17.0.0 (*)
| | +--- com.google.firebase:firebase-common:18.0.0 (*)
| | \--- com.google.firebase:firebase-iid-interop:17.0.0
| | +--- com.google.android.gms:play-services-base:17.0.0 (*)
| | \--- com.google.android.gms:play-services-basement:17.0.0 (*)
| \--- com.google.firebase:firebase-measurement-connector:18.0.0
| \--- com.google.android.gms:play-services-basement:17.0.0 (*)
Just to clearify: I solved this issue by targeting the the googlePlayServicesVersion and firebaseVersion in build.gradle:
buildscript {
ext {
//buildToolsVersions, sdk version, etc
googlePlayServicesVersion = "16.0.0"
firebaseVersion = "17.0.0"
}
//repositories and dependencies
}
same issue please help
same issue here!
https://github.com/zo0r/react-native-push-notification/pull/1092 PR already out to fix it.
Hey everybody. I solved the issue updating the build.gradle as follows:
Replace the implementation project(":react-native-push-notification") section with:
implementation(project(":react-native-push-notification"), {
exclude group: "com.google.android.gms"
})
implementation "com.google.android.gms:play-services-gcm:16.0.0"
The issue is caused because react-native-push-notifications is using com.google.android.gms:play-services-gcm:+ that apparently was updated recently with breaking changes.
More info on this issue
This is a shit update
This library has several changes they need to make in order to work well forwards and backwards across the AndroidX transition.
+ dependencies should be avoided, until the code is migrated to AndroidX it should have as a maximum the play version that is pre-AndroidX
The library name for the appcompat library should be completely overridable itself
https://github.com/mikehardy/jetifier#module-maintainers
I only came here because this library prompts lots of support requests on react-native-firebase which I help maintain. They boil down to gradle dependency snarls which need help here. If I were consuming this package I would submit a PR with proposed fixes and in the meantime use my fixes via a patch and the patch-package module.
I solved by following below.
https://github.com/zo0r/react-native-push-notification/issues/1109#issuecomment-506285772
which version dont have force migration to androidx?
Hi @robert589 , I'm using 3.1.3 and it's working fine.
AndroidX is inevitable and almost unavoidable at this point, I'd work towards figuring out how to make it work rather than invest time in workarounds that will evaporate over time. This library actually works with AndroidX anyway, from what I can tell: https://github.com/mikehardy/rn-androidx-demo/blob/master/make-demo.sh#L45 (that's the CI suite for jetifier, which is used by everyone on react-native 60)
For anyone encountering this later, the latest version of react-native-push-notification is now 3.1.9. I had to pin this lib to 3.1.3 ("react-native-push-notification": "3.1.3" in the dependencies part of package.json), otherwise none of the solutions on this issue or related would work. Then https://github.com/zo0r/react-native-push-notification/issues/1109#issuecomment-506414941 did it for me. I'm using React-Native 0.58.2 if it matters.
Last I checked the AndroidX + Jetifier stuff is a more painful road to go down; hopefully that'll change later. I don't even know what AndroidX is. If I actually learned the background behind every error I've encountered in my RN setup (there have been many), I'd never have time to develop my app. Well, this lib works now. Thanks.
Wow, I can't imagine having a project consistently working without any curiosity - because yes there are many errors, but I'm not replying to debate on that. Do what you need with priorities. Just saying that AndroidX really is inevitable. You must schedule some time eventually to ingest the change from react-native 0.59 to 0.60, and move to AndroidX. Whether it seems interesting or useful at the moment or not. This one is a big deal.
This site can help get you through the transitions, I recommend looking at the diff between each single version and applying them then making sure things still work: https://react-native-community.github.io/upgrade-helper/
As an example why, older versions of this might work, but then "that" (for a concrete example: firebase performance SDK on iOS13) needs an update to fix a crash bug, but it's tied to firebase cloud messaging at a modern version, which means the react-native module that uses it needs a modern version, which pulls in the modern (AndroidX) versions on the Android side, and...there you go. Can be avoided for a while but if it's not on the roadmap when you can do it without being under pressure, eventually it will become a hard requirement under a lot of pressure. But as ever and sincerely, I just want success for everyone's projects.
I think building successfully with Xcode 11 (which was a react-native 0.60 feature I think?) may actually already be one of those version step changes - where you need react-native 0.60 to work correctly with Xcode 11, which is needed for iOS13 features, but then it pulls in AndroidX and poof, there goes a couple days, but then at least it's done...
If I remember correctly (this was months ago and before Xcode 11), either 60.0 or AndroidX was incompatible with a lot of my other deps. Seemed that everything I installed had some issue whose temp solution was to pin to <60.0. It's possible that this has since changed, and at some point I'm going to do a mass update.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 30 days if no further activity occurs. Thank you for your contributions.
Most helpful comment
This is a shit update