Open Ammarlio opened 2 years ago
@Ammarlio please use v5 and try using the updated docs for the setup
@Ammarlio
I was facing the same issue, the solution was to pass package name into the ChangeIconPackage
constructor in MainApplication.java
file
@Override
protected List<ReactPackage> getPackages() {
List<ReactPackage> result = new ArrayList<ReactPackage>();
result.addAll(Arrays.<ReactPackage>asList(
...
new ChangeIconPackage("com.your.package")
));
}
P.S: In my project library linking in both iOS and Android is manual.
Hello @skb1129
I tried using your package and getting the same error on the PROD. When I tried to display system generated error to get more detail about the error, I got below error: " java.lang.SecurityException: Attempt to change component state; pid=5326, uid=10523, component=ComponentInfo{com.package-name/{com.package-name.MainActivityExpressShipColor} "
@mayyas-nakhli I've tried your solution as well but that's also not working.
@skb1129 Also updated to V5 and got this error.
Make sure your applicationId is correct in android/app/build.gradle. This mismatch can cause problems.
defaultConfig {
applicationId "com.yourapplicationid"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 1
versionName "1.0"
signingConfig signingConfigs.debug
vectorDrawables.useSupportLibrary = true
}
Thanks for your response I'll have a look into it and get back to you if it helps or not.
On Mon, 2 Oct 2023, 8:07 pm vimosan7, @.***> wrote:
Make sure your applicationId is correct in android/app/build.gradle. This mismatch can cause problems.
defaultConfig { applicationId "com.yourapplicationid" minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion versionCode 1 versionName "1.0" signingConfig signingConfigs.debug vectorDrawables.useSupportLibrary = true }
— Reply to this email directly, view it on GitHub https://github.com/skb1129/react-native-change-icon/issues/74#issuecomment-1743141234, or unsubscribe https://github.com/notifications/unsubscribe-auth/AE7ZQYKGEW2RZRGU35EE23DX5LGQZAVCNFSM6AAAAAARO6TK3CVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONBTGE2DCMRTGQ . You are receiving this because you commented.Message ID: @.***>
I'm facing issues to make changes in AndroidManifest.xml, when I'm having .SplashActivity (react-native-splash-screen). I tried multiple permutation-combination but either app is crashing or getting [Error:ICON_INVALID]. Current AndroidManifest.xml code is below and getting [Error:ICON_INVALID] error.
Thanks
<activity
android:name=".SplashActivity"
android:theme="@style/AppTheme"
android:label="@string/app_name"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
</intent-filter>
</activity>
<activity-alias
android:name="com.packagename.SplashActivityDefault"
android:enabled="true"
android:exported="true"
android:icon="@mipmap/ic_launcher"
android:roundIcon="@mipmap/ic_launcher"
android:targetActivity=".SplashActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
<action android:name="android.intent.action.DOWNLOAD_COMPLETE"/>
</intent-filter>
</activity-alias>
<activity-alias
android:name="com.packagename.SplashActivityXmas"
android:enabled="false"
android:exported="true"
android:icon="@mipmap/ic_launcher_xmas"
android:roundIcon="@mipmap/ic_launcher_xmas"
android:targetActivity=".SplashActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
<action android:name="android.intent.action.DOWNLOAD_COMPLETE"/>
</intent-filter>
</activity-alias>
<activity
android:name=".MainActivity"
android:label="@string/app_name"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize|uiMode"
android:launchMode="singleTask"
android:windowSoftInputMode="adjustResize"
android:screenOrientation="portrait"
android:theme="@style/AppTheme"
android:exported="true">
<intent-filter android:autoVerify="true">
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
<data android:scheme="http" />
<data android:scheme="https" />
</intent-filter>
</activity>
I use more than one variant. These types of applications give this error because of the package name, how should we use it?
tions give this error because of the package name, how
Have the same error. Do you resolve it
tions give this error because of the package name, how
Have the same error. Do you resolve it
Hello, I have the same error too, here is something can fix it:
final String activeClass = this.packageName + newIconName;
final String activeClass = "com.example.MainActivity" + newIconName;
I use more than one variant. These types of applications give this error because of the package name, how should we use it?
Had the same issue, this is because if you define a flavor with an applicationId, the packageName would become:
com.example.myapp.dev
but we need
com.example.myapp
I could solve it by removing the flavor in ChangeIconModule.java
on line 75
final String activeClass = this.packageName + ".MainActivity" + newIconName;
So i came up with this solution:
String activeClass = this.packageName + ".MainActivity" + newIconName;
if (activeClass.contains(".dev.")) {
activeClass = activeClass.replace(".dev.", ".");
}
Guess we need a way to detect flavors properly so they can be removed.
Platform
Description After Integrating and follow the same steps for Android, i am getting [Error: ICON_INVALID]. I did all the steps as the docs and all icons are valid. Anyway on IOS it works fine. Even if i am setting enable property to true in activity-alias for default icon, i am getting the same error.
To Reproduce Steps to reproduce the behavior:
Screenshots [Error: ICON_INVALID]
Device (please complete the following information):
Versions
Code Snippet <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.testdemo">