1

我正在尝试按照https://github.com/ParsePlatform/ParseUI-Android上的指南添加 Parse UI 小部件。但是,当我这样做时,我得到一个错误,我的项目可能正在使用不包含该方法的 Gradle 版本,并且构建文件可能缺少 Gradle 插件。

这是我的 Gradle 模块:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.1"

    defaultConfig {
        applicationId "com.example.joakim.boken"
        minSdkVersion 15
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile 'com.parse.bolts:bolts-android:1.+'
    compile fileTree(dir: 'libs', include: 'Parse-*jar')
}


// Module dependency on ParseUI libraries sources
compile project(':ParseUI-Widget')

// Uncomment if using Facebook Login (optional Maven dependency)
// compile 'com.facebook.android:facebook-android-sdk:4.0.1'
// compile files('YOUR_PROJECT_LIBS_PATH/ParseFacebookUtilsV4-1.10.0.jar')

这是我的 build.gradle

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {

    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:1.3.0'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }

}

allprojects {
    repositories {
        jcenter()
    }
}

有人知道我需要添加或删除什么才能使其正常工作吗?我尝试了类似问题的答案,但到目前为止没有任何效果..

我不确定我下载 ZIP 而不是克隆存储库是否重要?

4

1 回答 1

0

您必须在块内移动这条线dependencies

compile project(':ParseUI-Widget')

它应该是:

dependencies {
    compile 'com.parse.bolts:bolts-android:1.+'
    compile fileTree(dir: 'libs', include: 'Parse-*jar')

    // Module dependency on ParseUI libraries sources
    compile project(':ParseUI-Widget')
}
于 2015-10-07T22:54:52.837 回答