Gradle indentation issue in Android Studio 2.3

Each time I create a new Activity in AS 2.3, it messes up the build.gradle indent, which leads to errors like this.

Error: Failed to get an unknown "compile" property for an object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.

I have to redo the recesses every time. Any idea how to fix this forever?

+6
source share
2 answers

The problem is apparently caused by lines that contain curly braces like:

compile('com.github.tony19:logback-android-core:1.1.1-4') {
    exclude group: 'ch.qos.logback.core.net'
}

, "" (.. compile 'something') , :

compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
    exclude group: 'com.android.support', module: 'support-annotations'
})

compile('com.github.tony19:logback-android-core:1.1.1-4') {
    exclude group: 'ch.qos.logback.core.net'
}
compile('com.github.tony19:logback-android-classic:1.1.1-4') {
    exclude group: 'ch.qos.logback.core.net'
}

compile 'com.bolyartech.forge.android:forge-android:6.1.0'
compile 'com.bolyartech.scram_sasl:scram_sasl:2.0.0'
compile 'com.android.support:multidex:1.0.1'
compile 'com.squareup:otto:1.3.6'
compile 'com.google.code.gson:gson:2.7'
compile 'com.github.franmontiel:PersistentCookieJar:v0.9.3'
compile 'com.google.dagger:dagger:2.9'
...
0

gradle.

compile 'com.android.support:appcompat-v7:22.2.1' compile

 'com.parse:parse-android:1.11.0'

gradle build , , . , Java JDK.

+1

Source: https://habr.com/ru/post/1015975/


All Articles