添加 Fragment 后,Android Studio 分解了我的 build.gradle 文件 [英] Android studio broke up my build.gradle file after add a Fragment

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

问题描述

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

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

我发现了一个无法报告的错误:在我的项目中添加一个 Fragment 之后,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 :)

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

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