错误"Could not resolve all files for configuration ':app:debugCompileClasspath'."



我一直在我的Gradle文件中改变这么多东西,到目前为止没有任何工作请帮助,当我点击在模拟器上运行我的应用程序时,这是我得到的错误。

原因:org.gradle.api.internal.artifacts.ivyservice.DefaultLenientConfiguration$ArtifactResolveException: Could not resolve all files for configuration ':app:debugCompileClasspath'.

build.gradle (app)

plugins {
id 'com.android.application'
id 'org.jetbrains.kotlin.android'
id 'kotlin-android-extensions'
id 'kotlin-kapt'
}
android {
namespace 'com.example.mechanicsapp'
compileSdk 33
buildToolsVersion "30.0.3"
buildFeatures {
dataBinding true
viewBinding true
compose true
}
defaultConfig {
applicationId "com.example.mechanicsapp"
minSdk 24
targetSdk 33
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables {
useSupportLibrary true
}
}


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.9.0'
implementation 'androidx.appcompat:appcompat:1.6.0'
implementation 'com.google.android.material:material:1.7.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.navigation:navigation-fragment-ktx:2.5.3'
implementation 'androidx.navigation:navigation-ui-ktx:2.5.3'
implementation "androidx.compose.ui:ui:1.3.3"
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.5.1'
implementation 'androidx.activity:activity-compose:1.6.1'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
implementation "androidx.core:core-ktx:1.9.0"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.7.21"

//dependencies
//material design
implementation 'com.google.android.material:material:1.7.0'
//circle image view
implementation 'de.hdodenhof:circleimageview:3.1.0'
//scalable unit text size
implementation 'com.intuit.ssp:ssp-android:1.0.6'
//scalable unit size
implementation 'com.intuit.sdp:sdp-android:1.0.6'
//room database
implementation 'androidx.room:room-runtime:2.5.0'
kapt 'androidx.room:room-compiler:2.5.0'
implementation 'androidx.room:room-ktx:2.5.0'
implementation 'com.makeramen:roundedimageview:2.3.0'
//crop image library
implementation 'com.theartofdev.edmodo:android-image-cropper:2.8.0'
//easy permission
implementation 'pub.devrel:easypermissions:3.0.0'
//coroutines core
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4'
}

构建。gradle(力学应用)

// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
id 'com.android.application' version '7.4.0' apply false
id 'com.android.library' version '7.4.0' apply false
id 'org.jetbrains.kotlin.android' version '1.7.21' apply false
}
repositories {
google()
mavenCentral()
maven { url 'https://maven.google.com' }
}

设置。gradle (MechanicsApp)

pluginManagement {
repositories {
google()
mavenCentral()
gradlePluginPortal()
}
}
rootProject.name = "Mechanics App"
include ':app'

所以在平台/android/build中。Gradle文件,应该是这样的:

buildscript {

repositories {
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.3.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}

相关内容

最新更新