0

I'm trying to add a launcher icon to my android app. I have watched multiple tutorials online that explain how that works. I ended up doing it this way: https://www.youtube.com/watch?v=DQ8HDL-X9rM

The laucher icon does appears in the android simulator but not on physical phones. what I have tried to do:

  • clean the build in android studio
  • reset the icon the way it says in the tutorial
  • checked the reference in android manifest
  • checked if the icon was changed in the drawable and mipmap folders

that were the tips that showed up in a stackoverflow topic a couple years back. I have been working on it for the passed week and I just can't get it to work.

This is my ic_launcher.xml

<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
   <background android:drawable="@color/ic_launcher_background"/>
   <foreground android:drawable="@mipmap/ic_launcher"/>
</adaptive-icon>

And this is this are the lines in my AndroidManifest

    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"

        <activity android:name="com.example.fragments.Product">
           <meta-data
              android:name="android.support.PARENT_ACTIVITY"
              android:value="com.example.MainActivity" />
        </activity>
        <activity android:name="com.example.MainActivity">
           <intent-filter>
              <category android:name="android.intent.category.LAUNCHER" />
              <action android:name="android.intent.action.MAIN" />
           </intent-filter>
        </activity>
    </application>

Also I checked all the mipmap folders and all my icons are in there with the correct names.

Does anyone know what I can do?

---update june 3---

Now its not even showing up on the emulator anymore... I have tried and read all the topics online I really hope someone can spot what I do wrong

chrispsv
  • 503
  • 1
  • 3
  • 21

1 Answers1

2

You can simple way to add icon for app

go to project app->res->drawable->right click->new->image asset-> source asset select image path and click to next button RUN the app

another way

Elango
  • 406
  • 3
  • 11
  • I dont know if you will ever believe me but I have tried that literally more then 5 times... But now after your reaction I did it again and it works. Thank you very much!! I did always click on app -> res -> mipmap instead of drawable. Maybe that was the problem? – chrispsv Jun 03 '21 at 12:02