capacitor-community / app-icon

Capacitor plugin to programmatically change the app icon.
MIT License
78 stars 19 forks source link

Android Change Icon Bugs #48

Open Mohamed-ZiBox opened 10 months ago

Mohamed-ZiBox commented 10 months ago

When I change the app icon on my code, the app closed show App Keeps Stopping message, but after closing app icon changes.

Screenshot 2023-12-18 141718

johnborges commented 10 months ago

@Mohamed-ZiBox Can you provide more info? OS version, device, ext...

Mohamed-ZiBox commented 10 months ago

Android Version: 13 Devices: Android emulator (v13), Poco X3 Pro (v13), BlackView Tab 16 (v13), Samsung Galaxy A52s (v13), and more devices

This is My ApplicationManifest.xml code:

    <activity
      android:name="io.ionic.starter.MainActivity"
      android:exported="true"
      android:launchMode="singleTask"
      android:configChanges="keyboardHidden|keyboard|screenSize|locale|smallestScreenSize|screenLayout|uiMode"
      android:label="@string/title_activity_main"
      android:theme="@style/AppTheme.NoActionBarLaunch"
      android:screenOrientation="portrait"
    >
      <intent-filter>
        <action android:name="android.intent.action.MAIN" />
        <!-- <category android:name="android.intent.category.LAUNCHER" /> -->
      </intent-filter>
      <!-- Deeplink -->
      <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="https" android:host="example.app.io" />
      </intent-filter>
    </activity>

    <activity-alias
      android:label="@string/title_activity_main"
      android:icon="@drawable/logo"
      android:roundIcon="@drawable/logo"
      android:name=".logo"
      android:enabled="false"
      android:exported="true"
      android:targetActivity="io.ionic.starter.MainActivity">
      <intent-filter>
        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.LAUNCHER" />
      </intent-filter>
    </activity-alias>

    <activity-alias
      android:label="@string/title_activity_main"
      android:icon="@drawable/newyear"
      android:roundIcon="@drawable/newyear"
      android:name=".newyear"
      android:enabled="true"
      android:exported="true"
      android:targetActivity="io.ionic.starter.MainActivity">
      <intent-filter>
        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.LAUNCHER" />
      </intent-filter>
    </activity-alias>
IJustDev commented 3 days ago

I had a similar problem. You may have the issue that the disabled icons include the one that should be activated