Question

Guys is there any solution for stop adding appcompat_v7 in my project , I just want to update my android application by adding one activity in the project, I am using minimum SDK version 8 and using actionbarsherlock, every time I add any activity elipse add appcompat_v7 , if I remove it I got error , R cannot be resolved to a variable occurs, This folder is too much irritating, I know appcompat_v7 is for actionbar compatibilty with older version, but for my current project it is no use, Any Idea or solution please share I have already google this issue and search on stackoverflow nothing working for me.

Thanks in advance

Was it helpful?

Solution

Steps for resolving this issue

  1. Delete appcompat_v7(which is generated while u creating ur project) from eclipse and workspace.
  2. If u want to use fragment then the class should be extends FragmentActivity otherwise extends Activity and delete all Fragment stufs.
  3. After that change style from all styles files and use native android theme not any theme from appcompat.
  4. Change in menu folder is needed.See the code snippet

code snippet for style

<style name="AppBaseTheme" parent="android:Theme.Light">

code snippet for menu

<menu xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    tools:context="com.android.multitaskme.tasker.SplashActivity" >

    <item
        android:id="@+id/action_settings"
        android:orderInCategory="100"
        android:title="@string/action_settings"
        android:showAsAction="never"/>

</menu>

Clean ur project and u r good to go.

OTHER TIPS

I also faced the same problem after updating eclipse.
The reason you are getting error after deleting the appcompat_v7 folder is it contains the R.java file which is auto-generated by the ide.
You can check your project gen folder it has no more the R.java file.
For now you can manually add new activity but for larger project if will be very time consuming and boring.
I suggest you keep this as it it.

By the time you will get used to it as myself.

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