Question

ok, steps im following.

1-create new project from existing source

2-select Android\android-sdk\extras\android\compatibility\v4\samples\Support4Demos

3-finish

So, my beautiful eclipse creates the project but he erase the R.java class from gen so i get errors from every class of the package. I thing

Also, style.xml give me some error.

This is killing me because i can learn nothing from this for 3 days and i my friend google is not helping with this.

thx in advance!

Was it helpful?

Solution

I tried the same thing in Eclipse, and I saw on Most every file, there was a failed import:

import android.support.v4.app.DialogFragment;
import android.support.v4.app.FragmentActivity;

So, what I did to fix it, was:

  1. Right click on your project ("Support4Demos") in the navigation menu on the left.
  2. Click 'Properties'.
  3. Click 'Java Build Path' on the left hand navigation pane.
  4. Click 'Add External Jars' button on the right.
  5. Navigate to: "\android-sdk\extras\android\compatibility\v4"
  6. Choose "android-support-v4.jar", then click 'Open', then click 'Ok'.
  7. Left Click on your Project ("Support4Demos").
  8. Click 'Project' at the top, then click 'Clean', then click 'Ok'.

The last two steps might not be needed. But when you do all this, it may fix it. You would also need to fix any error in the XML file.

EDIT:
Try this:

  1. Right click on your project and choose "properties"
  2. Choose 'Android'.
  3. Make sure it's set on Android 3.2 or higher.

Android 3.2 was when the Holo theme was introduced.

OTHER TIPS

Since ADT 17.0.0 issue you should put android-support-vX.jar to /libs folder and if you want to apply Holo theme in your application you should make targetSDKversion in AndroidManifest.xmlequals 11 minimum

R.java is gone because of the error you have in style.xml. Fix the error in Style.xml and R will be able to regenerate and all shall be swell.

EDIT:

Then go to:

Project -> Clean

I disabeled automatic update, deleted bin and gen folder, cleaned (will give error just ignore), fixed project setup, added compatability library and then it worked :)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top