-2

enter image description hereI am new to android. I just created a project in android studio and having problem in its manifest.xml. The error is in

android:icon="@mipmap/ic_launcher 

it is not able to resolve this symbol. I am on android studio 1.2.11

3 Answers3

0

Replace

android:icon="@mipmap/ic_launcher 

with

android:icon="@drawable/ic_launcher"

That is, your manifest should look like

<?xml version="1.0" encoding="utf-8"?>
    <manifest xmlns:android="http://schemas.android.com/apk/res/android"
              package="com.org.yourpackage" >
    <application
     android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        <activity
            android:name=".YourStartingActivity"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>

    </application>

</manifest>

UPDATE

Try,

Go to File > Invalidate Caches / Restart and Invalidate and Restart

in Android Studio.

Lal
  • 14,726
  • 4
  • 45
  • 70
  • Thanks, but it didn't work for me. My drawable folder doesn't have any file in it. I tried to copy and paste images from mipmap folder this didn't work either. – Akash Khandelwal Oct 28 '15 at 05:53
  • My manifest is same as above. but when I change mipmap to drawable .it shows the same error i.e cannot resolve the symbol drawable. one thing to metion-my res/drawable folder is empty – Akash Khandelwal Oct 28 '15 at 06:21
  • May be you have some other errors in your xml file..try to clean and build the app.. – Lal Oct 28 '15 at 06:29
  • I restarted and rebuilt a project with predetermined blank activity by studio . i didnt touch a single line of code got the same error. – Akash Khandelwal Oct 28 '15 at 06:45
  • is it showing a red underline below `android:icon`? is that the error? – Lal Oct 28 '15 at 07:04
  • before trying all others, please try this `Go to File > Invalidate Caches / Restart and Invalidate and Restart.` – Lal Oct 28 '15 at 08:35
  • Great..:) Glad that it helped.. @AkashKhandelwal..Could you please mark the answer as accepted if it really helped you.. – Lal Oct 28 '15 at 15:44
0

Look in the mipmap folder and see if the launcher icon is in there for the right resolution you are using . You can change it to "@/ic_launcher" where the folder is where your icon is.

Breakbeats
  • 26
  • 3
0

The mipmap folders are for placing your app icons in only. Any other drawable assets you use should be placed in the relevant drawable folders as before.

According to this Google blogpost:

It’s best practice to place your launcher icons in mipmap- folders (not the drawable- folders) because they are used at resolutions different from the device’s current density. When referencing the mipmap- folders ensure you are using the following reference:

android:icon="@mipmap/ic_launcher"

Add your launcher icons to mip map folder

Jithin Sunny
  • 3,352
  • 4
  • 26
  • 42