简体   繁体   English

Build.Gradle(Module App)未知属性

[英]Build.Gradle (Module App ) unknown property

I have encountered this problem while syn of Gradle 我在Gradle的同步时遇到了这个问题 在此输入图像描述

This is the Code of build.gradle(Module app) 这是build.gradle的代码(模块应用程序)

    apply plugin: 'com.android.application'

android {
    compileSdkVersion 25
    buildToolsVersion "25.0.3"
    defaultConfig {
        applicationId "ahmedchtn.smartschool"
        minSdkVersion 15
        targetSdkVersion 25
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    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'
    })

    //RecyclerView


    //retrofit,gson

    //glide
    compile
    'com.github.bumptech.glide:glide:3.7.0'
compile
    'com.android.support:appcompat-v7:25.3.1'compile
    'com.android.support.constraint:constraint-layout:1.0.2'compile
    'com.android.support:support-v4:25.3.1'compile
    'com.android.support:design:25.3.1'compile
    'com.github.bumptech.glide:glide:3.7.0'compile 'com.android.support:recyclerview-v7:25.3.1'
    compile 'com.google.code.gson:gson:2.6.2'
    compile 'com.squareup.retrofit2:retrofit:2.0.2'
    compile 'com.squareup.retrofit2:converter-gson:2.0.2'
    testCompile 'junit:junit:4.12'
}

I have tried to deleted some lines of compile but I did not arrive to resolve the problem, 我试图删除一些编译行,但我没有到达解决问题,

You have few typos in your file: 您的文件中几个拼写错误:

compile 'com.github.bumptech.glide:glide:3.7.0'
compile 'com.android.support:appcompat-v7:25.3.1'

You should not have line break after compile . compile后你不应该有换行符。

Typical structure of dependencies block is: dependencies块的典型结构是:

dependencies {
    // production
    compile 'group:name:version'

    // for local tests
    testCompile 'group:name:version'

    // for tests on device / emulator
    androidTestCompile 'group:name:version'
}

If you really want to have line break (I don't even know why) you have to explicitly add parentheses around dependency definition: 如果你真的想要换行(我甚至不知道为什么)你必须在依赖关系定义周围显式添加括号:

compile (
    'com.github.bumptech.glide:glide:3.7.0'
)

Change it to this. 把它改成这个。

compile 'com.github.bumptech.glide:glide:3.7.0'
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.android.support:support-v4:25.3.1'
compile 'com.android.support:design:25.3.1'
compile 'com.github.bumptech.glide:glide:3.7.0'
compile 'com.android.support:recyclerview-v7:25.3.1'
compile 'com.google.code.gson:gson:2.6.2'
compile 'com.squareup.retrofit2:retrofit:2.0.2'
compile 'com.squareup.retrofit2:converter-gson:2.0.2'
testCompile 'junit:junit:4.12'

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM