Android-support-v4 error generated while erasing R.java

ok, the following steps:

1 - create a new project from an existing source

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

3-coating

So, my beautiful eclipse creates a project, but it erases the R.java class from gen, so I get errors from every class in the package. I thing

Also, style.xml gives me some error.

This kills me because I can’t learn anything from this for 3 days and I can’t help my google friend.

thanks in advance!

+6
source share
4 answers

I tried the same in Eclipse, and I saw in most files, there was a failed import:

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

So what I did to fix this was:

  • Right-click on your project ("Support4Demos") in the left navigation menu.
  • Click "Properties."
  • Click "Java Build Path" in the left navigation pane.
  • Click the "Add External Banks" button on the right.
  • Go to: "\ android-sdk \ extras \ android \ compatible \ v4"
  • Select "android-support-v4.jar", then click "Open," then click "OK."
  • Left-click on your project ("Support4Demos").
  • Click "Project" at the top, then click "Clear", then click "Good."

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

EDIT:
Try the following:

  • Right click on your project and select "Properties"
  • Select "Android."
  • Make sure it is installed on Android 3.2 or higher.

Android 3.2 was when the Holo theme was introduced.

+10
source

With the release of ADT 17.0.0, you must put the android-support-vX.jar in /libs , and if you want to apply the Holo theme in your application, you must make targetSDKversion in AndroidManifest.xml equal to 11 minimum

+1
source

R.java has left due to an error in the style.xml file. Correct the error in Style.xml and R will be able to regenerate, and everything should be swelling.

EDIT:

Then go to:

Project β†’ Clear

0
source

I turned off automatic updating, deleted the bin and gen folder, cleaned it (it will give an error to just ignore it), fixed the project settings, added the compatibility library, and then it worked :)

0
source

Source: https://habr.com/ru/post/901850/


All Articles