Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I was working through a lecture using the parse.com starter program for two days with no issue. I went away for a few minutes and without anything that I can see being changed and now it won't sync. I have searched but found nothing that I can see wrong. Thanks in advance for your help.

This is the error:

Error:(36, 0) Could not find property 'compile' on org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler_Decorated@397740e0.

Open File

This is my gradle file:

apply plugin: 'com.android.application'
apply plugin: 'com.parse'

buildscript {
    repositories {
        mavenCentral()
        maven { 
            url 'https://maven.parse.com/repo' 
        }
    }
    dependencies {
        classpath 'com.parse.tools:gradle:1.+'
    }
}

android {
    compileSdkVersion rootProject.ext.compileSdkVersion
    buildToolsVersion rootProject.ext.buildToolsVersion

    defaultConfig {
        applicationId "com.parse.starter"
        minSdkVersion rootProject.ext.minSdkVersion
        targetSdkVersion rootProject.ext.targetSdkVersion
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {


    compile
    'com.android.support:appcompat-v7:22.2.1' compile
    'com.parse.bolts:bolts-tasks:1.3.0' compile
    'com.parse:parse-android:1.11.0' compile
    'com.android.support:design:22.2.1'
    compile 'com.android.support:design:22.2.1'
}

/* Uncomment if you enable ProGuard and you want to automatically upload symbols on build.
parse {
  applicationId "YOUR_APPLICATION_ID"
  masterKey "YOUR_MASTER_KEY"

  // Make symbol upload automatic. Otherwise, use e.g. ../gradlew parseUploadSymbolsDebug;
  uploadSymbols true
}
*/
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
314 views
Welcome To Ask or Share your Answers For Others

1 Answer

You've used compile as a property, but it isn't one. You need to pass a string argument to it.

compile 'com.android.support:appcompat-v7:22.2.1' 
compile 'com.parse.bolts:bolts-tasks:1.3.0' 
compile 'com.parse:parse-android:1.11.0'
compile 'com.android.support:design:22.2.1'
compile 'com.android.support:design:22.2.1'

EDIT: As people have mentioned in the comments, you shouldn't have two identical dependencies. However this doesn't cause the problem you described. I believe it might cause an "Unexpected Top Level Exception" when you build with gradle.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...