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.
任意のアイデアを? 2つのbuild.gradleファイルは基本的にあります