flutter_local_notifications: The resource ic_launcher could not be found

flutter_local_notifications - Unhandled Exception: PlatformException(INVALID_ICON, The resource ic_launcher could not be found. Please make sure it has been added as a drawable resource to your Android head project., null, null)

Tagged:

Answers

  • Step 1:
    Add your icon to [projectFolder]/android/app/src/main/res/drawable (for example ic_launcher.png)

    Step 2:
    Go to [projectFolder]/android/app/src/main/AndroidManifest.xml and add the attribute android:icon="@mipmap/ic_launcher" in activity tag.

    <activity
                android:name=".MainActivity"
                android:icon="@mipmap/ic_launcher"
    ...
    >
    </activity>
    

    Step 3:
    and use that name here:

    final AndroidInitializationSettings initializationSettingsAndroid = AndroidInitializationSettings('@mipmap/ic_launcher');
    
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!