本文介绍了添加片段后,Android Studio破坏了我的build.gradle文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在El Capitan上使用Android Studio 2.0,如下图所示:

Using Android Studio 2.0 over El Capitan like the next screenshot said:

我发现了一个我无法报告的错误:在将片段添加到我的项目之后,AS拧紧了我的模块build.gradle文件.我的意思是,在添加片段之前,它们的文件如下图所示:

I found a bug that I can't report:After add a Fragment to my project, AS screw up my module build.gradle file. I mean, before add the fragment they file looks like this screenshot:

,但是在以这种方式添加Fragment AS螺丝之后:

but after add the Fragment AS screw it in this way:

再现它的方式就像我在下一个屏幕截图中所示:

The way to reproduce it is like I'm showing in next screenshot:

我可以手动修复它,但是每次添加一个Fragment时都非常烦人.反正有解决办法吗?

I can fix it manually, but its so annoying doing it every single time that I add a Fragment. Is there anyway to fix it?

我正在与El Capitan一起使用Mac OX.

I'm on Mac OX with El Capitan.

推荐答案

这是一个尚待解决的错误,您可以监控其状态此处

It is a still open bug, you can monitor it's state here

该错误是由于依赖项部分中的注释所致,暂时的解决方法是将其从此处删除.我也把评论放在那里是有原因的:)

The bug is due to the comments in the dependencies section, a temporal fix could be to remove them from there. I placed the comments there for a reason too :)

这篇关于添加片段后,Android Studio破坏了我的build.gradle文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-06 05:37