OpenNative / open-native

Open Native brings cross-platform communities together to help them collaborate and strengthen each other through development diversity.
https://open-native.org/
MIT License
459 stars 8 forks source link

Error implementing @react-native-firebase/messaging on Android #7

Closed vallemar closed 1 year ago

vallemar commented 2 years ago

I am trying to implement @react-native-firebase/messaging, the required RN packages are as follows:

@react-native-firebase/app
@react-native-firebase/messaging

The error I have when building the application is the following:

:react-native-firebase_app package.json found at C:\workspaces\abll\abll\abll-monorepo\apps\abll-app\node_modules\@react-native-firebase\app\package.json
:react-native-firebase_app:firebase.bom using default value: 31.0.2
:react-native-firebase_app:play.play-services-auth using default value: 20.3.0
:react-native-firebase_app package.json found at C:\workspaces\abll\abll\abll-monorepo\apps\abll-app\node_modules\@react-native-firebase\app\package.json
:react-native-firebase_app:version set from package.json: 16.4.3 (16,4,3 - 16004003)
:react-native-firebase_app:android.compileSdk using default value: 33
:react-native-firebase_app:android.targetSdk using default value: 33
:react-native-firebase_app:android.minSdk using default value: 19
:react-native-firebase_app:reactNativeAndroidDir C:\workspaces\abll\abll\abll-monorepo\apps\abll-app\node_modules\react-native\android
:react-native-firebase_messaging package.json found at C:\workspaces\abll\abll\abll-monorepo\apps\abll-app\node_modules\@react-native-firebase\messaging\package.json
:react-native-firebase_app package.json found at C:\workspaces\abll\abll\abll-monorepo\apps\abll-app\node_modules\@react-native-firebase\app\package.json
:react-native-firebase_messaging:firebase.bom using default value: 31.0.2
:react-native-firebase_messaging package.json found at C:\workspaces\abll\abll\abll-monorepo\apps\abll-app\node_modules\@react-native-firebase\messaging\package.json
:react-native-firebase_messaging:version set from package.json: 16.4.3 (16,4,3 - 16004003)
:react-native-firebase_messaging:android.compileSdk using default value: 33
:react-native-firebase_messaging:android.targetSdk using default value: 33
:react-native-firebase_messaging:android.minSdk using default value: 19
:react-native-firebase_messaging:reactNativeAndroidDir C:\workspaces\abll\abll\abll-monorepo\apps\abll-app\node_modules\react-native\android

Build file 'C:\workspaces\abll\abll\abll-monorepo\apps\abll-app\platforms\android\app\build.gradle' line: 575
A problem occurred configuring project ':app'.
Could not find any matches for com.facebook.react:react-native:+ as no versions of com.facebook.react:react-native are available.
Required by:
    project :app > project :react-native-firebase_app
    project :app > project :react-native-firebase_messaging

If you need anything else let me know

mikehardy commented 2 years ago

@vallemar hey there :wave: react-native-firebase maintainer here. This looks more like https://github.com/facebook/react-native/issues/35210 then anything else, you might look into your react-native dependency to make sure it is resolving correctly based on the error message.

ammarahm-ed commented 2 years ago

Hey @vallemar you probably missed doing the following configuration in before-plugins.gradle file: https://github.com/OpenNative/open-native/tree/main/packages/core#android-setup

I think the readme setup is a little confusing right now & will work on improving it hopefully as I get sometime. Thanks @mikehardy for hoping in to help!

Btw right now open-native is missing one api, Headless JS Tasks Service which need to be added before react-native-firebase/@notifee libraries can work with Open Native.

vallemar commented 2 years ago

@ammarahm-ed oh! I had not seen this documentation. I had done directly what is in the general Readme.md of the project. If I think it would be good to change this doc and add everything necessary in the general, if not, I think that this will happen to many people. Thank you very much!