I'm trying to add android-youtube-player to my android project. When I add it to the gradle dependencies, gradle sync finishes with this warning:
Failed to resolve: lifecycle-runtime-2.2.0
Trying to run the app produces the following error:
Execution failed for task ':app:checkDebugDuplicateClasses'.
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
> Could not find recyclerview-1.1.0.jar (androidx.recyclerview:recyclerview:1.1.0).
Searched in the following locations:
https://dl.google.com/dl/android/maven2/androidx/recyclerview/recyclerview/1.1.0/recyclerview-1.1.0.jar
> Could not find lifecycle-runtime-2.2.0.jar (androidx.lifecycle:lifecycle-runtime:2.2.0).
Searched in the following locations:
https://dl.google.com/dl/android/maven2/androidx/lifecycle/lifecycle-runtime/2.2.0/lifecycle-runtime-2.2.0.jar
My build.gradle file:
plugins {
id 'com.android.application'
}
android {
compileSdkVersion 30
buildToolsVersion "30.0.2"
defaultConfig {
applicationId "com.****.********"
minSdkVersion 22
targetSdkVersion 30
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'com.google.android.material:material:1.1.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.2.0'
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.2.0'
implementation 'androidx.lifecycle:lifecycle-extensions:2.1.0'
implementation "androidx.fragment:fragment-ktx:1.2.0"
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
testImplementation 'junit:junit:4.+'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
implementation 'com.github.bumptech.glide:glide:4.11.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.11.0'
implementation 'de.hdodenhof:circleimageview:3.1.0'
implementation 'com.pierfrancescosoffritti.androidyoutubeplayer:core:10.0.5'
}
It has no problems without implementation 'com.pierfrancescosoffritti.androidyoutubeplayer:core:10.0.5'
I have tried cleaning the project and deleting .gradle folder, but it hasn't helped. Is there anything I'm doing wrong?