android - Build.Gradle(Module App)未知属性

标签 android gradle build.gradle

我在Gradle的syn上遇到了这个问题
enter image description here

这是build.gradle(Module app)的代码

    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'
}

我试图删除一些编译行,但是我没有解决该问题,

最佳答案

您的文件中几乎没有错别字:

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

您不应在compile之后换行。
dependencies块的典型结构为:
dependencies {
    // production
    compile 'group:name:version'

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

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

如果您确实想换行(我什至都​​不知道为什么),则必须在依赖项定义周围显式添加括号:
compile (
    'com.github.bumptech.glide:glide:3.7.0'
)

关于android - Build.Gradle(Module App)未知属性,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44454266/

相关文章:

java - glTexImage3D - 无效操作

java - IntelliJ IDEA : How to import a project that has Java and JavaScript modules?

android - 如何检测已弃用的 androidx.legacy.widget.Space 类?

android - 执行过去迭代备份时出现异常 : Source

android - 在 android studio 中将依赖项添加到我的 build.gradle 时出错(与依赖项冲突)

Gradle 构建失败 : Could not resolve all dependencies for configuration ':classpath'

java - 如何在 Android 中调整位图图像的大小

android - Room SQLITE 使用 JOINS 从多个表中删除查询

java - 如何将自定义证书添加到 Jenkins 内部 JDK?

java - 当我向其文本字段添加数字时,我的 Android 应用程序不显示任何内容