0
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/BtnRecipe"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context="net.androidbootcamp.healthyrecipes.MainActivity" >

<TextView
    android:id="@+id/textView1"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignParentTop="true"
    android:layout_centerHorizontal="true"
    android:layout_marginTop="19dp"
    android:text="Guacamole Recipe"
    android:textSize="34sp" />

<Button
    android:id="@+id/button1"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_below="@+id/imageView1"
    android:layout_centerHorizontal="true"
    android:layout_marginTop="92dp"
    android:text="View Recipe"
    android:textSize="30sp" />

<ImageView
    android:id="@+id/imageView1"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignRight="@+id/button1"
    android:layout_below="@+id/textView1"
    android:layout_marginTop="48dp"
    android:src="@drawable/Guacamole" />

<ImageView
    android:id="@+id/imageView2"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_below="@+id/textView1"
    android:layout_centerHorizontal="true"
    android:src="@drawable/guacamole" />

This is my main activity. I am running Juno on windows 8.1.

I know "R cannot be resolved" has been asked so many times i just cannot find an answer that helps me. i have "R" errors on lines 14,21, and 31.

I also have the Error: No resource found that matches the given name (at 'src' with value '@drawable/Guacamole'). activity_main.xml line 32

I have a project due tomorrow and any help is greatly appreciated, if any has any tips on running Eclispe in 8.1 that would also be appreciated.

Sash_KP
  • 5,551
  • 2
  • 25
  • 34

3 Answers3

0

See you at your code again

<ImageView
android:id="@+id/imageView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignRight="@+id/button1"
android:layout_below="@+id/textView1"
android:layout_marginTop="48dp"
android:src="@drawable/Guacamole" />

<ImageView
android:id="@+id/imageView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/textView1"
android:layout_centerHorizontal="true"
android:src="@drawable/guacamole" />

in the second image view the @drawale/guacamoleis in small and in first one is big @drawable/Guacamole thats it.

SyedAliNaqi
  • 244
  • 1
  • 12
0

error become because you use incorrect name for your drawable.
drawable just can use lowwer case leeter (a-z and number,not start with number)

MHP
  • 2,613
  • 1
  • 16
  • 26
0

While naming images in res/drawable folder never use capital letters. You can use numbers but don't start the name with a number. In your case you have given Guacamole which has a capital 'G'.Change it so something else and use the same name in your layout as android:src="@drawable/somegoodname"

Also be sure that in your activity, you have not imported R.android., instead of import R.YOUR PACKAGE NAME..

If this doesn't solve your problem please refer r-cannot-be-resolved-android-error to find out various reasons of generating this error.

Community
  • 1
  • 1
Sash_KP
  • 5,551
  • 2
  • 25
  • 34