Home > database >  agora-react-native-rtm is throwing issue related to merged manifest
agora-react-native-rtm is throwing issue related to merged manifest

Time:06-10

The dependencies used in the project are

  "dependencies": {
    "agora-react-native-rtm": "^1.5.0",
    "react": "17.0.2",
    "react-native": "0.68.2",
    "react-native-agora": "^3.7.0"
  },

Error log is

Note: Recompile with -Xlint:deprecation for details. D:\Desktop\Codes\AgoraDemo\agorademo\android\app\src\main\AndroidManifest.xml Error: android:exported needs to be explicitly specified for . Apps targeting Android 12 and higher are required to specify an explicit value for android:exported when the corresponding component has an intent filter defined. See https://developer.android.com/guide/topics/manifest/activity-element#exported for details.

Here is the manifest file:

<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|screenLayout|screenSize|smallestScreenSize|uiMode"
    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>
</application>

BTW: Project works fine if all the agora related dependencies is removed

CodePudding user response:

UPDATED: Can you add the following to your AndroidManifest.xml file then remove the build and re-run the project again.

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
   package="com.chatsapp">

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

   <application
     android:name=".MainApplication"
     android:allowBackup="false"
     android:icon="@mipmap/ic_launcher"
     android:label="@string/app_name"
     android:roundIcon="@mipmap/ic_launcher_round"
     android:theme="@style/AppTheme">
     <activity
        android:name=".MainActivity"
       android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
       android:label="@string/app_name"
       android:windowSoftInputMode="adjustResize">
       <intent-filter>
         <action android:name="android.intent.action.MAIN" />
         <category android:name="android.intent.category.LAUNCHER" />
       </intent-filter>
     </activity>
     <activity android:exported="true"
 android:name="com.facebook.react.devsupport.DevSettingsActivity" />
   </application>

 </manifest>

CodePudding user response:

Solution: For SDK 31 there is some issue with the "react-native-agora": "^3.7.0" version which will be fixed in a new one, meanwhile you can proceed with the workaround https://github.com/AgoraIO-Community/react-native-agora/issues/496#issuecomment-1126508840

  • Related