Could not find com.android.support:support-v4:22.0.0. after SDK update

蹲街弑〆低调 提交于 2019-12-03 05:44:23

Your dependencies in build.gradle seem to be correct.

Try to clean the cache (File -> Invalidate cache and restart), then sync the gradle file and clean and build.

In your gradle file there is a strange line. This DSL doesn't exist in last gradle plugin (which version are you using?)

 runProguard false

You should update the plugin (1.1.0), the gradle version (2.2.1) and change this line in

minifyEnabled false

so i added compile 'com.android.support:support-v4:22.0.0.' and now i get

Error:Failed to find: com.android.support:support-v4:22.0.0.

If you added exactly that, then I think your problem is the extra . at the end. :)

Try:

compile 'com.android.support:support-v4:22.0.0'
compile 'com.android.support:appcompat-v7:22.0.0'
Cyphire

How to clear gradle cache?

This is all explained here...

Just wipe out your .gradle GLOBAL cache (caches directory)! This was killing me for 2 days...

As i know about this issue, It is because of version of supported library, what you need to do ,You using version that is not available with your current configuration.

  1. Just delete this line from the gradle file
  2. Now select your project goto module setting (Press F12)
  3. Add dependency again using library dependency.

Using above steps you are adding available version of support library.

In my case I just needed to update SDK Tools and Extras.

If this might help someone, after MANY trials and errors, I found that I was targeting the wrong SDK version (an older one) in the build.gradle file corresponding to "library". To change this you can do it by hand or go to the Module Settings Menu (right click on your project folder -> Open Module Settings. Then in "library" - Properties you can change the Compile Sdk and the Build Tools Versions.

Obviously this worked for me after having all support libraries and building tools up to date.

Change the gradle version like I have change 2.1 to 2.2.1 and it's working for me.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!