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.
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.
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
first clean and build the appcompat_v7 project and then clean and build your project. it worked
I installed "Android support repository" from Android SDK Manager/Extras and the errors are gone.
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:)
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