2017-07-09 44 views
0

我正在使用Android Studio,并决定将recyclerView添加到build.gradle。但之后添加它和同步gradle这个我得到这个错误:gradle无法正常工作

enter image description here

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

连我自己重建项目但这项任务还我得到了同样的错误。对于其他方式,我做了无效的缓存/重新启动但它没有工作仍存在我的问题。 我关闭即时运行但我得到同样的错误。 我删除.gradle文件夹在我的用户,仍然有这个错误! 我怎么能通过这个问题?

我的build.gradle:

apply plugin: 'com.android.application' 

android { 
compileSdkVersion 26 
buildToolsVersion "26.0.0" 
defaultConfig { 
    applicationId "com.example.sayres.mychat" 
    minSdkVersion 15 
    targetSdkVersion 26 
    versionCode 1 
    versionName "1.0" 
    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 
} 
buildTypes { 
    release { 
     minifyEnabled false 
     proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
    } 
} 
} 

dependencies { 
compile fileTree(include: ['*.jar'], dir: 'libs') 
androidTestCompile('com.android.support.test.espresso:espresso- core:2.2.2', { 
    exclude group: 'com.android.support', module: 'support-annotations' 
}) 
compile('org.eclipse.paho:org.eclipse.paho.android.service:1.0.2') { 
    exclude module: 'support-v4' 
} 
compile('org.eclipse.paho:org.eclipse.paho.android.service:1.0.3-SNAPSHOT') { 
    exclude module: 'support-v4' 
} 
compile 'com.android.support:appcompat-v7:26.+' 
compile 'com.android.support.constraint:constraint-layout:1.0.2' 
testCompile 'junit:junit:4.12' 
} 

编辑:

Error: Some file crunching failed, see logs for details 

:应用:mergeDebugResources失败

失败:构建失败

在gradle这个控制台apeare这些线路

除了例外。

  • 出了什么问题: 执行失败的任务 ':应用程序:mergeDebugResources'。

    Error: Some file crunching failed, see logs for details

  • 尝试: 与--stacktrace选项获取堆栈跟踪运行。使用--info或--debug选项运行以获取更多日志输出。

    构建失败

总时间:3.358秒

,这是我的日志:enter link description here

我删除构建文件夹,但我得到了同样的错误。在这些文件夹中没有PNG图像。

+0

向你添加gradle问题。 –

+0

您发布的帖子不是错误。 – Henry

+0

@亨利我添加图片 –

回答

1

试试这个的gradle中,请确保您清理项目:

android { 
aaptOptions { 
      cruncherEnabled = false 
     } 
} 

希望这有助于。

+0

我添加,但我得到同样的错误。 –

+0

不要复制android标签只需复制aaptOptions并将其粘贴到android标签中。 –

+0

我知道了,我只是复制aaptOptions。 –