1

It's several days and I'm still trying to use android.support.v7 In Intellij Idea I have searched and read many pages but not found a way to fix it

  1. Updated Android SDK Tolls , Android SDK Platform-Tools , Android Support Library And Android Support Repository
    1. Copy android-support-v13.jar To libs Directry
    2. Press Alt+ctrl+Shift+s
    3. Add jar File To Library
    4. Add jar File To Modules >> Dependencies (Press '+' And Use Each Of 'JARs Or Directories' And 'Library >> Java' And Check 'android-support-v13'

But in activity class it still show error "Cannot resolve Symbol 'ActionBarActivity'"

import android.os.Bundle;
import com.example.daft_theme.R; // It's Grey
import android.support.v7.app.ActionBarActivity; // It's Grey Too



public class MainActivity extends ActionBarActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
//      ActionBar actionBar = getSupportActionBar();
    }
}

At AndroidManifest.xml :

    <uses-sdk
    android:minSdkVersion="8"
    android:targetSdkVersion="19" />

Please tell me how to fix it , thank you.

Jimmy
  • 16,123
  • 39
  • 133
  • 213
Hossein Kurd
  • 3,184
  • 3
  • 41
  • 71

3 Answers3

1

Include android-support-v4.jar and android-support-v7-appcompat.jar to your classpath.

See http://www.coderzheaven.com/tag/android-support-v7-appcompat-jar/ for detailed instructions.

userM1433372
  • 5,345
  • 35
  • 38
1

If you are using Android Studio check/add below line to your build.gradle (Module) into dependencies section

compile 'com.android.support:support-v7:19.0.+'
Dario
  • 2,053
  • 21
  • 31
1

You can just refer this post.

How to add android.support.v7.widget.GridLayout into intelliJidea?

And after this I also facing the problem of compile error, after some study finally find the root cause is the Project SDK setting, in my setting I set to 4.4.2, but the version21 is not recongized by 4.4.2. After I set to 6.0 everything is fine.

Community
  • 1
  • 1
forqzy
  • 389
  • 2
  • 11