codemotionapps/react-native-help-scout

Android Manifest issue

Ritesh175862 opened this issue · 9 comments

Manifest merger failed : Attribute meta-data#com.google.firebase.messaging.default_notification_channel_id@value value=() from [:react-native-firebase_messaging] AndroidManifest.xml:39:13-29
is also present at [com.helpscout:beacon-ui:2.0.2] AndroidManifest.xml:74:13-70 value=(@string/hs_beacon_notification_channel_id).
Suggestion: add 'tools:replace="android:value"' to element at AndroidManifest.xml:37:9-39:32 to override.

Hi @Ritesh175862, were you able to solve this issue?

getting same issue, found any working solution

Attribute meta-data#com.google.firebase.messaging.default_notification_channel_id@value value=(@string/hs_beacon_notification_channel_id) from [com.helpscout:beacon-ui:2.0.2] AndroidManifest.xml:74:13-70 is also present at [:react-native-firebase_messaging] AndroidManifest.xml:39:13-29 value=(). Suggestion: add 'tools:replace="android:value"' to <meta-data> element at AndroidManifest.xml:72:9-74:73 to override.

We are also facing same issue. Tried multiple options but still does not get any solution.

@codebin-pune open android folder in android studio and search the react-native-firebase_messaging
2:open androidmenifest which is inside react-native-firebase_messaging
3:comment this meta data which has default channel id
4:run android

@Ritesh175862 This is one time solution i guess, This change will remove every time after yarn install.

@codebin-pune yes, currently the repo has not any other solution,

Hi @Nikolas1814 @DimitarNestorov,

Can you please look into it?

Thanks

dnlbox commented

This is what it works for me.

Change app/src/main/AndroidManifest.xml and add the following:
In the top

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    package="your.packaging.name">

Inside the application tag:

<meta-data
      android:name="com.google.firebase.messaging.default_notification_channel_id"
      android:value="@string/default_notification_channel_id"
      tools:replace="android:value" />

In the end should look similar to this:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    package="your.packaging.name">

    <uses-permission android:name="android.permission.INTERNET" />

    <application
        android:name=".MainApplication"
        android:label="@string/app_name"
        android:icon="@mipmap/ic_launcher"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:allowBackup="false"
        android:theme="@style/AppTheme">

        <activity
            android:name=".MainActivity"
            android:label="@string/app_name"
            android:configChanges="keyboard|keyboardHidden|orientation|.........your other configs"
            android:launchMode="singleTask"
            android:windowSoftInputMode="adjustResize"
            android:exported="true">

            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>

        </activity>

        <meta-data
            android:name="com.google.firebase.messaging.default_notification_channel_id"
            android:value="@string/default_notification_channel_id"
            tools:replace="android:value" />

    </application>

</manifest>

The right place to put the replaced value is in the strings.xml so lets go there and also add the string missing.
In the app/src/main/res/values/string.xml add the following:

<string name="default_notification_channel_id" translatable="false">your default channel</string>

Normally the default channel is fcm_default_channel but double check in your project.
Your strings.xml should look like this in the end.

<resources>
    <string name="app_name">App Name</string>
    <string name="default_notification_channel_id" translatable="false">fcm_default_channel</string>
</resources>