gpt4 book ai didi

android - 包含 'espresso-contrib:3.1.0' 后 : Execution failed for task ':app:processDebugAndroidTestResources'

转载 作者:行者123 更新时间:2023-11-29 23:28:59 26 4
gpt4 key购买 nike

包含该行后(为了使用 RecyclerViewActions 对 Espresso 进行测试):

androidTestImplementation 'androidx.test.espresso:espresso-contrib:3.1.0'

我得到错误:

AAPT2 error: check logs for details

更具体地说

org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:processDebugAndroidTestResources'.

进一步进入日志:

error: resource android:attr/dialogCornerRadius not found.
Message{kind=ERROR, text=error: resource android:attr/dialogCornerRadius not found., sources=[/Users/****/.gradle/caches/transforms-1/files-1.1/appcompat-1.0.0.aar/8cc334eb6bfbd0d390b8b779993d2020/res/values-v28/values-v28.xml:9:5-12:13], original message=, tool name=Optional.of(AAPT)}

...

error: resource android:attr/dialogCornerRadius not found.
Message{kind=ERROR, text=error: resource android:attr/dialogCornerRadius not found., sources=[/Users/****/Documents/Code/AndroidStudioProjects/MyProject/app/build/intermediates/incremental/mergeDebugAndroidTestResources/merged.dir/values-v28/values-v28.xml:11], original message=, tool name=Optional.of(AAPT)}

...

error: resource android:attr/fontVariationSettings not found.
Message{kind=ERROR, text=error: resource android:attr/fontVariationSettings not found., sources=[/Users/****/.gradle/caches/transforms-1/files-1.1/appcompat-1.0.0.aar/8cc334eb6bfbd0d390b8b779993d2020/res/values/values.xml:1304:5-69], original message=, tool name=Optional.of(AAPT)}

...

error: resource android:attr/ttcIndex not found.
Message{kind=ERROR, text=error: resource android:attr/ttcIndex not found., sources=[/Users/****/.gradle/caches/transforms-1/files-1.1/appcompat-1.0.0.aar/8cc334eb6bfbd0d390b8b779993d2020/res/values/values.xml:1304:5-69], original message=, tool name=Optional.of(AAPT)}

...

error: failed linking references.

build.gradle

apply plugin: 'com.android.application'

android {
compileSdkVersion 26
dataBinding.enabled = true
defaultConfig {
applicationId "com.****.****"
minSdkVersion 15
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
sourceSets { main { java.srcDirs = ['src/main/java', 'src/dbhelpers/java/'] } }
testOptions {
unitTests {
includeAndroidResources = true
}
}
}

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.android.support:design:26.1.0'
implementation 'com.android.support:cardview-v7:26.1.0'
implementation 'com.android.support:recyclerview-v7:26.1.0'


implementation 'com.android.support:support-annotations:27.1.1'
androidTestImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:rules:1.1.0'
androidTestImplementation 'androidx.test:runner:1.1.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0'
androidTestImplementation 'androidx.test.espresso:espresso-contrib:3.1.0'

androidTestImplementation "com.google.truth.extensions:truth-java8-extension:0.42"
testImplementation "com.google.truth:truth:0.42"
}

最佳答案

将您的 compileSdkVersion 和 targetSdkVersion 升级到 28。SDK 26 中不存在这些资源。

关于android - 包含 'espresso-contrib:3.1.0' 后 : Execution failed for task ':app:processDebugAndroidTestResources' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53027409/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com