2016-10-21 3 views
1

지금은 오랜 시간 동안이 오류에 직면하고있다 ..안드로이드 빌드 Gradle을 제공 complie() 오류

Error:(24, 0) Could not find method compile() for arguments 
    [com.google.code.gson:gson:2.3] on object of type 
    org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler. 

내 루트 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:2.2.1' 
     // NOTE: Do not place your application dependencies here; they belong 
     // in the individual module build.gradle files 
    } 
} 
allprojects { 
    repositories { 
     jcenter() 
    } 
} 
task clean(type: Delete) { 
    delete rootProject.buildDir 
} 



//apply plugin: 'com.android.application' 
// 
//android { 
// compileSdkVersion 23 
// buildToolsVersion '23.0.0' 
//} 

입니다 그리고 내 module/build.gradle

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

    compileSdkVersion 23 
    buildToolsVersion "23.0.0" 

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

    repositories { 
     flatDir { 
      dirs 'aars' 
     } 
    } 
} 

dependencies { 
    compile fileTree(dir: 'libs', include: ['*.jar']) 
    compile 'com.google.code.gson:gson:2.3' 
    compile 'com.google.guava:guava:18.0' 
    compile 'com.squareup.okhttp:okhttp:2.5.0' 
    compile 'com.microsoft.azure:azure-mobile-android:3.1.0' 
    compile (group: 'com.microsoft.azure', name: 'azure-notifications-handler', version: '1.0.1', ext: 'jar') 
} 
입니다

누군가 올바른 방향으로 나를 안내 해줄 수 있습니까 ..

그리고 전에 "안드로이드 방법"에 대한 비슷한 오류가 발생했습니다 ..

많이 봤지만 많이 사용하지 않았습니다. 미리 감사드립니다.

+0

GSON 라이브러리를 마지막 버전으로 업데이트하려고 했습니까? 'compile'com.google.code.gson : gson : 2.7''? –

+0

네 .. .. 작동하지 않았다 .. – Kshitij

답변

0

파일에 문제가있는 것으로 보입니다.

구조 같아야

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

    compileSdkVersion 23 
    buildToolsVersion "23.0.0" 

    defaultConfig { ... } 
    buildTypes { 
     release {...} 
    } 
} 

repositories { .. } 

dependencies { 
    //.. 
} 
android 블록 외부 repositories 블록을 이동

.

+0

그래, 내가 .. 똑같은 문제를 다시 ... – Kshitij

관련 문제