Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

App icon doesn't show (Android Studio)

This is my very first time to make an android application. I've only made 3 designs for my very first app but every time I ran the Android Virtual Device, the icon of my app doesn't show up (the application itself :( ). Can someone help me about this? I am really new into this.

Here's my Manifest file. Thank you!

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="edu.sti.myactivity">

<application
    android:allowBackup="true"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:supportsRtl="true"
    android:theme="@style/AppTheme">
    <activity android:name=".Mylove">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
    <activity android:name=".RegisterActivity" />
    <activity android:name=".UserAreaActivity"></activity>
</application>

</manifest>

enter image description here

like image 255
Naomi Avatar asked Mar 11 '23 04:03

Naomi


2 Answers

I suggest to import you Icon in the Android Project like this:

Right click on your App folder and go to NEW -> Image Asset and upload the icon there. then it will show up.

Image Asset

You will be presented with this screen where you can simply select your icon.png

enter image description here

Furthermore it automatically scales the Icon in all the different screen densities!

Regarding the updated question:

Do the following things:

  • Make sure your code compiles correctly
  • Make sure the image icon is in mipmap folder, you should look for a folder named AndroidStudioProjects (by default) -> yourProjectName -> App -> src -> main -> res -> mipmap. also make sure that the mipmap folder has the screen density you need (e.g. xhdpi)
  • Use the Run Button on the top in android studio (Command-R on Mac) and make sure you select the right emulator

Anyway Importing the Icon as displayed above, avoids all this problems because it does everything for you.

Hope this helps!

like image 154
Daniele Avatar answered Mar 27 '23 12:03

Daniele


You should check on an android phone if you can download and play the app. If the problem is only with the emulator - it does get buggy, so the regular reinstalling the emulator/android studios, restarting your computer, trying to install a different emulator might work.

Otherwise:

The relevant line to look at is:

android:icon="@mipmap/ic_launcher"

This means that the app is going to the 'mipmap' folder inside your directory, and looking for a file named 'ic_launcher' - to display it as the App icon.

You need to make sure this file name exists in the proper folder, and is in the correct format(this guide might help )

How to find the image location folder

If this doesn't help: remember that icons can be displayed at different qualities for different devices (hdpi, mdpi, xhdpi....) so sometimes if you want to make your own icon you need to make sure it fits the requirements (in the above guide)

like image 22
yo1122 Avatar answered Mar 27 '23 11:03

yo1122