因此,我正在运行Android应用程序,但是它停止在Gradle构建过程中,并将错误显示为:-
Could not find com.androidx.support:support-v4:28.0.0. Required by:
project :app
Search in build.gradle files
我的分级档案如下:
plugins {
id 'com.android.application'
id 'kotlin-android'
id 'kotlin-kapt'
id 'dagger.hilt.android.plugin'
id 'com.google.gms.google-services'
}
android {
compileSdk 31
defaultConfig {
applicationId "com.example.alliaiseV1"
minSdk 26
targetSdk 31
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'
}
buildFeatures{
viewBinding true
}
}
dependencies {
implementation 'androidx.core:core-ktx:1.7.0'
implementation 'androidx.appcompat:appcompat:1.4.1'
implementation 'com.google.android.material:material:1.5.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
implementation 'com.google.firebase:firebase-firestore:24.0.2'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.camera:camera-core:1.1.0-alpha03'
implementation 'com.androidx.support:support-v4:28.0.0'
testImplementation 'junit:junit:4.13.2'
implementation 'com.google.firebase:firebase-storage-ktx:20.0.1'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
implementation 'androidx.annotation:annotation:1.3.0'
implementation 'com.android.databinding:viewbinding:7.1.2'
//Firebase
implementation 'com.google.android.gms:play-services-auth:20.1.0'
implementation platform('com.google.firebase:firebase-bom:29.0.1')
implementation 'com.google.firebase:firebase-analytics-ktx'
implementation 'com.google.firebase:firebase-auth-ktx'
implementation 'com.google.firebase:firebase-firestore-ktx'
implementation 'com.google.firebase:firebase-auth:21.0.2'
implementation 'com.google.firebase:firebase-firestore-ktx:24.0.2'
implementation 'com.firebaseui:firebase-ui-firestore:8.0.0'
//lifecycle
implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:2.4.1")
implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.4.1")
//coroutines
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.0")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.0")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-play-services:1.6.0")
//Fragment Navigation
implementation 'androidx.fragment:fragment-ktx:1.4.1'
implementation("androidx.navigation:navigation-fragment-ktx:2.5.0-alpha03")
implementation("androidx.navigation:navigation-ui-ktx:2.5.0-alpha03")
//Dagger - Hilt
implementation "com.google.dagger:hilt-android:2.38.1"
kapt "com.google.dagger:hilt-android-compiler:2.37"
implementation "androidx.hilt:hilt-lifecycle-viewmodel:1.0.0-alpha03"
kapt "androidx.hilt:hilt-compiler:1.0.0"
implementation 'androidx.hilt:hilt-navigation-compose:1.0.0'
//CardView
implementation("androidx.cardview:cardview:1.0.0")
//splashscreen API
implementation "androidx.core:core-splashscreen:1.0.0-beta02"
//blur
implementation 'io.alterac.blurkit:blurkit:1.1.0'
implementation 'com.github.MikeOrtiz:TouchImageView:1.4.1'
//paging
implementation("androidx.paging:paging-runtime-ktx:3.1.1")
//touch
implementation 'com.github.smarteist:autoimageslider:1.4.0'
}
在该错误发生后,我试图删除依赖项:
implementation 'com.androidx.support:support-v4:28.0.0'
在那之后我试着跑出了错误:-
Execution failed for task ':App : merge Debug Resources'.
> A failure occurred while executing
Com. android. build. Gradle. internal. res. Resource Compiler Runnable
> Resource compilation failed. Check logs for details.
请帮助我如何解决这个问题在Gradle,以使应用程序工作。
发布于 2022-04-01 12:23:14
所以问题解决了,问题是在其中一个string.xml文件中有一个‘在字符串之间使用,但是这个错误意味着在您的资源文件中有一些错误,您需要从图形开始,并读取每一行试图查找资源文件中的错误。
https://stackoverflow.com/questions/71680828
复制相似问题