我在Gradle的syn上遇到了这个问题
这是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/