I am currently using the react-native-change-icon package to change my application icon from within my app programmatically. It works perfectly on iOS but not that well on android... On first install my app only has one icon, which is from the tag in my manifest below. But when I change my icon through the changeIcon function provided by the react-native-change-icon package, my phone will have one icon from the tag and the other icon is from one of the two tags in my manifest. Thus, having two icons but both lead to the same app.
Below is my manifest file:-
<application android:name="com.testing_rn.MainApplication" android:allowBackup="false" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:networkSecurityConfig="@xml/network_security_config" android:roundIcon="@mipmap/ic_launcher_round" android:theme="@style/AppTheme"><activity android:name="com.testing_rn.SplashActivity" android:label="@string/app_name" android:launchMode="singleTask" android:theme="@style/SplashTheme"><intent-filter><action android:name="android.intent.action.MAIN" /><category android:name="android.intent.category.LAUNCHER" /></intent-filter></activity><activity android:name="com.testing_rn.MainActivity" android:configChanges="keyboard|keyboardHidden|orientation|screenSize|uiMode" android:exported="true" android:label="@string/app_name" android:launchMode="singleTask" android:windowSoftInputMode="adjustPan"></activity><activity-alias android:name="com.testing_rn.MainActivityori" android:enabled="false" android:icon="@mipmap/ori" android:targetActivity=".MainActivity"><intent-filter><action android:name="android.intent.action.MAIN" /><category android:name="android.intent.category.LAUNCHER" /></intent-filter></activity-alias><activity-alias android:name="com.testing_rn.MainActivityprivateicon" android:enabled="false" android:icon="@mipmap/privateicon" android:targetActivity=".MainActivity"><intent-filter><action android:name="android.intent.action.MAIN" /><category android:name="android.intent.category.LAUNCHER" /></intent-filter></activity-alias><activity android:name="com.facebook.react.devsupport.DevSettingsActivity" /></application>
Did I set something wrong in my manifest? When I use the changeIcon method on android, my app closes and crashes, is that the expected behavior on Android? Whereas on iOS, when I use the changeIcon method, it just pops out an alert that says I successfully changed the icon without crashing or closing the app.