android-studio-2.2

How to add and import .jar files in android stduio


I am following this link: http://programmerguru.com/android-tutorial/how-to-call-asp-net-web-service-in-android/#project-structure to add the soap service in my project. I need to add this file: ksoap2-android-assembly-2.4-jar-with-dependencies in my project.

So my question is how can I add the above .jar file in my project to avoid the red highlighted errors in the image below?. Thanks in advance

Error Image:


Solution

  • Did you tell the gradle script to compile your jar file?

    you can follow this link Android Studio: Add jar as library?

    Simply add this line in your app gradle

    implementation files('libs/ksoap2_3.6.3.jar')