Reputation: 10470
I put together a nice little flappy bird clone using libGDX and Android Studio. I figure change the my ic_launcher.png to something other that the default android robot icon would be simple. I was WRONG! It appears that changing the contents of that file is the HARDEST thing to do. Now when I try to run my project I get these error messages:
Information:Gradle tasks [clean, :android:generateDebugSources, :android:generateDebugAndroidTestSources]
:android:clean
:core:clean UP-TO-DATE
:desktop:clean UP-TO-DATE
:html:clean UP-TO-DATE
:ios:clean UP-TO-DATE
:android:preBuild UP-TO-DATE
:android:preDebugBuild UP-TO-DATE
:android:checkDebugManifest
:android:prepareDebugDependencies
:android:compileDebugAidl
:android:compileDebugRenderscript
:android:generateDebugBuildConfig
:android:generateDebugAssets UP-TO-DATE
:android:mergeDebugAssets
:android:generateDebugResValues UP-TO-DATE
:android:generateDebugResources
:android:mergeDebugResources
:android:processDebugManifest
:android:processDebugResources
C:\Users\plankton\Desktop\ThePlaneThatCouldntFly\flappyplankton\android\build\intermediates\manifests\full\debug\AndroidManifest.xml
Error:(13, 23) No resource found that matches the given name (at 'icon' with value '@drawable/ic_launcher.png').
Error:Execution failed for task ':android:processDebugResources'.
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Users\plankton\AppData\Local\Android\android-sdk\build-tools\20.0.0\aapt.exe'' finished with non-zero exit value 1
Information:BUILD FAILED
Information:Total time: 7.13 secs
Information:2 errors
Information:0 warnings
Information:See complete output in console
There seems to be no way to fix this problem? Why do people write worthless IDE's where doing the simplest thing breaks it? Geez I thought all I had to do was copy my cool icon over the crappy default one and I'd be done for the night and could go to bed BUT NO!!!!! Android Studio has to be a pile of crap.
Upvotes: 0
Views: 869
Reputation: 10470
Finally figured it out. I had to delete any 'build' directories that happened to have been generated and then I deleted the .gradle
and the .idea
directories in the top level of my project. I also made sure drawable
director was in the right place and that ic_laucher.png
contained image I want. Then I re-imported the project into Anduhoird Studio
.
Upvotes: 2
Reputation: 4940
No resource found that matches the given name (at 'icon' with value '@drawable/ic_launcher.png')
Have you checked and tripled checked that .png? Is it the right size? Does Android Studio actually see that file? Does it give you a suggestion when you starting typing @drawable? It may be that it needs several formats of ic_launcher.png for different pixel densities.
Upvotes: -1