Reputation: 51
I am trying to make a Spotify clone app in Kotlin. I have not completed it yet but while checking whether it is running or not, i encountered with this error:-
Caused by: org.gradle.api.internal.artifacts.ivyservice.DefaultLenientConfiguration$ArtifactResolveException: Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
My App keeps crashing when i run it on the emulator
I have tried the following solutions:-
Build.gradle(module: app):-
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"
}
Build.gradle(project level):-
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
}
Settings.gradle(Project settings):-
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'
Upvotes: 1
Views: 14761
Reputation: 3332
You should this version: implementation 'com.google.firebase:firebase-storage-ktx:20.0.1'
You can find current versions here: https://firebase.google.com/docs/android/setup#kotlin+ktx
Upvotes: 0