2017-11-06 8 views
0

Androidスタジオの最新のアップデート後、アプリをビルドしてデバッグモードで実行できますが、次のエラーによりに対してバージョン:コモンズバリデータとエラー「コモンズロギングは、現在Androidで提供されているクラスと競合するクラスを定義しています」

Error:Error: commons-logging defines classes that conflict with classes now provided by Android. Solutions include finding newer versions or alternative libraries that don't have the same problem (for example, for httpclient use HttpUrlConnection or okhttp instead), or repackaging the library using something like jarjar. [DuplicatePlatformClasses]

私はthis postthis postを読みました。両方の答えは、「除外モジュール: 'httpclient'」を提案します。私の場合の問題は解決しません。私はそれが以下に関連していることを確信しています:

compile 'commons-validator:commons-validator:1.6' 

救済のヒントを教えてもらえますか?

答えて

2

問題はcommons-loggingです。だからそれは除外されなければならない。 app/build.gradleに次のコードを追加します。それは動作するはずです。

configurations { 
    all { 
     exclude module: 'httpclient' 
     exclude module: 'commons-logging' 
    } 
} 
+0

次に、httpclientパッケージが見つからないというエラーが発生します – UnKnown

+0

これは、プロジェクトがhttpclientモジュールを使用していることを意味します。共通ログモジュールのみを除外してみてください – srs

+0

実際にエラーの説明を知りたいのですが。それは、httpの古い方法と新しい方法を矛盾させることを意味しますか? – UnKnown

関連する問題