我想補充OkHttp
到我的項目,我同時下載OkHttp
和Okio
庫,並將其添加到libs
目錄。OkHttp添加到我的項目
比我添加編譯方法:
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.3'
compile 'com.squareup.okhttp3:okhttp:3.4.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
}
我嘗試建立的應用程序,我得到這個錯誤:
Error:(27, 1) A problem occurred evaluating root project 'APP'.
> Could not find method compile() for arguments [com.squareup.okhttp3:okhttp:3.4.1] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.
任何想法可能是什麼問題?我使用過Android Studio OM MAC OS