gpt4 book ai didi

安卓工作室错误 : Execution failed for task ':app:processDebugResources'

转载 作者:行者123 更新时间:2023-11-29 18:37:36 24 4
gpt4 key购买 nike

打开一个我两个月没碰过的项目进行轻微更新,更新 Android Studio 后我无法编译代码而不会出现以下错误。

过去两个小时我一直在用谷歌搜索这个问题,但无法解决。我已经尝试了其他类似线程中的几乎所有内容,包括将我的 compileSdkVersion 更改为 28。

完整错误信息:

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:processDebugResources'.
> Android resource linking failed
Output: C:\Users\nicoq\AndroidStudioProjects\CurrencyConverter\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values-v28\values-v28.xml:7: error: resource android:attr/dialogCornerRadius not found.
C:\Users\nicoq\AndroidStudioProjects\CurrencyConverter\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values-v28\values-v28.xml:11: error: resource android:attr/dialogCornerRadius not found.
C:\Users\nicoq\AndroidStudioProjects\CurrencyConverter\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:605: error: resource android:attr/fontVariationSettings not found.
C:\Users\nicoq\AndroidStudioProjects\CurrencyConverter\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:605: error: resource android:attr/ttcIndex not found.
error: failed linking references.

Command: C:\Users\nicoq\.gradle\caches\transforms-1\files-1.1\aapt2-3.2.1-4818971-windows.jar\79758b877cdc4acd10a4d36cead9740a\aapt2-3.2.1-4818971-windows\aapt2.exe link -I\
C:\Users\nicoq\AppData\Local\Android\Sdk\platforms\android-27\android.jar\
--manifest\
C:\Users\nicoq\AndroidStudioProjects\CurrencyConverter\app\build\intermediates\merged_manifests\debug\processDebugManifest\merged\AndroidManifest.xml\
-o\
C:\Users\nicoq\AndroidStudioProjects\CurrencyConverter\app\build\intermediates\processed_res\debug\processDebugResources\out\resources-debug.ap_\
-R\
@C:\Users\nicoq\AndroidStudioProjects\CurrencyConverter\app\build\intermediates\incremental\processDebugResources\resources-list-for-resources-debug.ap_.txt\
--auto-add-overlay\
--java\
C:\Users\nicoq\AndroidStudioProjects\CurrencyConverter\app\build\generated\not_namespaced_r_class_sources\debug\processDebugResources\r\
--custom-package\
com.nicoqueijo.android.currencyconverter\
-0\
apk\
--output-text-symbols\
C:\Users\nicoq\AndroidStudioProjects\CurrencyConverter\app\build\intermediates\symbols\debug\R.txt\
--no-version-vectors
Daemon: AAPT2 aapt2-3.2.1-4818971-windows Daemon #0
Output: C:\Users\nicoq\.gradle\caches\transforms-1\files-1.1\appcompat-1.0.0.aar\35842d61ee1e0b491406c4ed516cc97e\res\values-v28\values-v28.xml:9:5-12:13: AAPT: error: resource android:attr/dialogCornerRadius not found.

C:\Users\nicoq\AndroidStudioProjects\CurrencyConverter\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values-v28\values-v28.xml:11: AAPT: error: resource android:attr/dialogCornerRadius not found.

C:\Users\nicoq\.gradle\caches\transforms-1\files-1.1\core-1.0.0.aar\61e0e551f80e7289ee3f340454bf1394\res\values\values.xml:89:5-125:25: AAPT: error: resource android:attr/fontVariationSettings not found.

C:\Users\nicoq\.gradle\caches\transforms-1\files-1.1\core-1.0.0.aar\61e0e551f80e7289ee3f340454bf1394\res\values\values.xml:89:5-125:25: AAPT: error: resource android:attr/ttcIndex not found.

error: failed linking references.
Command: C:\Users\nicoq\.gradle\caches\transforms-1\files-1.1\aapt2-3.2.1-4818971-windows.jar\79758b877cdc4acd10a4d36cead9740a\aapt2-3.2.1-4818971-windows\aapt2.exe link -I\
C:\Users\nicoq\AppData\Local\Android\Sdk\platforms\android-27\android.jar\
--manifest\
C:\Users\nicoq\AndroidStudioProjects\CurrencyConverter\app\build\intermediates\merged_manifests\debug\processDebugManifest\merged\AndroidManifest.xml\
-o\
C:\Users\nicoq\AndroidStudioProjects\CurrencyConverter\app\build\intermediates\processed_res\debug\processDebugResources\out\resources-debug.ap_\
-R\
@C:\Users\nicoq\AndroidStudioProjects\CurrencyConverter\app\build\intermediates\incremental\processDebugResources\resources-list-for-resources-debug.ap_.txt\
--auto-add-overlay\
--java\
C:\Users\nicoq\AndroidStudioProjects\CurrencyConverter\app\build\generated\not_namespaced_r_class_sources\debug\processDebugResources\r\
--custom-package\
com.nicoqueijo.android.currencyconverter\
-0\
apk\
--output-text-symbols\
C:\Users\nicoq\AndroidStudioProjects\CurrencyConverter\app\build\intermediates\symbols\debug\R.txt\
--no-version-vectors
Daemon: AAPT2 aapt2-3.2.1-4818971-windows Daemon #0

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 1s

我的 build.gradle 文件:

apply plugin: 'com.android.application'

android {
compileSdkVersion 27
defaultConfig {
applicationId "com.nicoqueijo.android.currencyconverter"
minSdkVersion 21
targetSdkVersion 27
versionCode 4
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
lintOptions {
disable 'MissingTranslation'
}
}

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.android.volley:volley:1.1.0'
implementation 'com.github.turing-tech:MaterialScrollBar:13.+'
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:design:27.1.1'
implementation 'com.android.support:support-v4:27.1.1'
implementation 'com.android.support:cardview-v7:27.1.1'
implementation 'com.github.bosphere.android-fadingedgelayout:fadingedgelayout:1.0.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}

最佳答案

可能问题在

implementation 'com.github.turing-tech:MaterialScrollBar:13.+'

我去 github 看看这个 lib build gradle 文件:

    def libVersion = '13.3.2'

android {
compileSdkVersion 28
buildToolsVersion '28.0.3'

defaultConfig {
minSdkVersion 14
targetSdkVersion 28
versionName libVersion
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}

我明白了

buildToolsVersion '28.0.3'

但是在你的项目中:

27.1.1

尝试为lib设置更旧的版本,只需添加

implementation 'com.github.turing-tech:MaterialScrollBar:13.3.0'

代替这个

implementation 'com.github.turing-tech:MaterialScrollBar:13.+'

关于安卓工作室错误 : Execution failed for task ':app:processDebugResources' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53678717/

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