I have tried all that i could to generate the R.java file but in vain. I have just created an android project and while creating the android project it isn't creating R.java file ! There were compilation errors in my project as i still had to add the android.jar file to my project but even after adding the jar file, cleaning the existing build and again building it didn't work.
Then i checked the 'build automatically' option in eclipse. Even that didn't help !
Few things to be noted :
1)I have created the android project with build-target android 2.2 and API version 8.
2)I would like to tell is while creating the project it gives an error saying proguard.cfg not found ! I couldn't locate 'default.properties' file to delete the entry which refers to proguard.cfg entry.
3)JAVA_HOME in my environment variables is pointing to jdk1.4. Dunno whether this should be the reason !
4)Contents of
1.main.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/hello"
/>
</LinearLayout>
2.strings.xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="hello">Hello World, HelloAndroidActivity!</string>
<string name="app_name">Hello, Android !!</string>
</resources>
3.AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.pack.android.test"
android:versionCode="1"
android:versionName="1.0">
<uses-sdk android:minSdkVersion="8" />
<application android:icon="@drawable/icon" android:label="@string/app_name">
<activity android:name=".HelloAndroidActivity"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
4.Code for HelloWorldActivity.java
package com.pack.android.test;
import android.app.Activity;
import android.os.Bundle;
public class HelloAndroidActivity extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
}
}
Attached are the images for
Please help me out. I have just started with the Hello World application :)
Thanks, Adithya
R.java might not be generated because you have other errors in your code not related to the R file. So check if you have these errors, fix them, and clean your project.
Make sure you have updated the SDK as well. Get platform-tools and build-tools 22.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With