All projects I put into Eclipse do not read any of the layouts or button references I have.
Layout references like (R.layout.main) and button references like (R.id.namebutton)
all have a “cannot be resolved or is not a field” warning that applies to all button and layout references.
They all worked last night. I have all my XML files in the layout folder and each button has the android:id="@+id/" line in the XML. Yet the warnings remain.
What could it be causing this?
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.Zohan.hozo"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="8" />
<uses-permission android:name="android.permission.CALL_PHONE"/>
<application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name" >
<activity
android:name=".ZohanActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".MacAttack"
android:label="@string/app_name" >
</activity>
<activity
android:name=".ConsultationReq"
android:label="@string/app_name" >
</activity>
</application>
</manifest>
As previously said, R.layout.* and R.id.* and all the R.* refer to an Android-SDK-generated class called R, which is to be in gen/. In case it is not you may have:
– errors in your xml layout files
– errors in your android manifest file
– errors elsewhere.
In case you HAD errors in these files, that you fixed them and it still doesn’t work, try project->clean in Eclipse, that should update the dependencies.