本文介绍了Android的工作室 - mergeDebugResources异常的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近更新了Android工作室到它的最新版本,现在我遇到的异常头痛的摇篮建设。

I recently updated the Android Studio to it's latest version, and now I am experiencing a headache with an exception in Gradle build.

我每次运行该项目,才两三次成功,我得到以下错误:

Every time I run the project, two or three times before it succeed, I get the following error:

Gradle: Execution failed for task ': ProjectName:
mergeDebugResources'.
Java.lang.NullPointerException (no error message)

后再次尝试了几次,错误不会再次发生,直到下一次运行。

After trying again a couple times, the error does not happen again until the next run.

没有任何人有这为什么发生任何想法?该项目的工作只是罚款,直到更新,从来没有得到任何错误之前...

Does anybody have any idea of why this is happening? The project worked just fine 'til the update, never got any error before...

谢谢!

推荐答案

我找到了一个解决问题的办法。

I found a solution to the problem.

目前报约摇篮建设问题的问题,这是不一样的,但解决方案似乎解决了mergeResourceDebug问题了。 (问题在这里<一href="https://$c$c.google.com/p/android/issues/detail?id=56158">https://$c$c.google.com/p/android/issues/detail?id=56158).在评论中指出,该解决方案解决了摇篮0.4.3。

There is an issue reported about gradle build problems, it is not the same, but the solution seems to solve the mergeResourceDebug issues too. (issue here https://code.google.com/p/android/issues/detail?id=56158). In the comments it is stated that the solution is solved in Gradle 0.4.3.

要使用摇篮0.4.3,该build.gradle文件需要手动更新。 (更新Android的Studio不会改变构建文件)

To use Gradle 0.4.3, the build.gradle file needs to be updated manually. (Updating Android Studio does not change the build file)

下面是我改变了在build.gradle:

Here is what I changed In build.gradle:

dependencies {
    classpath 'com.android.tools.build:gradle:0.4.3'
}

由于改变这一点,我还没有运行我的项目时,看到的更多mergeDebugResource问题。希望这有助于!

Since changing this, I have not seen any more mergeDebugResource issues when running my project. Hope this helps!

编辑:熬夜到最新与摇篮,你可以更改版本号为0.4 +

to stay up to date with Gradle you can change the version number to 0.4.+

这篇关于Android的工作室 - mergeDebugResources异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-03 04:59