Android studio broke up my build.gradle file after add a Fragment

泪湿孤枕 提交于 2019-11-28 23:10:29
afj88

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 :)

Delete all comments in your gradle file

put your constraint-layout on the bottom, it will not scramble again (i don't know why, but it works)

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])

    // support lib
    compile "com.android.support:appcompat-v7:$supportlib_version"

    // kotlin
    compile "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"

    // ...

    compile 'com.android.support.constraint:constraint-layout:1.0.2'
    testCompile 'junit:junit:4.12'
}
vishu srivastava

just reformat your project level gradle . It will work fine. These compile statement got dis-formatted. Just hit Enter before every "compile" it should be like:

compile 'com.android.support:support-v13:23.4.0'
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.android.support:recyclerview-v7:23.4.0'
compile 'com.android.support:cardview-v7:23.4.0'
compile 'com.android.support:design:23.4.0'

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!