I\'m trying to make kSOAP working in my Android project with Gradle.
This is my project\'s build.gradle file:
buildscript {
repositories {
I am using @amitav13's solution but the URL of the repository has changed:
repositories {
maven { url 'https://oss.sonatype.org/content/repositories/ksoap2-android-releases' }
}
Current version as of now is 3.6.0
compile 'com.google.code.ksoap2-android:ksoap2-android:3.6.0'
This did work for me.
I was in the same situation. And I gave up to add that jar from mavencentral.
I added the raw jar as a lib.
Here is the code:
dependencies {
compile files('libs/ksoap2-android.jar')
}
I hope it will help.
More simple solution is just download the .jar from http://www.bvbcode.com/code/ed5zc936-1814251-down and add this .jar file to your libs folder.
Finally in your build.gradle:
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
}
This worked fine for me.
repositories {
maven { url 'https://oss.sonatype.org/content/repositories/ksoap2-android-releases/' }
}
and inside Dependencies
compile 'com.google.code.ksoap2-android:ksoap2-android:3.6.1'
I know there are already answers using a jar file. I wanted to add one with the latest updated links:
Download ksoap2-android-assembly-3.6.4-jar-with-dependencies.jar and add it to folder libs.
in build.grade:
android {
...
configurations {
all {
exclude group: 'com.squareup.okhttp3', module: 'okhttp'
}
}
}
...
dependencies {
...
implementation fileTree(include: '*.jar', dir: 'libs')
...
}
Here's a more minimal version of the build.gradle suggested by Sam that works for me:
apply plugin: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion "20.0.0"
defaultConfig {
applicationId "com.example.test"
minSdkVersion 15
targetSdkVersion 21
versionCode 1
versionName "1.0"
}
buildTypes {
release {
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
repositories {
maven { url 'https://oss.sonatype.org/content/repositories/ksoap2-android-releases' }
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.google.code.ksoap2-android:ksoap2-android:3.6.2'
}
Note that this is the app's build.gradle, I have not made any modifications to the project build.gradle.