I can not import the .jar ksoap2 in Android Studio

0

I have an Android project in which I want to use the .jar ksoap2.

In Android Studio paste the .jar file in the libs folder of my project, then on that file right click and "Add as Library".

Later I synchronized my gradle, which resulted in Android Studio updating the build.gradle file in the following way:

compile files('libs/ksoap2-android-assembly-3.6.1.jar')

Finally in my MainActivity.java class I try to write import org.ksoap2.Envelope but the IDE does not recognize the class and it disappears, I can not import the class.

Am I making any mistakes in the procedure?

Thank you.

    
asked by Victor Carmona Pale 17.05.2017 в 05:01
source

1 answer

0

To take advantage of gradle, I recommend you try this way:

Import the library using Gradle:

repositories {
     maven { url 'https://oss.sonatype.org/content/repositories/ksoap2-android-releases/' }
}
dependencies {
     compile 'com.google.code.ksoap2-android:ksoap2-android:3.6.1'
}

You can delete the .jar from the libs folder

    
answered by 17.05.2017 / 11:27
source