Open ghonche opened 1 year ago
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:
@capacitor-community/app-icon
3.1.0-beta.0
-1
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
activity-alias
<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.
Screenshots Console log:
Smartphone
Additional context
Any help is appreciated.
@ghonche There are some known issues with the beta version of the plugin and certain versions of Android. I'll try making an AVD with the settings you mentioned and see if I can get anymore info on your error.
Describe the bug
I'm using
@capacitor-community/app-icon
version3.1.0-beta.0
in my android project. Following code returns-1
asresponse
:And app icon doesn't change.
I added
activity
andactivity-alias
to AndroidManifest.xml like this:Expected behavior AppIcon.change('icon_name') must change the app icon.
Screenshots Console log:
Smartphone
Additional context
Any help is appreciated.