3

From today I am getting the below error while building the app from the android studio:

/Users/macm60/Desktop/mobile-app/android/app/src/debug/AndroidManifest.xml:15:13-72 Error:
Attribute provider#androidx.core.content.FileProvider@authorities value=(com.verygoodsecurity.vgsshow.provider) from [com.verygoodsecurity:vgsshow:1.2.0] AndroidManifest.xml:15:13-72
is also present at [io.intercom.android:intercom-sdk-base:15.1.6] AndroidManifest.xml:121:13-72 value=(com.today.development.IntercomFileProvider).
Suggestion: add 'tools:replace="android:authorities"' to <provider> element at AndroidManifest.xml:13:9-21:20 to override.

/Users/macm60/Desktop/mobile-app/android/app/src/debug/AndroidManifest.xml:44:17-55 Error:
    Attribute meta-data#android.support.FILE_PROVIDER_PATHS@resource value=(@xml/file_paths) from [:react-native-blob-util] AndroidManifest.xml:44:17-55
    is also present at [io.intercom.android:intercom-sdk-base:15.1.6] AndroidManifest.xml:126:17-60 value=(@xml/intercom_file_paths).
    Suggestion: add 'tools:replace="android:resource"' to <meta-data> element at AndroidManifest.xml to override.

See http://g.co/androidstudio/manifest-merger for more information about the manifest merger.

Last Friday app was successfully built from android studio.

This is related to @intercom/intercom-react-native 5.1.1 library manifest file. Let me know if anyone has an idea for this.

I have posted a temporary solution but let me know if have a permanent solution.

Jatin Bhuva
  • 1,301
  • 1
  • 4
  • 22

3 Answers3

1

In AndroidManifest.xml file of your project add below code:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
          xmlns:tools="http://schemas.android.com/tools"  <!-- this line-->
          package="com.xyz">

In <Application> tag add below:

<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"
  tools:node="replace">     <!-- this line-->
Jatin Bhuva
  • 1,301
  • 1
  • 4
  • 22
  • However, this causes another problem in my Flutter project. It makes crash with FirebaseSDK. Cause: java.util.concurrent.ExecutionException: java.util.concurrent.ExecutionException: java.lang.NullPointerException: Attempt to invoke virtual method 'com.google.firebase.auth.FirebaseUser com.google.firebase.auth.FirebaseAuth.getCurrentUser()' – Bansook Nam Aug 24 '23 at 01:42
1

In AndroidManifest.xml file in <Application> tag of your project add below code:

<provider
  android:name="androidx.core.content.FileProvider"
  android:authorities="${applicationId}.fileprovider"
  tools:replace="android:authorities">
  <meta-data
    android:name="android.support.FILE_PROVIDER_PATHS"
    android:resource="@xml/intercom_file_paths"
    tools:replace="android:resource" />
</provider>

probably this is better solution then just tools:node="replace" on application level

Vitalii Obideiko
  • 1,726
  • 1
  • 13
  • 16
0

Intercom recently launched Intercom-sdk-base 15.1.6 due to this this error is coming.

If anyone is facing this issue then, here is a temporary solution:

Goto -

node_modules/@intercom/intercom-react-native/android/build.gradle

then change this
implementation 'io.intercom.android:intercom-sdk:15.1.+'

to below:

implementation 'io.intercom.android:intercom-sdk:15.1.0'

or you can use any other version but not use 15.1.6.

Jatin Bhuva
  • 1,301
  • 1
  • 4
  • 22