我尝试了很多解决方案,但对我而言却无济于事。我整天都在搜索。
当“重建项目”时,出现如下错误
Android resource compilation failed
C:\Users\admin\.gradle\caches\transforms-2\files-2.1\dd5cbbcf343124be2329ceb51a9e601b\jetified-shimmer-0.1.0\res\values\values.xml:3:5-948: AAPT: error: duplicate value for resource 'attr/shape' with config ''.
C:\Users\admin\.gradle\caches\transforms-2\files-2.1\dd5cbbcf343124be2329ceb51a9e601b\jetified-shimmer-0.1.0\res\values\values.xml:3:5-948: AAPT: error: resource previously defined here.
但是我找不到使用“attr/shape”的任何文件。项目gradle
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.kotlin_version = '1.4.10'
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.0.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.google.gms:google-services:4.3.4'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
apply plugin: 'kotlin'
allprojects {
repositories {
google()
jcenter()
maven { url 'https://jitpack.io' }
}
}
repositories {
mavenCentral()
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
}
compileKotlin {
kotlinOptions {
jvmTarget = "1.8"
}
}
compileTestKotlin {
kotlinOptions {
jvmTarget = "1.8"
}
}
应用程式gradle apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'com.google.gms.google-services'
android {
compileSdkVersion 28
defaultConfig {
multiDexEnabled true
applicationId "com.oxicodes.apple.edropsadmin"
minSdkVersion 19
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility = "1.8"
targetCompatibility = "1.8"
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'androidx.appcompat:appcompat:1.3.0-alpha02'
implementation 'androidx.constraintlayout:constraintlayout:2.0.2'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.multidex:multidex:2.0.1'
implementation 'com.google.android.gms:play-services-maps:17.0.0'
implementation 'com.google.android.gms:play-services-location:17.1.0'
//implementation 'com.google.android.libraries.places:places-compat:1.0.0'
// Places library
implementation 'com.google.android.libraries.places:places:2.4.0'
// PING Place Pickersupport:design
implementation 'com.github.rtchagas:pingplacepicker:2.0.3'
implementation 'com.android.support:multidex:1.0.3'
implementation 'com.google.firebase:firebase-messaging:20.3.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
//Image Load
implementation 'com.squareup.picasso:picasso:2.71828'
//for home page
implementation 'com.github.traex.rippleeffect:library:1.3'
//volley library
implementation 'com.android.volley:volley:1.1.1'
//Circular Imge
implementation 'de.hdodenhof:circleimageview:2.2.0'
implementation 'com.nineoldandroids:library:2.4.0'
implementation 'com.daimajia.slider:library:1.1.5@aar'
implementation 'com.google.android.material:material:1.3.0-alpha03'
//for textfield
// Facebook shimmer effect dependency
implementation 'com.facebook.shimmer:shimmer:0.1.0@aar'
//progress bar
//image cropper
api 'com.theartofdev.edmodo:android-image-cropper:2.8.+'
}
我已经尝试多次清理,重建,失效并重新启动,但这无济于事。请帮助我解决此问题,在此先感谢。 最佳答案
从com.facebook.shimmer:shimmer:0.1.0@aar
更新为'com.facebook.shimmer:shimmer:0.5.0'
并将开始和停止方法更改为startShimmer()
和stopShimmer()