Execution failed for task ‘:app:processDebugResources‘. > Android resource linking failed

问题描述:

详细错误信息

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:processDebugResources'.
> Android resource linking failed
  E:\eclipse\svn_android\app\src\main\res\layout\activity_finished_record.xml:15: AAPT: error: attribute current_month_lunar_text_color (aka com.microhabit:current_month_lunar_text_color) not found.
      
  E:\eclipse\svn_android\app\src\main\res\layout\activity_finished_record.xml:15: AAPT: error: attribute current_month_text_color (aka com.microhabit:current_month_text_color) not found.
      
  E:\eclipse\svn_android\app\src\main\res\layout\activity_finished_record.xml:15: AAPT: error: attribute max_year (aka com.microhabit:max_year) not found.
      
  E:\eclipse\svn_android\app\src\main\res\layout\activity_finished_record.xml:15: AAPT: error: attribute min_year (aka com.microhabit:min_year) not found.
      
  E:\eclipse\svn_android\app\src\main\res\layout\activity_finished_record.xml:15: AAPT: error: attribute month_view (aka com.microhabit:month_view) not found.
      
  E:\eclipse\svn_android\app\src\main\res\layout\activity_finished_record.xml:15: AAPT: error: attribute month_view_show_mode (aka com.microhabit:month_view_show_mode) not found.
      

我在项目中导入了一个自定义的CalendarView(就是一个自定义日历控件)

<com.haibin.calendarview.CalendarView
        android:id="@+id/calendarView"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginLeft="10dp"
        android:layout_marginRight="10dp"
        android:background="#fff"
        app:current_month_lunar_text_color="#CFCFCF"
        app:current_month_text_color="#333333"
        app:max_year="2020"
        app:year_view_scheme_color="#f17706" />

该控件中有很多自定义属性,运行前什么错误都没提示,但是一往手机上运行时就报错,提示自定义属性找不到。

提示:这个自定义控件,我是通过module形式导入到项目中的。

废话不多说直接上解决办法:

解决办法就是 将导入的module添加到项目中,下面是添加步骤

1.点击 File  >  Project Structure 

2.根据下图中的1.2.3.4顺序依次点击(我这个引入的是module如果你是library或者jar 就在第4步选择对应的就ok)

3.选择要导入的module,如果没有选项,就检查这个module是否引入到项目中了,引入办法可以复制到项目中和app同级目录,也可以通过File > New > Import Module导入

4.最后一定要点 ok 不然都没作用

5.都完成后可以再检查一下看这个module是否已经在依赖中。

在的话,就可以重新运行项目试试了。我的问题到此就解决了

 

截图不易,解决问题的兄弟,记得来点个赞啊。

转载请标明出处。

 

Executing tasks: [:app:assembleDebug] in project D:\Users\lenovo\AndroidStudioProjects\Pinduoduo WARNING: The specified Android SDK Build Tools version (27.0.0) is ignored, as it is below the minimum supported version (28.0.3) for Android Gradle Plugin 3.5.2. Android SDK Build Tools 28.0.3 will be used. To suppress this warning, remove "buildToolsVersion '27.0.0'" from your build.gradle file, as each version of the Android Gradle Plugin now has a default version of the build tools. > Task :app:preBuild UP-TO-DATE > Task :app:preDebugBuild UP-TO-DATE > Task :app:checkDebugManifest UP-TO-DATE > Task :app:generateDebugBuildConfig UP-TO-DATE > Task :app:javaPreCompileDebug UP-TO-DATE > Task :app:mainApkListPersistenceDebug UP-TO-DATE > Task :app:generateDebugResValues UP-TO-DATE > Task :app:createDebugCompatibleScreenManifests UP-TO-DATE > Task :app:mergeDebugShaders UP-TO-DATE > Task :app:compileDebugShaders UP-TO-DATE > Task :app:generateDebugAssets UP-TO-DATE > Task :app:compileDebugRenderscript NO-SOURCE > Task :app:compileDebugAidl NO-SOURCE > Task :app:generateDebugResources UP-TO-DATE > Task :app:mergeDebugResources UP-TO-DATE > Task :app:processDebugManifest > Task :app:processDebugResources FAILED AGPBI: {"kind":"error","text":"Android resource linking failed","sources":[{"file":"D:\\Users\\lenovo\\AndroidStudioProjects\\Pinduoduo\\app\\src\\main\\res\\layout\\activity_main.xml","position":{"startLine":34}}],"original":"D:\\Users\\lenovo\\AndroidStudioProjects\\Pinduoduo\\app\\src\\main\\res\\layout\\activity_main.xml:35: AAPT: error: '#875ale' is incompatible with attribute textColor (attr) reference|color.\n ","tool":"AAPT"} FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':app:processDebugResources'. > A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade > Android resource linking failed D:\Users\lenovo\AndroidStudioProjects\Pinduoduo\app\src\main\res\layout\activity_main.xml:35: AAPT: error: '#875ale' is incompatible with attribute textColor (attr) reference|color. * 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 3s 11 actionable tasks: 2 executed, 9 up-to-date
06-07
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Granger_g

大爷,赏小女子口饭吃如何?

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值