Gradle构建不断失败。文件未找到错误来自缓存

时间:2016-04-01 20:33:14

标签: java android caching

几周前我正在编写应用程序。它当时正在成功运行。今天我尝试打开Android Studio,并继续在gradle构建中收到以下错误:

Executing tasks: [:app:generateDebugSources, :app:generateDebugAndroidTestSources]

Configuration on demand is an incubating feature.
:app:preBuild UP-TO-DATE
:app:preDebugBuild UP-TO-DATE
:app:checkDebugManifest
:app:prepareDebugDependencies
:app:compileDebugAidl
FAILURE: Build failed with an exception.

* What went wrong:
java.io.FileNotFoundException: C:\Users\Yasmeen\Desktop\Tarikh Uni\OrganiserApp\Organiser\.gradle\2.8\taskArtifacts\cache.properties (The system cannot find the file specified)
> C:\Users\Yasmeen\Desktop\Tarikh Uni\OrganiserApp\Organiser\.gradle\2.8\taskArtifacts\cache.properties (The system cannot find the file specified)

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


BUILD FAILED

Total time: 4.88 secs

我不知道该怎么做。我已经用Google搜索并尝试了一些答案,例如删除.gradle文件夹中的脚本文件夹,然后重启Android工作室,但这并没有帮助。

编辑=我尝试复制' cache.properties'文件从...... 2.8 / cache文件夹进入我的项目。它确实进一步进入了gradle构建,但现在出现了这些错误。显示在gradle控制台构建中:

Executing tasks: [:app:generateDebugSources, :app:generateDebugAndroidTestSources]

Configuration on demand is an incubating feature.
:app:preBuild UP-TO-DATE
:app:preDebugBuild UP-TO-DATE
:app:checkDebugManifest
:app:prepareDebugDependencies
:app:compileDebugAidl
:app:compileDebugRenderscript UP-TO-DATE
:app:generateDebugBuildConfig UP-TO-DATE
:app:generateDebugAssets UP-TO-DATE
:app:mergeDebugAssets UP-TO-DATE
:app:generateDebugResValues UP-TO-DATE
:app:generateDebugResources UP-TO-DATE
:app:mergeDebugResources
:app:processDebugManifest
:app:processDebugResources
AGPBI: {"kind":"error","text":"No resource found that matches the given name: attr \u0027windowActionBar\u0027.","sources":[{"file":"C:\\Users\\Yasmeen\\Desktop\\Tarikh Uni\\OrganiserApp\\Organiser\\app\\src\\main\\res\\values\\styles.xml","position":{"startLine":10,"startColumn":4,"startOffset":384,"endLine":13,"endColumn":12,"endOffset":532}}],"original":"","tool":"AAPT"}

AGPBI: {"kind":"error","text":"No resource found that matches the given name: attr \u0027windowNoTitle\u0027.","sources":[{"file":"C:\\Users\\Yasmeen\\Desktop\\Tarikh Uni\\OrganiserApp\\Organiser\\app\\src\\main\\res\\values\\styles.xml","position":{"startLine":10,"startColumn":4,"startOffset":384,"endLine":13,"endColumn":12,"endOffset":532}}],"original":"","tool":"AAPT"}

AGPBI: {"kind":"error","text":"No resource found that matches the given name: attr \u0027windowActionBar\u0027.","sources":[{"file":"C:\\Users\\Yasmeen\\Desktop\\Tarikh Uni\\OrganiserApp\\Organiser\\app\\src\\main\\res\\values-v21\\styles.xml","position":{"startLine":2,"startColumn":4,"startOffset":20,"endLine":7,"endColumn":12,"endOffset":321}}],"original":"","tool":"AAPT"}

AGPBI: {"kind":"error","text":"No resource found that matches the given name: attr \u0027windowNoTitle\u0027.","sources":[{"file":"C:\\Users\\Yasmeen\\Desktop\\Tarikh Uni\\OrganiserApp\\Organiser\\app\\src\\main\\res\\values-v21\\styles.xml","position":{"startLine":2,"startColumn":4,"startOffset":20,"endLine":7,"endColumn":12,"endOffset":321}}],"original":"","tool":"AAPT"}

AGPBI: {"kind":"error","text":"Error retrieving parent for item: No resource found that matches the given name \u0027Theme.AppCompat.Light.DarkActionBar\u0027.","sources":[{"file":"C:\\Users\\Yasmeen\\Desktop\\Tarikh Uni\\OrganiserApp\\Organiser\\app\\build\\intermediates\\res\\merged\\debug\\values\\values.xml","position":{"startLine":19}}],"original":"","tool":"AAPT"}

