facebook twitter hatena line email

「Android/HttpRequest通信/DefaultHttpClient/legacy」の版間の差分

提供: 初心者エンジニアの簡易メモ
移動: 案内検索
(ページの作成:「==Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Lorg/apache/http/client/methods/HttpGet;エラーが出る場合== 以下追加 app/build.gradle andro...」)
 
行1: 行1:
 
==Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Lorg/apache/http/client/methods/HttpGet;エラーが出る場合==
 
==Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Lorg/apache/http/client/methods/HttpGet;エラーが出る場合==
 +
以下追加
 +
app/build.gradle
 +
dependencies {
 +
    implementation group: 'org.apache.httpcomponents', name: 'httpclient', version: '4.5.1'
 +
}
 +
 +
参考:https://stackoverflow.com/questions/41655015/java-and-httpclient-java-lang-noclassdeffounderror
 +
 +
==file was found with OS independent path 'META-INF/DEPENDENCIES'エラーとなる場合は==
 +
 
以下追加
 
以下追加
 
app/build.gradle
 
app/build.gradle
行14: 行24:
 
     }
 
     }
 
  }
 
  }
dependencies {
 
    implementation group: 'org.apache.httpcomponents', name: 'httpclient', version: '4.5.1'
 
}
 
 
参考:https://stackoverflow.com/questions/41655015/java-and-httpclient-java-lang-noclassdeffounderror
 

2018年7月26日 (木) 11:59時点における版

Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Lorg/apache/http/client/methods/HttpGet;エラーが出る場合

以下追加 app/build.gradle

dependencies {
    implementation group: 'org.apache.httpcomponents', name: 'httpclient', version: '4.5.1'
}

参考:https://stackoverflow.com/questions/41655015/java-and-httpclient-java-lang-noclassdeffounderror

file was found with OS independent path 'META-INF/DEPENDENCIES'エラーとなる場合は

以下追加 app/build.gradle

android {
    packagingOptions {
        exclude 'META-INF/DEPENDENCIES'
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/LICENSE.txt'
        exclude 'META-INF/license.txt'
        exclude 'META-INF/NOTICE'
        exclude 'META-INF/NOTICE.txt'
        exclude 'META-INF/notice.txt'
        exclude 'META-INF/ASL2.0'
    }
}