Cena Av
Cena Av

Reputation: 99

No resource found that matches the given name.dont load any drawable image

I put a background image in drawable folder and use it in background activity.

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent"
android:layout_height="match_parent" android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin"
tools:context=".MainActivity$PlaceholderFragment"
android:background="@drawable/background"
>

Every time I run the project, I get the following error:

C:\ASP\InstaFollowerPlus\app\src\main\res\layout\fragment_main.xml Error:(21, 29) No resource found that matches the given name (at 'background' with value '@drawable/background'). Error:Execution failed for task ':app:processDebugResources'.

com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'E:\Software\Computer engineer software\Android SDK full\sdk\build-tools\22.0.1\aapt.exe'' finished with non-zero exit value 1.

i tried Clean Project and failed.

compileSdkVersion 23, buildToolsVersion '22.0.1', Android Studio: 1.2.1.1

enter image description here

Upvotes: 0

Views: 1336

Answers (3)

Umar
Umar

Reputation: 1

If you use android:id="@+id/imageViewLogoTangan" to define imageID, then use the same (@+id/imageViewLogoTangan) in your another code

Upvotes: 0

IntelliJ Amiya
IntelliJ Amiya

Reputation: 75788

No resource found that matches the given name (at 'background' with value '@drawable/background').

  1. Please add images in your respective drawable folder first
  2. use compileSdkVersion 23, buildToolsVersion '23.0.1',

  3. Post your build.gradle please . Remove unwanted (Duplicate) File

  4. use Android Studio: 1.3 (Stable Version)

  5. Then Clean and build project And Sync Project

  6. Check your images are properly .PNG formatted or not

Upvotes: 3

Pravinsingh Waghela
Pravinsingh Waghela

Reputation: 2534

Rename the Image via right clicking on it and selecting the Refactor>Rename. And then run it it might run.

Upvotes: 0

Related Questions