Remember to trample a pit: The okhttp dependency conflict problem caused by using ksoap-android

Source: Internet
Author: User

The WebService interface needs to be called in the project, and there is no direct access to the WebService interface in the Android SDK, so I introduced the Ksoap-android jar package to implement the Access WebService interface. At first it was all quite smooth, the success from the WebService interface to obtain the returned data, directly run on the phone everything is also normal. In short, after one weeks of struggle, is finally complete to achieve the needs of change. At last to take a breath, unexpectedly at the end of packing the signature apk, there is a problem: Error:execution failed for task ': App:transformjarwithdexforrelease ', that is, my jar package file conflicts , check the message message to learn that it is a file conflict in Okhttp. I checked all the jar packages I depended on, external Libraries found okhttp-3.3.0 and okio-1.8.0 (such as), and then look at my libs under the Ksoap-android jar package file (directory structure below), found it also has OKHTTP3 and Okio dependent files, finally found a place, but how Solve another problem, in the online search a lot of information, and busy most of the day, tried various methods, finally solved.

Online method also tried a lot, finally found a simple and easy to use method, is I directly deleted ksoap-android this jar package OKHTTP3 and Okio These two folders, in Android Studio is not directly delete the files in the jar package, So find our original jar in the folder, with WinRAR (or other unzip tool) open, select the OKHTTP3 and Okio folder, delete directly, and then copy the new jar package to the Libs folder, replace the previous jar package, finally, In the Ksoap-android jar package has no OKHTTP3 and Okio folder, but do not be afraid, because our project has introduced Okhttp, finally packaged signature, finished, tested, the application is still working, perfect!!!!!

Remember to trample a pit: The okhttp dependency conflict problem caused by using ksoap-android

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.