I am tryng out Android Studio instead of Eclipse. I install it and then start a completely new project and follow the wizard. I add no code of my own.
Then, I right-
I found that if you have comments in your build.gradle it may break when you try to add a new support library. So make sure you check your build.gradle and see if it looks alright manually.
For me the cause of problem was broken class path:
Library Gradle: com.android.support:support-v4:28.0.0@aar has broken classes path:
/Users/YOUR_USER/.gradle/caches/transforms-1/files-1.1/support-v4-28.0.0.aar/0f378acce70d3d38db494e7ae5aa6008/res
So only removing transforms-1 folder and further Gradle Sync helped.
1> File -> invalidate caches 2> Build-> Rebuild
its work for me
I found a shortcut: File - Project Structure - Tab:Dependencies Click on the green + sign, select support-v4 (or any other you need), click OK.
now go to your gradle file and see that is been added
To downplay the "magic" of this issue a little bit. You need an Internet connection after you make those changes. If for some reason required libraries cannot by downloaded, instead of giving an appropriate message (like "Failed to fetch libraries") you will simply get the same build error. Was struggling with this for an hour before realizing that my company's VPN blocked the repo.
I got the same problem since I updated to latest version of Android Studio 0.3.7. So you can try with my stuffs.
Ensure you have updated to latest version Android Support Repository - 3 Android Support Library - 19
As your attachment picture above, you did it already. Then adding the following setting to your build.gradle
dependencies {
compile 'com.android.support:support-v4:19.0.0'
}
One more thing: Please make sure your Android SDK is targeting to right SDK folder