-
Notifications
You must be signed in to change notification settings - Fork 19
Open
Description
Describe the bug
I'm using @capacitor-community/app-icon version 3.1.0-beta.0 in my android project.
Following code returns -1 as response:
AppIcon.change({name: 'ic_launcher2', suppressNotification: true}).then(response =>{
console.log(response);
});
And app icon doesn't change.
I added activity and activity-alias to AndroidManifest.xml like this:
<activity android:exported="true" android:name="pro.lifa.app.MainActivity" android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|smallestScreenSize|screenLayout|uiMode" android:hardwareAccelerated="true" android:label="@string/title_activity_main" android:launchMode="singleTask" android:screenOrientation="portrait" android:theme="@style/AppTheme.NoActionBarLaunch" android:supportsPictureInPicture="true" android:windowSoftInputMode="adjustResize" tools:targetApi="n"> <intent-filter> <action android:name="android.intent.action.MAIN" /> </intent-filter> <intent-filter> <action android:name="android.intent.action.VIEW"/> <category android:name="android.intent.category.DEFAULT"/> <category android:name="android.intent.category.BROWSABLE"/> <data android:host="web.lifa.pro" android:scheme="https"/> <data android:host="web.lifa.pro" android:scheme="http"/> </intent-filter> </activity> <activity-alias android:label="@string/app_name" android:icon="@mipmap/ic_launcher" android:roundIcon="@mipmap/ic_launcher_round" android:name=".ic_launcher" android:enabled="true" android:exported="true" 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:label="@string/app_name" android:icon="@mipmap/ic_launcher2" android:roundIcon="@mipmap/ic_launcher2_round" android:name=".ic_launcher2" android:enabled="false" android:exported="true" android:targetActivity=".MainActivity"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity-alias>
Expected behavior
AppIcon.change('icon_name') must change the app icon.
Smartphone
- Device: Pixel 6 Emulator
- OS: android API 31
Additional context
- minSdkVersion = 22
- compileSdkVersion = 32
- targetSdkVersion = 32
Any help is appreciated.
Metadata
Metadata
Assignees
Labels
No labels
