I just downloaded and installed the latest Android SDK and I want to create a simple engineering study.
The code created according to the wizard is as follows
Package Eu.mauriziopz.gps;import Android.app.activity;import Android.os.bundle;public class Ggps extends Activity { /** Called when the activity is first created. * /@Override public void OnCreate (Bundle savedinstancestate) { super.oncreate (savedinstancestate); Setcontentview (R.layout.main); }}
Eclipse Error
R cannot be resolved, R file not found
Error line
Setcontentview (R.layout.main);
What's the reason?
I'm in res/layout/. There is a XML file named Main.xml
Processing methods
This is a mistake. It happened to me when I created a branch with the Eclipse Wizard New Andorid Project, it error ' R cannot be resolved '. I have to comment out the Setcontentview & Getmenuinflater lines, and then eclipse automatically generates the R.java file after I can uncomment the Setcontentview & Getmenuinflater lines.
Original address: http://www.itmmd.com/201410/36.html
This article by Meng Meng's IT person to organize the release, reprint must indicate the source.
R cannot be resolved R file not found-Android error