android - Why R.java disappears (R cannot be resolved error)? -
android - Why R.java disappears (R cannot be resolved error)? -
this question has reply here:
r cannot resolved - android error 99 answersi know mutual problem , read previous posts project working fine , after added radio button ruined interface deleted radio button , interface contents (like edit-texts , button) , added them again. interface fine.
the mainactivity.java did not recognize radio button (although import android.widget.radiogroup; import android.widget.radiobutton; there) cleaned project because wanted r.java updated then, r.java disappears , console shows image
things have tried : re-clean project prepare project portieres
this main_activity.xml
<relativelayout xmlns:tools="http://schemas.android.com/tools" xmlns:android="http://schemas.android.com/apk/res/android" 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="com.example.reg.mainactivity" > <edittext android:id="@+id/edittext1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignparentright="true" android:layout_alignparenttop="true" android:layout_margintop="14dp" android:ems="10" android:imeoptions="flagnoextractui" android:inputtype="textpersonname" > <requestfocus /> </edittext> <radiogroup android:id="@+id/radiogroup1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_below="@+id/edittext1" android:layout_centerhorizontal="true" android:orientation="horizontal" > <radiobutton android:id="@+id/radio1" android:layout_width="wrap_content" android:layout_height="wrap_content" /> <radiobutton android:id="@+id/radio2" android:layout_width="wrap_content" android:layout_height="wrap_content" /> </radiogroup> <edittext android:id="@+id/edittext2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignleft="@+id/edittext1" android:layout_below="@+id/radiogroup1" android:layout_margintop="24dp" android:ems="10" android:imeoptions="flagnoextractui" android:inputtype="textemailaddress" > </edittext> <edittext android:id="@+id/edittext3" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_above="@+id/edittext4" android:layout_alignleft="@+id/edittext2" android:layout_marginbottom="18dp" android:ems="10" android:imeoptions="flagnoextractui" android:inputtype="textemailaddress" /> <edittext android:id="@+id/edittext4" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignparentright="true" android:layout_centervertical="true" android:ems="10" android:imeoptions="flagnoextractui" android:inputtype="textpassword" /> <edittext android:id="@+id/edittext5" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignleft="@+id/edittext4" android:layout_below="@+id/edittext4" android:layout_margintop="25dp" android:ems="10" android:inputtype="date" /> <edittext android:id="@+id/edittext6" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignleft="@+id/edittext5" android:layout_below="@+id/edittext5" android:layout_margintop="20dp" android:ems="10" android:inputtype="textemailaddress"/> <button android:id="@+id/button1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignparentbottom="true" android:layout_centerhorizontal="true" android:layout_marginbottom="28dp" /> </relativelayout>
please justify answer, beginner
update works when alter target 21 want 20
i think confused issue, logcat says getting issues while importing support-v7-appcompat library , saying , there no r.java
i think getting issues while adding support-v7-appcompat library , might affecting r.java
please follow below steps add together lib
ollow instructions in back upwards library setup - adding libraries resources. 1 thing can bring uncertainty add together library aplicattion project:
(1) in project explorer, right-click project , select properties. (2) @ left pane select android. (3) @ th bottom of right pane click add together (4) select library project android-support-v7-appcompat , click ok. click ok close properties window.
if not of errors mentioned it´s done.
however if me, dont´t followed advice of android team suggests compile source using latest sdk, error.
the error ocurrs because project build target android 2.3.3 , need @ lest 3.0. not clear me because of fact i'm developing android 2.3.3 , i'm using back upwards libraries.
ok, hope helps.
java android xml android-support-library r.java-file
Comments
Post a Comment