Android/HttpRequest通信/DefaultHttpClient/legacy
提供: 初心者エンジニアの簡易メモ
2018年7月26日 (木) 11:47時点におけるAdmin (トーク | 投稿記録)による版 (ページの作成:「==Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Lorg/apache/http/client/methods/HttpGet;エラーが出る場合== 以下追加 app/build.gradle andro...」)
Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Lorg/apache/http/client/methods/HttpGet;エラーが出る場合
以下追加 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' } } dependencies { implementation group: 'org.apache.httpcomponents', name: 'httpclient', version: '4.5.1' }
参考:https://stackoverflow.com/questions/41655015/java-and-httpclient-java-lang-noclassdeffounderror