21

After creating any new android project, Eclipse automatically creates a "appcompat_v7" project without any files under /src. I have no idea how or why Eclipse is creating this project. I am also getting a weird error.

enter image description here

As you can see the AndroidManifest.xml exists in the project!

EDIT1: After cleaning the project the weird error was gone, but I'd still like to know why the appcompat_v7 is created.

EDIT2: I also noticed that Eclipse is automatically creating a new layout, fragment_main.xml, under /res/layout. WHY??

I have created a new Workspace, and tried it several times. But I still have this problem.

EDIT3: If you choose the minimum SDK version after API 14 you won't get this support folder.

Cœur
  • 37,241
  • 25
  • 195
  • 267
Ali
  • 1,001
  • 2
  • 14
  • 32
  • 1
    I am getting the same issue. Recently updated some of my SDK stuff and now every time I create an app this gets created as well. I also am running into a problem where the app has dependencies for appcompat_v7\libs\android-support-v4.jar and libs\android-support-v4.jar (two different android-support-v4.jars) so I have to work around that every time. Hope someone can help you out with this. – zgc7009 Mar 10 '14 at 15:45

6 Answers6

9

I ran into this problem last night. I was doing several things including updating the SDK manager. I had to back off the Android SDK Tools to Rev. 22.3 and Android SDK Platform-tools to 19.

opus44

opus44
  • 106
  • 3
7

first clean and build the appcompat_v7 project and then clean and build your project. it worked

Sony
  • 7,136
  • 5
  • 45
  • 68
6

I installed "Android support repository" from Android SDK Manager/Extras and the errors are gone.

maaa
  • 69
  • 1
6

Do as follows to overcome this issue, this works for me. Create project as usual than follow below steps

Step-1:

Right Click on your Project -> Properties -> Android -> In Library panel, remove appcompat_v7 library, Apply and Ok

Step-2:

In Project goto res -> values -> style.xml

In line <style name="AppBaseTheme" parent="Theme.AppCompat.Light"> change parent value from Theme.AppCompat.Light to android:Theme.Light

Step-3:

In Project goto res -> values-v11 -> style.xml

In line <style name="AppBaseTheme" parent="Theme.AppCompat.Light"> change parent value from Theme.AppCompat.Light to android:Theme.Holo.Light

Step-4:

In Project goto res -> values-v14 -> style.xml

In line <style name="AppBaseTheme" parent="Theme.AppCompat.Light.DarkActionBar"> change parent value from Theme.AppCompat.Light.DarkActionBar to android:Theme.Holo.Light.DarkActionBar

Step-5:

In Project goto menu -> main.xml remove these lines in menu tag:

xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
tools:context="com.example.test.MainActivity" 

and in item tag change this line from app:showAsAction="never" to android:showAsAction="never"

In project, goto res -> layout -> delete fragment.xml

Step-6:

In MainActivity extends Activity not ActionBarActivity and finally your MainActivity.java after remove unnecessary code, looks like this:

package com.example.test;

import android.app.Activity;
import android.os.Bundle;
import android.view.Menu;

public class MainActivity extends Activity {

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

}

@Override
public boolean onCreateOptionsMenu(Menu menu) {

    // Inflate the menu; this adds items to the action bar if it is present.
    getMenuInflater().inflate(R.menu.main, menu);
    return true;
}

}

Enjoy:)

sagar.android
  • 1,860
  • 17
  • 17
1

import the android project to the workspace from /extras/android/support/ then navigate to your current project and add it as dependency : Project > Properties > Android > Add (the imported project) . You should be able to see a Green tick next to the imported project. Remove the old reference that you lost/deleted. A reference about what this library is can be found here

George Papatheodorou
  • 1,539
  • 19
  • 23
-1

I on ubuntu only clean up aappcompat_v7 source code it worked well for me

Mokhtarabadi
  • 349
  • 1
  • 3
  • 11