AGPBI: {"kind":"error","text":"No resource found that matches the given name: attr \u0027colorAccent\u0027.","sources":[{"file":"C:\\Users\\Yasmeen\\Desktop\\Tarikh Uni\\OrganiserApp\\Organiser\\app\\src\\main\\res\\values\\styles.xml","position":{"startLine":3,"startColumn":4,"startOffset":57,"endLine":8,"endColumn":12,"endOffset":376}}],"original":"","tool":"AAPT"}

AGPBI: {"kind":"error","text":"No resource found that matches the given name: attr \u0027colorPrimary\u0027.","sources":[{"file":"C:\\Users\\Yasmeen\\Desktop\\Tarikh Uni\\OrganiserApp\\Organiser\\app\\src\\main\\res\\values\\styles.xml","position":{"startLine":3,"startColumn":4,"startOffset":57,"endLine":8,"endColumn":12,"endOffset":376}}],"original":"","tool":"AAPT"}

AGPBI: {"kind":"error","text":"No resource found that matches the given name: attr \u0027colorPrimaryDark\u0027.","sources":[{"file":"C:\\Users\\Yasmeen\\Desktop\\Tarikh Uni\\OrganiserApp\\Organiser\\app\\src\\main\\res\\values\\styles.xml","position":{"startLine":3,"startColumn":4,"startOffset":57,"endLine":8,"endColumn":12,"endOffset":376}}],"original":"","tool":"AAPT"}

AGPBI: {"kind":"error","text":"Error retrieving parent for item: No resource found that matches the given name \u0027ThemeOverlay.AppCompat.Dark.ActionBar\u0027.","sources":[{"file":"C:\\Users\\Yasmeen\\Desktop\\Tarikh Uni\\OrganiserApp\\Organiser\\app\\build\\intermediates\\res\\merged\\debug\\values\\values.xml","position":{"startLine":25}}],"original":"","tool":"AAPT"}

AGPBI: {"kind":"error","text":"Error retrieving parent for item: No resource found that matches the given name \u0027ThemeOverlay.AppCompat.Light\u0027.","sources":[{"file":"C:\\Users\\Yasmeen\\Desktop\\Tarikh Uni\\OrganiserApp\\Organiser\\app\\build\\intermediates\\res\\merged\\debug\\values\\values.xml","position":{"startLine":30}}],"original":"","tool":"AAPT"}


 FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:processDebugResources'.
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Users\Yasmeen\AppData\Local\Android\sdk\build-tools\23.0.2\aapt.exe'' finished with non-zero exit value 1

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

BUILD FAILED

Total time: 8.22 secs

来自gradles message build:

    Error:(3, 5) No resource found that matches the given name: attr 'windowActionBar'.
C:\Users\Yasmeen\Desktop\Tarikh Uni\OrganiserApp\Organiser\app\src\main\res\values-v21\styles.xml
C:\Users\Yasmeen\Desktop\Tarikh Uni\OrganiserApp\Organiser\app\src\main\res\values\styles.xml
Error:(3, 5) No resource found that matches the given name: attr 'windowNoTitle'.
Error:(11, 5) No resource found that matches the given name: attr 'windowNoTitle'.
Error:(11, 5) No resource found that matches the given name: attr 'windowActionBar'.
Error:(4, 5) No resource found that matches the given name: attr 'colorAccent'.
Error:(4, 5) No resource found that matches the given name: attr 'colorPrimary'.
Error:(20) Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light.DarkActionBar'.
Error:(4, 5) No resource found that matches the given name: attr 'colorPrimaryDark'.
C:\Users\Yasmeen\Desktop\Tarikh Uni\OrganiserApp\Organiser\app\build\intermediates\res\merged\debug\values\values.xml
Error:(26) Error retrieving parent for item: No resource found that matches the given name 'ThemeOverlay.AppCompat.Dark.ActionBar'.
Error:(31) Error retrieving parent for item: No resource found that matches the given name 'ThemeOverlay.AppCompat.Light'.
Error:Execution failed for task ':app:processDebugResources'.
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Users\Yasmeen\AppData\Local\Android\sdk\build-tools\23.0.2\aapt.exe'' finished with non-zero exit value 1

2 个答案:

答案 0 :(得分:0)

在路径中尝试没有空间。 $http.get('/api/myurl/')

答案 1 :(得分:0)

我已经计算了同样的问题,因为我的应用程序模块依赖于另一个库,它们都依赖于一个公共库。公共库的build.gradle包括

dataBinding { enabled = true } 

但是我的申请模块没有包含

dataBinding { enabled = true } 
在android闭包中

。 然后我添加

dataBinding { enabled = true } 

在我的应用程序模块android闭包中。然后我的项目可以正常运行。 希望这可以帮到你。