gpt4 book ai didi

找到 Android Studio 3.0 未知元素

转载 作者:塔克拉玛干 更新时间:2023-11-02 08:52:12 26 4
gpt4 key购买 nike

更新 Android Studio 后,我的其中一个项目无法构建。错误信息是:

Error:(20) error: unknown element <library> found.
Error:(20) unknown element <library> found.
Error:java.util.concurrent.ExecutionException: java.util.concurrent.ExecutionException: com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for details
Error:java.util.concurrent.ExecutionException: com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for details
Error:com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for details
Error:Execution failed for task ':app:processDebugResources'.
> Failed to execute aapt

我的SDK版本是25,我试过使缓存失效,添加distributionUrl=https://services.gradle.org/distributions/gradle-4.1-rc-2-all.zip,而且它们都不适合我。

这是我的依赖:

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.4.0'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.android.support:support-v4:25.4.0'
compile 'de.hdodenhof:circleimageview:2.2.0'
testCompile 'junit:junit:4.12'

annotationProcessor "com.github.Raizlabs.DBFlow:dbflow-processor:${dbflow_version}"
compile "com.github.Raizlabs.DBFlow:dbflow-core:${dbflow_version}"
compile "com.github.Raizlabs.DBFlow:dbflow:${dbflow_version}"

compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:25.4.0'
compile 'com.android.support:design:25.4.0'

compile 'com.microsoft.projectoxford:face:1.3.0'
}

这是删除 DBFlow 后的错误日志:

Error:(20) error: unknown element <library> found.
Error:(20) unknown element <library> found.
Error:java.util.concurrent.ExecutionException: java.util.concurrent.ExecutionException: com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for details
Error:java.util.concurrent.ExecutionException: com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for details
Error:com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for details
Error:Execution failed for task ':app:processDebugResources'.
> Failed to execute aapt

最佳答案

在根项目的 gradle.properties 中添加这段代码:

android.enableAapt2=false

enter image description here

关于找到 Android Studio 3.0 未知元素 <library>,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47062866/

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