react-native-push-notification icon indicating copy to clipboard operation
react-native-push-notification copied to clipboard

AndroidManifest.xml:22:18-91 Error:

Open Ethan0007 opened this issue 7 years ago • 40 comments

Hi,

When configuring the push notification in the fresh project and run the application i got this error:

Error: 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"' to element at AndroidManifest.xml:7:5-117 to override.

"react-native": "0.59.9", "react-native-push-notification": "3.1.3",

Ethan0007 avatar Jun 18 '19 07:06 Ethan0007

I came to post about this too. Seems to be a new problem from today, due to a new gms version. Same problem is being discussed for react-native-device-info, where they already have a PR up https://github.com/react-native-community/react-native-device-info/pull/693/commits/ec930b3f61da83e46cd70ecd108e0fe7a873fcb0.

This same change makes react-native-push-notification work too, from my own testing, so hopefully that helps you for now, too.

melissamcdougall avatar Jun 18 '19 07:06 melissamcdougall

same issue here. @mattimck I just changed the gms version in build.gradle of react-native-push-notificatoin as the link. but It didn't work. Could you explain how to apply it?

uropsm avatar Jun 18 '19 08:06 uropsm

with @mattimck 's solution, I also changed firebase version to 17.6.0 and build is success. Don't know yet if it works.

uropsm avatar Jun 18 '19 09:06 uropsm

FYI, PR is here https://github.com/zo0r/react-native-push-notification/pull/1092

melissamcdougall avatar Jun 18 '19 09:06 melissamcdougall

after watching @mattimck 's solution, I changed one but it came with error 'Could not find com.google.firebase:firebase-messaging:16.1.0.' so I changed firebase version to 17.6.0, but it did not help. keeps showing same error.

pram11 avatar Jun 18 '19 09:06 pram11

implementation "com.google.android.gms:play-services-gcm:${safeExtGet('googlePlayServicesVersion', '16.1.0')}" implementation "com.google.firebase:firebase-messaging:${safeExtGet('firebaseVersion', '17.6.0')}"

uropsm avatar Jun 18 '19 09:06 uropsm

Yep @pram11 , as @uropsm said, it should just be googlePlayServicesVersion that needs to be changed from + to 16.1.0. I didn't seem to need to change firebase at all, since it was already defined as a specific version, but curious how you go with it.

melissamcdougall avatar Jun 18 '19 09:06 melissamcdougall

oh, I found I changed some before check this article. :)

pram11 avatar Jun 18 '19 09:06 pram11

I had the same situation as @uropsm - just changing googlePlayServicesVersion wasn't enough, I also needed to change the firebaseVersion.

jakubukrop avatar Jun 18 '19 09:06 jakubukrop

I don't know the details well. but the problem is today's release(of firebase-messaging, play-services-gcm) started supporting andoridx. Supporting androidx causes the error.

So need to fix to previous version. com.google.firebase:firebase-messaging:17.6.0 com.google.android.gms:play-services-gcm:16.1.0

uropsm avatar Jun 18 '19 09:06 uropsm

Hi,

the problem is that when we include the implementation project(':react-native-push-notification') in app/build.gradle , i already update the com.google.firebase:firebase-messaging:17.6.0 com.google.android.gms:play-services-gcm:16.1.0, but when building the app, got same issue.

thanks.

Ethan0007 avatar Jun 18 '19 09:06 Ethan0007

@Ethan0007 did you clean project after changing? cd /yourproject/android ./gradlew clean cd .. react-native run-android

uropsm avatar Jun 18 '19 09:06 uropsm

@uropsm yes sir, i do clean,

by the way this is my app/build.gradle,

Screen Shot 2019-06-18 at 5 00 23 PM

and build.gradle: Screen Shot 2019-06-18 at 5 01 43 PM

is it necessary to add play-service-base and play-service-gcm?

Ethan0007 avatar Jun 18 '19 10:06 Ethan0007

@uropsm but when i comment implementation project(':react-native-push-notification') my application works. but suddenly when i include it it give an same error above.

Ethan0007 avatar Jun 18 '19 10:06 Ethan0007

@Ethan0007 I changed node_modules/react-native-push-notification/andorid/build.gradle not my project build.gradle

uropsm avatar Jun 18 '19 10:06 uropsm

I had the same situation as @uropsm - just changing googlePlayServicesVersion wasn't enough, I also needed to change the firebaseVersion.

Quite right - apologies for bad information above. When I got home from work, discovered I also needed to fix the firebase version 👍

melissamcdougall avatar Jun 18 '19 10:06 melissamcdougall

@uropsm sir, where did i put node_modules/react-native-push-notification/andorid/build.gradle ?

Ethan0007 avatar Jun 18 '19 10:06 Ethan0007

@uropsm in app/build.gradle you can use this

dependencies {
    compile "com.google.android.gms:play-services-gcm:16.1.0"
    compile "com.google.firebase:firebase-messaging:17.6.0"
    compile (project(':react-native-push-notification')) {
        exclude group: "com.google.android.gms", module: "play-services-gcm"
        exclude group: "com.google.firebase", module: "firebase-messaging"
    }
    ...
}

duongtungls avatar Jun 18 '19 10:06 duongtungls

its working. thanks!

Ethan0007 avatar Jun 18 '19 10:06 Ethan0007

Getting this error after running yarn start (already used the listed fix):

events.js:183
      throw er; // Unhandled 'error' event
      ^

Error: listen EADDRINUSE :::8081
    at Server.setupListenHandle [as _listen2] (net.js:1360:14)
    at listenInCluster (net.js:1401:12)
    at Server.listen (net.js:1485:7)
    at Promise (/home/virtumonde/Desktop/Development/InvestmentClicker1.0 (another copy)/node_modules/metro/src/index.js:253:20)
    at new Promise (<anonymous>)
    at Object.<anonymous> (/home/virtumonde/Desktop/Development/InvestmentClicker1.0 (another copy)/node_modules/metro/src/index.js:252:14)
    at Generator.next (<anonymous>)
    at asyncGeneratorStep (/home/virtumonde/Desktop/Development/InvestmentClicker1.0 (another copy)/node_modules/metro/src/index.js:46:24)
    at _next (/home/virtumonde/Desktop/Development/InvestmentClicker1.0 (another copy)/node_modules/metro/src/index.js:66:9)
    at <anonymous>
error Command failed with exit code 1.

Is someone else getting this?

dclipca avatar Jun 18 '19 10:06 dclipca