我正在尝试在Kotlin中制作Spotify克隆应用程序。我还没有完成它,但在检查它是否正在运行时,我遇到了这个错误:-
Caused by: org.gradle.api.internal.artifacts.ivyservice.DefaultLenientConfiguration$ArtifactResolveException: Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
在模拟器上运行应用程序时,应用程序不断崩溃
我曾尝试以下解决方法:
- Could not resolve all files for configuration ':app:debugRuntimeClasspath'. problem
- Android studio 3.2.1 ArtifactResolveException: Could not resolve all artifacts for configuration ':classpath'
- Error "Could not resolve all files for configuration" in Android Studio
构建.gradle(模块:应用程序):-
plugins {
id 'com.android.application'
id 'org.jetbrains.kotlin.android'
id 'com.google.gms.google-services'
id 'kotlin-android'
id 'kotlin-kapt'
}
android {
compileSdk 32
defaultConfig {
applicationId "com.aashushaikh.spotifyclone"
minSdk 21
targetSdk 32
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
}
kotlinOptions {
jvmTarget = '1.8'
}
}
dependencies {
implementation 'androidx.core:core-ktx:1.7.0'
implementation 'androidx.appcompat:appcompat:1.4.2'
implementation 'com.google.android.material:material:1.6.1'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation 'com.google.firebase:firebase-firestore-ktx:24.1.2'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
// Architectural Components
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.4.1"
// Lifecycle
implementation "androidx.lifecycle:lifecycle-extensions:2.2.0"
implementation "androidx.lifecycle:lifecycle-livedata-ktx:2.4.1"
implementation "androidx.lifecycle:lifecycle-runtime:2.4.1"
implementation "androidx.lifecycle:lifecycle-runtime-ktx:2.4.1"
// Coroutines
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.1'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.1'
// Coroutine Lifecycle Scopes
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.4.1"
implementation "androidx.lifecycle:lifecycle-runtime-ktx:2.4.1"
// Navigation Component
implementation "androidx.navigation:navigation-fragment-ktx:2.5.0"
implementation "androidx.navigation:navigation-ui-ktx:2.5.0"
// Glide
implementation 'com.github.bumptech.glide:glide:4.13.2'
annotationProcessor 'com.github.bumptech.glide:compiler:4.13.2'
// Activity KTX for viewModels()
implementation "androidx.activity:activity-ktx:1.4.0"
//Dagger - Hilt
implementation "com.google.dagger:hilt-android:2.28-alpha"
implementation "androidx.hilt:hilt-lifecycle-viewmodel:1.0.0-alpha03"
implementation "com.google.dagger:hilt-android:2.38.1"
kapt("com.google.dagger:hilt-android-compiler:2.38.1")
// Timber
implementation 'com.jakewharton.timber:timber:4.7.1'
// Firebase Firestore
implementation 'com.google.firebase:firebase-firestore:24.2.0'
implementation 'com.google.firebase:firebase-firestore-ktx:24.2.0'
// Firebase Storage KTX
implementation 'com.google.firebase:firebase-storage-ktx:24.2.0'
// Firebase Coroutines
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-play-services:1.1.1'
// ExoPlayer
api "com.google.android.exoplayer:exoplayer-core:2.18.0"
api "com.google.android.exoplayer:exoplayer-ui:2.18.0"
api "com.google.android.exoplayer:extension-mediasession:2.18.0"
}
构建.gradle(项目级):-
buildscript {
dependencies {
classpath 'com.google.gms:google-services:4.3.13'
}
}// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
id 'com.android.application' version '7.2.1' apply false
id 'com.android.library' version '7.2.1' apply false
id 'org.jetbrains.kotlin.android' version '1.7.0' apply false
}
task clean(type: Delete) {
delete rootProject.buildDir
}
设置.gradle(项目设置):-
pluginManagement {
repositories {
gradlePluginPortal()
google()
mavenCentral()
maven { url='https://jitpack.io'}
}
}
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
}
}
rootProject.name = "SpotifyClone"
include ':app'
1条答案
按热度按时间qlfbtfca1#
您应该使用此版本:
implementation 'com.google.firebase:firebase-storage-ktx:20.0.1'
您可以在此处找到当前版本:https://firebase.google.com/docs/android/setup#kotlin+ktx