Bisclavret
Bisclavret

Reputation: 1351

Flutter: AndroidManifest.xml various issues

Just trying to get my app ready for publishing and the resources online are absolutely awful.

In my AndroidManifest.xml file I have my

<application
    android:name="io.flutter.app.FlutterApplication"
    android:label="My App"
    android:icon="@mipmap/ic_launcher">

The compiler is having a tantrum because it doesn't understand "@mipmap/ic_launcher". I have followed all the documentation for this and my ic_launcher.png file is in every one of the mipmap folders under android\app\src\main\res. I even created a new folder just called mipmap, but nothing works.

There is no other information about this so I am at a loss. Can anyone assist?

Upvotes: 2

Views: 2063

Answers (1)

roipeker
roipeker

Reputation: 1243

What you did is fine, when you use the @mipmap/ path it means all folders for the Android buckets sizes. So, unless you use "svg" assets, that's the way to go for the icon (and other bitmap assets).

Maybe by accident you removed a line from the xml, or delete a file... My advise: start a new project, and use a tool like appicon to generate those files for you. Run the default Flutter project (to check that it works), replace the files with the ones from the exported zip, and test this default app in --profile or --release mode to see if it compiles and shows the correct icons/splashes.

Then, if you made a lot of work in your current (broken) project, put back the pubspec.yaml, lib/ and assets folder in this new project.

Good luck!

Upvotes: 1

Related Questions