Agent48
Agent48

Reputation: 61

Failed to resolve Ksoap2

I have a problem with Android Studio saying:

failed to resolve com.google.code.ksoap2-android:ksoap2-android:3.6.1

Here is my build.gradle:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 19
    buildToolsVersion '25.0.0'

    defaultConfig {
        applicationId "com.example.papiroomdemo.webservicetest"
        minSdkVersion 15
        targetSdkVersion 19
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
        repositories {
            maven { url 'http://ksoap2-android.googlecode.com/svn/m2-repo' }

        }

    }
}

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')

    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:23.2.1'
    compile 'com.google.code.ksoap2-android:ksoap2-android:3.6.1'
    compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.5'
    compile 'de.hdodenhof:circleimageview:2.0.0'
    compile 'com.hannesdorfmann.smoothprogressbar:library:1.0.0'
    compile 'com.github.castorflex.smoothprogressbar:library-circular:1.0.0'
}

Error:(30, 13) Failed to resolve: com.google.code.ksoap2-android:ksoap2-android:3.6.1 Show in File
Show in Project Structure dialog

Upvotes: 5

Views: 3933

Answers (3)

soggypants
soggypants

Reputation: 425

Since there's no new answers and old answers didn't work for me:

I created my new Android project today and it was automatically configured to look for repositories in settings.gradle. So I added maven url to settings.gradle -> dependencyResolutionManagement -> repositories.

dependencyResolutionManagement {
    repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
    repositories {
        google()
        mavenCentral()
        maven { url 'https://oss.sonatype.org/content/repositories/ksoap2-android-releases/' }
    }
}

and

implementation 'com.google.code.ksoap2-android:ksoap2-android:3.3.0'

to Module :app build.gradle

Upvotes: 1

indrajeet jyoti
indrajeet jyoti

Reputation: 431

/// add these lines in module gradle

allprojects {
            repositories {
               google()
               jcenter()
            maven { url 'https://oss.sonatype.org/content/repositories/ksoap2-android-releases/'
           }
     }
}

Upvotes: 0

Vadim Kotov
Vadim Kotov

Reputation: 8284

I think your url in repositories section is invalid. You should add https://oss.sonatype.org/content/repositories/ksoap2-android-releases/:

repositories {
    maven { url 'https://oss.sonatype.org/content/repositories/ksoap2-android-releases/' }
}

More info here: http://simpligility.github.io/ksoap2-android/getting-started

Upvotes: 7

Related Questions