[Fixed] When you have added your dependencies you need to sync your project. It's the icon on the left of AVD Manager icon
Hi everyone,
I'm trying to use the appcompat-v7 with android studio. I add those lines:
dependencies {
compile 'com.android.support:appcompat-v7:18.0.+'
}
In the build.gradle but when I try to import the lib:
import android.support.v7.app.ActionBar;
It says me that cannot resolve v7 .. And when I check the folder external lib there is only support-v4.
Did I miss something ?
Ps: It worked in an other project and I could see the lib in external lib but it don't want do it again ..
You should have two dependencies:
dependencies {
compile 'com.android.support:support-v4:18.0.+'
compile 'com.android.support:appcompat-v7:18.0.+'
}
Verify that you have downloaded the latest Android Support Library and Support Repository within your SDK manager.
http://developer.android.com/tools/support-library/setup.html#download
Detailed tutorial on setting up the ActionBarActivity:
http://www.blackcj.com/blog/2013/08/14/actionbar-with-android-support-library-r18/
To add on blackcj Avoid using + in versions numbers it can lead to unpredictable and unrepeatable builds on android studio this may lead to more build time by gradle. Thats expensive!
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