Android Studio中Manifest未识别图标资源问题求助
Hey there, let's work through this launcher icon issue together—this is a super common snag, so we'll get it sorted quickly!
Here are the most likely fixes to try, in order of simplicity:
Double-check your mipmap files and folders
Make sure yourres/mipmap-*folders (likemipmap-mdpi,mipmap-hdpi, etc.) actually contain an icon file namedic_launcher(either.pngor a vector.xmlfile). Remember: Android resource names are case-sensitive, soIC_Launcheroric_launcher_won't match. You don't need every density folder filled, but at least one valid icon in a mipmap folder is required.Verify your Manifest reference
Open yourAndroidManifest.xmland check the<application>tag'sandroid:iconattribute. It should exactly match your resource name:<application android:icon="@mipmap/ic_launcher" android:label="@string/app_name" <!-- other attributes --> > <!-- app components --> </application>Watch out for typos—like writing
@drawable/ic_launcherinstead of@mipmap/ic_launcher, or misspelling the icon filename.Clean and rebuild your project
Android Studio's cache can sometimes hold onto old or incorrect resource data. Head to the top menu:- Click
Build > Clean Project - Once that finishes, click
Build > Rebuild Project
This forces the IDE to recompile all resources from scratch, which often fixes "missing resource" false positives.
- Click
Check for corrupted or invalid resource files
If you're using a vector asset (ic_launcher.xml), open it up and make sure there are no syntax errors (like unclosed tags or invalid attributes). If it's a bitmap, confirm the image file isn't corrupted—try opening it in an image viewer to be sure.Validate your module's resource path configuration
Open your app module'sbuild.gradlefile (not the root project one) and check that thesourceSetssection points to your correctresfolder:android { sourceSets { main { res.srcDirs = ['src/main/res'] } } }If this path is wrong, the IDE won't be able to find any of your resources, including the launcher icon.
If none of these work, you can try deleting the .idea folder and build folder in your project, then re-importing the project into Android Studio—this clears out all cached data and starts fresh.
内容的提问来源于stack exchange,提问作者Louis Evans

