What is the correct Way to integrate KSOAP library in Android Studio?
Solution: inside build.gradle
of a module (not project) write:
repositories { maven { url 'https://oss.sonatype.org/content/repositories/ksoap2-android-releases/' }}
and inside Dependencies
implementation 'com.google.code.ksoap2-android:ksoap2-android:3.6.2'
in Android Studio, you have two build.gradle File:
My first file (Project):
buildscript { repositories { jcenter() google() } dependencies { classpath 'com.android.tools.build:gradle:3.1.2' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files }}task clean(type: Delete) { delete rootProject.buildDir}
and my Second File (Module):
apply plugin: 'com.android.application'android { compileSdkVersion 25 buildToolsVersion '27.0.3' defaultConfig { applicationId "com.asemansystem.com.caferc" minSdkVersion 15 targetSdkVersion 25 versionCode 1 versionName "1.0" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } }}repositories { mavenCentral() maven { url 'https://oss.sonatype.org/content/repositories/ksoap2-android-releases/' }}dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { exclude group: 'com.android.support', module: 'support-annotations' }) compile 'com.android.support:appcompat-v7:25.3.1' compile 'com.android.support.constraint:constraint-layout:1.0.0-alpha7' compile 'com.android.support:design:25.3.1' compile 'com.android.support:support-v4:25.3.1' compile 'com.google.code.ksoap2-android:ksoap2-android:3.6.2' testCompile 'junit:junit:4.12'}
Goto to this link and download the jar file. Then add the downloaded jar file to your libs folder inside your app folder(Your Project->app->libs).Then right click on the ksoap jar file and select "Add as Library".
Done.
EDIT : UPDATED THE LINK