gpt4 book ai didi

android - 带有 AAR 的 gradle 构建失败,没有找到资源错误

转载 作者:太空宇宙 更新时间:2023-11-03 11:09:09 25 4
gpt4 key购买 nike

我在项目中有两个模块。

  • app - 这是我的应用模块
  • app-base - 这是我的应用程序使用的 android 库模块。

当我使用构建工具 21 和 gradle android 插件 1.1.1 构建时具有以下依赖性,它将失败。

compile 'com.company.android:app-base:1.0.0@aar'

我通过以下命令将 app-base aar 部署到公司 sonatype Nexus。

gradle uploadArchives

错误信息如下:

:app:processCustomAppDebugResources
Position 34:21-35 : No resource found that matches the given name: attr 'actionBarStyle'.
Position 34:21-35 : No resource found that matches the given name: attr 'actionBarStyle'.
Position 37:29-51 : No resource found that matches the given name: attr 'windowActionBarOverlay'.
Position 29:21-36 : No resource found that matches the given name: attr 'windowActionBar'.
Position 1 : Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light'.
Position 1 : Error retrieving parent for item: No resource found that matches the given name '@style/Widget.AppCompat.ActionBar.Solid'.
Position 19:21-44 : No resource found that matches the given name: attr 'actionBarItemBackground'.
Position 7:21-31 : No resource found that matches the given name: attr 'background'.
Position 17:21-45 : No resource found that matches the given name: attr 'selectableItemBackground'.
Position 14:32-46 : No resource found that matches the given name: attr 'titleTextStyle'.
Position 7:21-31 : No resource found that matches the given name: attr 'background'.
Position 1 : Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light'.
Position 1 : Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light'.

:app:processCustomAppDebugResources FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:processCustomAppDebugResources'.
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/service/android/default/sdk/build-tools/21.0.0/aapt'' finished with non-zero exit value 1

要成功构建它,我只需要删除相同依赖项上的@aar。

compile 'com.company.android:app-base:1.0.0'

有人可以解释为什么会这样吗?使用或不使用 AAR 依赖项有什么区别?

最佳答案

这些参数来自 Android 支持库。您是否已将 Android 支持库包含在依赖项列表中?

compile 'com.android.support:appcompat-v7:21.0.3'

关于android - 带有 AAR 的 gradle 构建失败,没有找到资源错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29012363/

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