14

I add this library in my gradle file:

compile 'com.appeaser.sublimepickerlibrary:sublimepickerlibrary:2.0.0'

I've already these dependencies:

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile "com.android.support:design:23.+"
compile 'com.android.support:support-v4:23.+'
compile 'com.android.support:support-v13:23.+'
compile 'com.android.support:appcompat-v7:23.+'
compile 'com.android.support:cardview-v7:23.+'
compile 'com.android.support:recyclerview-v7:23.+'

Since, I've added SublimePicker library, I add this error:

Error:Could not find com.android.support:support-v4:23.2.1. Required by: Android:app:unspecified

Could you help me guys ?

anthony
  • 7,653
  • 8
  • 49
  • 101

4 Answers4

20

You have to update the SDK Manager.

enter image description here

In any case you should avoid the use of the + in your dependendencies.
Using the + you will not able to replicate the build since you don't know which dependencies you are using.

Use:

compile "com.android.support:design:23.2.1"
compile 'com.android.support:support-v4:23.2.1'
compile 'com.android.support:support-v13:23.2.1'
compile 'com.android.support:appcompat-v7:23.2.1'
compile 'com.android.support:cardview-v7:23.2.1'
compile 'com.android.support:recyclerview-v7:23.2.1'
Gabriele Mariotti
  • 320,139
  • 94
  • 887
  • 841
  • Gabriele, it's not this problem. My SDK has been updated with 23.2.1 version. The problem is when I add the SublimePicker library; without that the build is fine! – anthony Mar 25 '16 at 16:44
  • @anthony It is quite strange. Have you tried to remove that dependencies using the 23.2.1 of support libraries (without the +) ? – Gabriele Mariotti Mar 25 '16 at 16:52
  • Yes, it's the same behavior. You can try with a template project, just try to build and you will have this problem. – anthony Mar 25 '16 at 19:01
  • Did that. Did not help. Maven downloaded the correct version itself. Gradle just sucks. – Martin Mar 26 '16 at 11:28
  • And not it works. Also for no apparent reason. I'll add an answer. – Martin Mar 26 '16 at 11:34
2

After clicking “yes” to another obscure suggestion from IntelliJ IDEA the following change was made:

>git diff gradle/wrapper/gradle-wrapper.properties
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
index b2d6236..1966ba0 100644
--- a/gradle/wrapper/gradle-wrapper.properties
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -1,6 +1,6 @@
-#Mon Jan 11 11:12:07 CET 2016
+#Sat Mar 26 12:30:43 CET 2016
 distributionBase=GRADLE_USER_HOME
 distributionPath=wrapper/dists
 zipStoreBase=GRADLE_USER_HOME
 zipStorePath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-2.2.1-bin.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-2.2.1-all.zip

Now it works. Why? I don't know.

Martin
  • 11,577
  • 16
  • 80
  • 110
1

I came here because of the question's title, Could not find com.android.support:support-v4:23.2.1. That means I haven't added any library to my gradle file, just wanted to build an existing project.

After going through quite a few answers on questions with very similar titles, I finally found a solution that worked for me on Reddit, which basically says, within the context of the Android SDK Manager:

I had to install the Android Support Repository, and remove all the google options from extras (google play services, google repository etc.) and I got my first successful build!

Since I didn't have any of the Google extras installed anyway, I just needed to add the Android Support Repository 40. Note that I didn't try to uninstall the (apparently now obsolete) Android Support Library 23.2.1, but that would certainly be an interesting experiment at this point... though this answer suggests it is required anyway.

Community
  • 1
  • 1
FriendFX
  • 2,929
  • 1
  • 34
  • 63
0

This worked for me. On your build.gradle file add the next:

repositories {
    maven { url "https://maven.google.com" }
}