错误日志:
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:processDebugResources'.
> Android resource linking failed
Output: E:\saiis1\axframe\build\intermediates\packaged_res\debug\layout\fragment_loading_dialog.xml:10: error: resource style/AVLoadingIndicatorView (aka com.xiaoguo.saiis:style/AVLoadingIndicatorView) not found.
E:\saiis1\axframe\build\intermediates\packaged_res\debug\layout\fragment_loading_dialog.xml:10: error: attribute indicatorColor (aka com.xiaoguo.saiis:indicatorColor) not found.
E:\saiis1\axframe\build\intermediates\packaged_res\debug\layout\fragment_loading_dialog.xml:10: error: attribute indicatorName (aka com.xiaoguo.saiis:indicatorName) not found.
E:\saiis1\axframe\build\intermediates\packaged_res\debug\layout\rv_foot_refresh.xml:9: error: attribute srlEnableLoadMore (aka com.xiaoguo.saiis:srlEnableLoadMore) not found.
E:\saiis1\axframe\build\intermediates\packaged_res\debug\layout\rv_foot_refresh.xml:9: error: attribute srlEnableRefresh (aka com.xiaoguo.saiis:srlEnableRefresh) not found.
E:\saiis1\axframe\build\intermediates\packaged_res\debug\layout\rv_foot_refresh.xml:16: error: attribute srlAccentColor (aka com.xiaoguo.saiis:srlAccentColor) not found.
E:\saiis1\axframe\build\intermediates\packaged_res\debug\layout\rv_foot_refresh.xml:16: error: attribute srlTextSizeTitle (aka com.xiaoguo.saiis:srlTextSizeTitle) not found.
E:\saiis1\axframe\build\intermediates\packaged_res\debug\layout\rv_foot_refresh.xml:37: error: attribute srlAccentColor (aka com.xiaoguo.saiis:srlAccentColor) not found.
E:\saiis1\axframe\build\intermediates\packaged_res\debug\layout\rv_foot_refresh.xml:37: error: attribute srlTextSizeTitle (aka com.xiaoguo.saiis:srlTextSizeTitle) not found.
E:\saiis1\axframe\build\intermediates\packaged_res\debug\layout\rv_head_foot_refresh.xml:9: error: attribute srlEnableLoadMore (aka com.xiaoguo.saiis:srlEnableLoadMore) not found.
E:\saiis1\axframe\build\intermediates\packaged_res\debug\layout\rv_head_foot_refresh.xml:9: error: attribute srlEnableRefresh (aka com.xiaoguo.saiis:srlEnableRefresh) not found.
E:\saiis1\axframe\build\intermediates\packaged_res\debug\layout\rv_head_foot_refresh.xml:16: error: attribute srlAccentColor (aka com.xiaoguo.saiis:srlAccentColor) not found.
E:\saiis1\axframe\build\intermediates\packaged_res\debug\layout\rv_head_foot_refresh.xml:16: error: attribute srlTextSizeTitle (aka com.xiaoguo.saiis:srlTextSizeTitle) not found.
E:\saiis1\axframe\build\intermediates\packaged_res\debug\layout\rv_head_foot_refresh.xml:37: error: attribute srlAccentColor (aka com.xiaoguo.saiis:srlAccentColor) not found.
E:\saiis1\axframe\build\intermediates\packaged_res\debug\layout\rv_head_foot_refresh.xml:37: error: attribute srlTextSizeTitle (aka com.xiaoguo.saiis:srlTextSizeTitle) not found.
E:\saiis1\axframe\build\intermediates\packaged_res\debug\layout\rv_head_refresh.xml:9: error: attribute srlEnableLoadMore (aka com.xiaoguo.saiis:srlEnableLoadMore) not found.
E:\saiis1\axframe\build\intermediates\packaged_res\debug\layout\rv_head_refresh.xml:9: error: attribute srlEnableRefresh (aka com.xiaoguo.saiis:srlEnableRefresh) not found.
E:\saiis1\axframe\build\intermediates\packaged_res\debug\layout\rv_head_refresh.xml:16: error: attribute srlAccentColor (aka com.xiaoguo.saiis:srlAccentColor) not found.
E:\saiis1\axframe\build\intermediates\packaged_res\debug\layout\rv_head_refresh.xml:16: error: attribute srlTextSizeTitle (aka com.xiaoguo.saiis:srlTextSizeTitle) not found.
E:\saiis1\axframe\build\intermediates\packaged_res\debug\layout\rv_head_refresh.xml:37: error: attribute srlAccentColor (aka com.xiaoguo.saiis:srlAccentColor) not found.
Command: C:\Users\18561\.gradle\caches\transforms-1\files-1.1\aapt2-3.2.1-4818971-windows.jar\47d65b3c7dd592bd24d4ae353368d907\aapt2-3.2.1-4818971-windows\aapt2.exe link -I\
C:\Users\18561\AppData\Local\Android\Sdk\platforms\android-28\android.jar\
--manifest\
E:\saiis1\app\build\intermediates\merged_manifests\debug\processDebugManifest\merged\AndroidManifest.xml\
-o\
E:\saiis1\app\build\intermediates\processed_res\debug\processDebugResources\out\resources-debug.ap_\
-R\
@E:\saiis1\app\build\intermediates\incremental\processDebugResources\resources-list-for-resources-debug.ap_.txt\
--auto-add-overlay\
--java\
E:\saiis1\app\build\generated\not_namespaced_r_class_sources\debug\processDebugResources\r\
--custom-package\
com.xiaoguo.saiis\
-0\
apk\
--no-version-vectors\
--output-text-symbols\
E:\saiis1\app\build\intermediates\symbols\debug\R.txt\
--no-version-vectors
Daemon: AAPT2 aapt2-3.2.1-4818971-windows Daemon #0
Output: E:\saiis1\axframe\build\intermediates\packaged_res\debug\layout\fragment_loading_dialog.xml:10: AAPT: error: resource style/AVLoadingIndicatorView (aka com.xiaoguo.saiis:style/AVLoadingIndicatorView) not found.
E:\saiis1\axframe\build\intermediates\packaged_res\debug\layout\fragment_loading_dialog.xml:10: AAPT: error: attribute indicatorColor (aka com.xiaoguo.saiis:indicatorColor) not found.
E:\saiis1\axframe\build\intermediates\packaged_res\debug\layout\fragment_loading_dialog.xml:10: AAPT: error: attribute indicatorName (aka com.xiaoguo.saiis:indicatorName) not found.
E:\saiis1\axframe\build\intermediates\packaged_res\debug\layout\rv_foot_refresh.xml:9: AAPT: error: attribute srlEnableLoadMore (aka com.xiaoguo.saiis:srlEnableLoadMore) not found.
E:\saiis1\axframe\build\intermediates\packaged_res\debug\layout\rv_foot_refresh.xml:9: AAPT: error: attribute srlEnableRefresh (aka com.xiaoguo.saiis:srlEnableRefresh) not found.
E:\saiis1\axframe\build\intermediates\packaged_res\debug\layout\rv_foot_refresh.xml:16: AAPT: error: attribute srlAccentColor (aka com.xiaoguo.saiis:srlAccentColor) not found.
E:\saiis1\axframe\build\intermediates\packaged_res\debug\layout\rv_foot_refresh.xml:16: AAPT: error: attribute srlTextSizeTitle (aka com.xiaoguo.saiis:srlTextSizeTitle) not found.
E:\saiis1\axframe\build\intermediates\packaged_res\debug\layout\rv_foot_refresh.xml:37: AAPT: error: attribute srlAccentColor (aka com.xiaoguo.saiis:srlAccentColor) not found.
E:\saiis1\axframe\build\intermediates\packaged_res\debug\layout\rv_foot_refresh.xml:37: AAPT: error: attribute srlTextSizeTitle (aka com.xiaoguo.saiis:srlTextSizeTitle) not found.
E:\saiis1\axframe\build\intermediates\packaged_res\debug\layout\rv_head_foot_refresh.xml:9: AAPT: error: attribute srlEnableLoadMore (aka com.xiaoguo.saiis:srlEnableLoadMore) not found.
E:\saiis1\axframe\build\intermediates\packaged_res\debug\layout\rv_head_foot_refresh.xml:9: AAPT: error: attribute srlEnableRefresh (aka com.xiaoguo.saiis:srlEnableRefresh) not found.
E:\saiis1\axframe\build\intermediates\packaged_res\debug\layout\rv_head_foot_refresh.xml:16: AAPT: error: attribute srlAccentColor (aka com.xiaoguo.saiis:srlAccentColor) not found.
E:\saiis1\axframe\build\intermediates\packaged_res\debug\layout\rv_head_foot_refresh.xml:16: AAPT: error: attribute srlTextSizeTitle (aka com.xiaoguo.saiis:srlTextSizeTitle) not found.
E:\saiis1\axframe\build\intermediates\packaged_res\debug\layout\rv_head_foot_refresh.xml:37: AAPT: error: attribute srlAccentColor (aka com.xiaoguo.saiis:srlAccentColor) not found.
E:\saiis1\axframe\build\intermediates\packaged_res\debug\layout\rv_head_foot_refresh.xml:37: AAPT: error: attribute srlTextSizeTitle (aka com.xiaoguo.saiis:srlTextSizeTitle) not found.
E:\saiis1\axframe\build\intermediates\packaged_res\debug\layout\rv_head_refresh.xml:9: AAPT: error: attribute srlEnableLoadMore (aka com.xiaoguo.saiis:srlEnableLoadMore) not found.
E:\saiis1\axframe\build\intermediates\packaged_res\debug\layout\rv_head_refresh.xml:9: AAPT: error: attribute srlEnableRefresh (aka com.xiaoguo.saiis:srlEnableRefresh) not found.
E:\saiis1\axframe\build\intermediates\packaged_res\debug\layout\rv_head_refresh.xml:16: AAPT: error: attribute srlAccentColor (aka com.xiaoguo.saiis:srlAccentColor) not found.
E:\saiis1\axframe\build\intermediates\packaged_res\debug\layout\rv_head_refresh.xml:16: AAPT: error: attribute srlTextSizeTitle (aka com.xiaoguo.saiis:srlTextSizeTitle) not found.
E:\saiis1\axframe\build\intermediates\packaged_res\debug\layout\rv_head_refresh.xml:37: AAPT: error: attribute srlAccentColor (aka com.xiaoguo.saiis:srlAccentColor) not found.
Command: C:\Users\18561\.gradle\caches\transforms-1\files-1.1\aapt2-3.2.1-4818971-windows.jar\47d65b3c7dd592bd24d4ae353368d907\aapt2-3.2.1-4818971-windows\aapt2.exe link -I\
C:\Users\18561\AppData\Local\Android\Sdk\platforms\android-28\android.jar\
--manifest\
E:\saiis1\app\build\intermediates\merged_manifests\debug\processDebugManifest\merged\AndroidManifest.xml\
-o\
E:\saiis1\app\build\intermediates\processed_res\debug\processDebugResources\out\resources-debug.ap_\
-R\
@E:\saiis1\app\build\intermediates\incremental\processDebugResources\resources-list-for-resources-debug.ap_.txt\
--auto-add-overlay\
--java\
E:\saiis1\app\build\generated\not_namespaced_r_class_sources\debug\processDebugResources\r\
--custom-package\
com.xiaoguo.saiis\
-0\
apk\
--no-version-vectors\
--output-text-symbols\
E:\saiis1\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 2s
19 actionable tasks: 1 executed, 18 up-to-date
解决办法
compileOnly 'org.greenrobot:eventbus:3.1.1' api("com.scwang.smartrefresh:SmartRefreshLayout:1.0.5-alpha-0") { exclude group: 'com.android.support' } api("com.scwang.smartrefresh:SmartRefreshHeader:1.0.5-alpha-0") { exclude group: 'com.android.support' } api("com.wang.avi:library:2.1.3") { exclude group: 'com.android.support' }
以下方法完全不管用:
configurations.all { resolutionStrategy.eachDependency { DependencyResolveDetails details -> def requested = details.requested if (requested.group == 'com.android.support') { if (!requested.name.startsWith("multidex")) { details.useVersion '28.0.0' } } } }
加入这个后可能还报些其他错误:
但是有时候也不抱,尴尬,可以加下面的显示
// compileOptions { // targetCompatibility 1.8 // sourceCompatibility 1.8 // }