gpt4 book ai didi

java - 无法解析 : lifecycle-runtime-2. 2.0

转载 作者:行者123 更新时间:2023-12-05 00:04:12 32 4
gpt4 key购买 nike

我正在尝试添加 android-youtube-player到我的android项目。当我将它添加到 gradle 依赖项时,gradle sync 完成并显示此警告:

Failed to resolve: lifecycle-runtime-2.2.0

尝试运行该应用程序会产生以下错误:

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

我的 build.gradle 文件:

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'
}

没有implementation 'com.pierfrancescosoffritti.androidyoutubeplayer:core:10.0.5'就没有问题

我尝试清理项目并删除 .gradle 文件夹,但没有帮助。我做错了什么吗?

最佳答案

如果所有代表都为真然后从android studio文件中使缓存无效并重新启动

帮我解决问题

关于java - 无法解析 : lifecycle-runtime-2. 2.0,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64635898/

32 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com