Reputation: 41
I'll try to explain at detail what's happening.
*Gradle version: 5.1.1.
Android Gradle Plugin Version: 3.4.0
This is my Project build.gradle:
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.4.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
mavenCentral()
maven { url 'https://jitpack.io' }
maven { url "https://maven.google.com" }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
This is my App build.gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 29
defaultConfig {
applicationId "com.example.androidxexamp"
minSdkVersion 19
targetSdkVersion 29
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
implementation 'com.google.android.material:material:1.2.0-alpha04'
}
What's happening?
The library 'com.google.android.material:material:1.2.0-alpha04' tries to download the androidx.cardview:cardview:1.0.0 dependency. But this does not download:
Label: "Could not find cardview.aar (androidx.cardview:cardview:1.0.0). Searched in the following locations: https://dl.google.com/dl/android/maven2/androidx/cardview/cardview/1.0.0/cardview-1.0.0.aar"
The point is: When I manually try to download from https://dl.google.com/dl/android/maven2/androidx/cardview/cardview/1.0.0/cardview-1.0.0.aar it perfectly downloads. But the IDE cannot.
So, I'm tried to manually insert the androidx.cardview:cardview:1.0.0 library. I donwloaded the cardview-1.0.0.aar file and successfully inserted to A.Studio.
But I need the material library in order to use TabLayout. So, when I include (implementation 'com.google.android.material:material:1.2.0-alpha04') this fails againg saying it cannot resolve at https://dl.google.com/dl/android/maven2/androidx/cardview/cardview/1.0.0/cardview-1.0.0.aar.
I'm trying to see if there is any chance to avoid that the material library stop calling out the cardview dependency, don't know if possible.
Also, if I insert ( implementation 'androidx.cardview:cardview:1.0.0') A Studio says cannot resolve this link.
Please, any advice? Thanks very much
Upvotes: 2
Views: 3828
Reputation: 41
Ok I got it working now. I upgraded the Gradle version from 5.1.1 to 6.1.1, after that, it could resolved the dependency. Thank you.
Upvotes: 1