我正在尝试将Parse.com与Android Studio一起使用,但是在进行所有设置时,我总是收到错误消息:
Error:(8, 0) Gradle DSL method not found: 'compile()'
Possible causes:<ul><li>The project 'REUProject' may be using a version of Gradle that does not contain the method.
<a href="open.wrapper.file">Open Gradle wrapper file</a></li><li>The build file may be missing a Gradle plugin.
<a href="apply.gradle.plugin">Apply Gradle plugin</a></li>
这是我的build.gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 22
buildToolsVersion "22.0.1"
defaultConfig {
applicationId "edu.fiu.mpact.reuproject"
minSdkVersion 14
targetSdkVersion 22
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}
dependencies {
compile project(':photoView')
compile 'com.android.support:support-v4:22.2.0'
compile files('libs/Parse-1.9.2.jar')
compile files('/Users/Rachelle/AndroidStudioProjects/REUProject/libs/Parse-1.9.2.jar')
}
最佳答案
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.0.0'
}
}
apply plugin: 'com.android.application'
android {
compileSdkVersion 22
buildToolsVersion "22.0.1"
defaultConfig {
applicationId "edu.fiu.mpact.reuproject"
minSdkVersion 14
targetSdkVersion 22
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}
dependencies {
compile project(':photoView')
compile 'com.android.support:support-v4:22.2.0'
compile files('libs/Parse-1.9.2.jar')
compile files('/Users/Rachelle/AndroidStudioProjects/REUProject/libs/Parse-1.9.2.jar')
}
关于java - Gradle无法在Android Studio中同步Parse.com,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30790330/