Unable to import ActionBarCompat from Android Support Library using Android Studio

I use Android Studio and after this article from Google , as well as some other articles discussing how to use the new ActionBarCompat.

I downloaded the support library (Rev. 18) in the Android SDK Manager and added the following to my build.gradle

dependencies { compile 'com.android.support:support-v4:18.0.0' compile 'com.android.support:appcompat-v7:18.0.0' } 

Now I'm trying to import the support library API and extend the ActionBarActivity in my code, however, this is what seemed

enter image description hereenter image description here

which is not what is supposed

 import android.support.v7.app.ActionBar; import android.support.v7.app.ActionBarActivity; 

Any help?

+3
source share
1 answer

I have the same problem. I followed this step to solve it, in Android Studio - Tools -> Android -> project synchronization with Gradle files .

enter image description here

Edit: Sorry, I forgot to add this: After Sync Project with Gradle Files, follow these steps:

  • Right click for your project and select Open Module Settings

enter image description here

  • After that, select the dependencies tab

enter image description here

  • At the end - select your library:

enter image description here

That should work.

+6
source

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


All Articles