Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android Manifest issue #23

Open
Ritesh175862 opened this issue Nov 26, 2021 · 9 comments
Open

Android Manifest issue #23

Ritesh175862 opened this issue Nov 26, 2021 · 9 comments

Comments

@Ritesh175862
Copy link

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.

@patrick-samy
Copy link

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

@samjoshuva
Copy link

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.

@codebin-pune
Copy link

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

@Ritesh175862
Copy link
Author

@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
Copy link
Author

@patrick-samy yes

@codebin-pune
Copy link

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

@Ritesh175862
Copy link
Author

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

@codebin-pune
Copy link

Hi @Nikolas1814 @DimitarNestorov,

Can you please look into it?

Thanks

@dnlbox
Copy link

dnlbox commented Jul 12, 2023

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>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants