Reputation: 1269
I want to add this dependency in my build.gradle file :
implementation 'com.android.support:design:28.0.0'
when I add this and click on the Sync now, it gives me error :
Failed to resolve: recyclerview-v7
and this is my build.gradle file :
// Top-level build file where you can add configuration options common to
all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
mavenCentral()
mavenLocal()
}
}
apply plugin: 'com.android.library'
android {
packagingOptions {
exclude 'META-INF/NOTICE'
}
}
android {
packagingOptions {
exclude 'META-INF/LICENSE'
}
}
android {
compileSdkVersion 28
buildToolsVersion "28.0.3"
defaultConfig {
minSdkVersion 16
targetSdkVersion 28
versionCode 1
versionName "1.0"
}
}
dependencies {
api project(':MapdroidClient')
api project(':UiUtil')
implementation 'org.slf4j:slf4j-api:1.7.25'
implementation 'com.github.ksoichiro:android-observablescrollview:1.6.0'
implementation 'com.nineoldandroids:library:2.4.0'
implementation 'org.osmdroid:osmdroid-android:5.6.4'
implementation 'com.android.support:support-v4:28.0.0'
implementation 'com.android.support:design:28.0.0'
}
I know that in my observablescrollview library, there is recyclerview dependency, but I don't know why i get this error.
I searched every where and none of solutions worked. Solutions like changing order of google() and jcenter() repositories ...
Upvotes: 0
Views: 303
Reputation: 3253
You get this error because observablescrollview uses uses implementation
to reference the recyclerview. This new build keyword makes inner dependencies invisible for you. In most cases, you do not need them anyways.
in your case:
if you want to use them, you need to contact the authors to compile with api
instead of implementation
for the recyclerview reference.
If they don't do that, you have no chance to use their inner dependency.
Upvotes: 1