2016-10-21 20 views
2

この質問はここにたくさんありました。私はすべてのソリューションを試しました。私はアプリのソースコードを持っている。私はそれを構築したいが、私はこのエラーを取得しています:エラー:オプションのライブラリを見つけることができません:org.apache.http.legacyAndroidスタジオ:エラー:オプションのライブラリを見つけることができません:org.apache.http.legacy

ここではbuild.gradle(モジュールアプリ)

の一部です。ここで
apply plugin: 'com.android.application' 

android { 
    compileSdkVersion 21 
    buildToolsVersion '21.1.2' 

    dexOptions { 
     javaMaxHeapSize "4g" 
    } 

    useLibrary 'org.apache.http.legacy' 

    defaultConfig { 
     applicationId "com.sensiblewallet" 
     minSdkVersion 16 
     targetSdkVersion 21 
     multiDexEnabled true 
    } 

    signingConfigs { 
     release { 
      storeFile file("android.keystore") 
      storePassword "123456" 
      keyAlias "sensiblewallet" 
      keyPassword "123456" 
     } 
    } 

    buildTypes { 
     release { 
      //minifyEnabled false 
      //proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt' 
      //signingConfig signingConfigs.release 
      //multiDexEnabled true 
     } 
    } 
} 

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' 
    } 
} 

allprojects { 
    repositories { 
     jcenter() 
    } 
} 

私が間違って何が起こっているのか...すべてのものを試してみましたか?助けてください、ありがとう!

+0

を、私はあなたが' useLibrary「org.apache.http.legacy''を必要としないと思います。 'compileSdkVersion'を23以上に設定するまで、これは必須ではありません。だから、あなたはその行をコメントアウトすることができます。今度は、あなたの 'compileSdkVersion'を何かより上位に設定するべきです(最新は25です)。しかし、それを行い、あなたの' buildToolsVersion'を更新すると、そのライブラリが読み込まれる可能性があります。 – CommonsWare

答えて

0

あなたはAPI 23+を使用する必要があります。21の `compileSdkVersion`で

android { 
    compileSdkVersion 23 
    buildToolsVersion "23.0.0" 

    useLibrary 'org.apache.http.legacy' 

} 
+0

これはもう動作しません –

関連する問題