小编Man*_*gla的帖子

无法导入com.squareup.okhttp.OkHttpClient;

我正在研究android studio并从网上获取一些数据.我尝试使用OkHttpClient并将jar添加到我的项目文件夹但仍然无法导入它.

它表明can't resolve symbol okhttp.我尝试了一些解决方案,但无法解决问题.这是我的build.gradle文件

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

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


}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:23.0.0'
    compile 'com.google.android.gms:play-services:8.4.0'
 //   compile files('libs/okhttp-3.0.1.jar')
   // compile files('libs/okio-1.6.0.jar')


}
Run Code Online (Sandbox Code Playgroud)

android gradle okhttp

8
推荐指数
1
解决办法
2万
查看次数

标签 统计

android ×1

gradle ×1

okhttp ×1