错误:使用OneDrive SDK时找不到方法repository()

时间:2019-03-11 15:31:04

标签: android gradle onedrive

我正在尝试按照here所示的说明使用OneDrive SDK。不幸的是,当我添加SDK安装指南中显示的依赖项时,我无法执行Gradle项目同步。我收到以下错误消息:

ERROR: Could not find method repository() for arguments [build_xqhe0znpcz2uhmxa019kwrtr$_run_closure2@18623fec] on project ':app' of type org.gradle.api.Project.

请有人可以帮助我确定问题吗?我的build.gradle文件如下所示:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 28
    defaultConfig {
        applicationId "com.example.onedrivesdkapp"
        minSdkVersion 16
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
}

repository {
    jcenter()
}

dependency {
    // Include the sdk as a dependency
    compile ('com.onedrive.sdk:onedrive-sdk-android:1.3+') {
        transitive = false
    }

    // Include the gson dependency
    compile ('com.google.code.gson:gson:2.3.1')

    // Include supported authentication methods for your application
    compile ('com.microsoft.services.msa:msa-auth:0.8.+')
    compile ('com.microsoft.aad:adal:1.1.+')
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat-v7:28.0.0'
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}

0 个答案:

没有答案