在 Android 项目中使用 ksoap2

Using ksoap2 in Android project

我想在 Android Studio 中使用 ksoap2 开始一个项目。我已经使用 Andoid Studio 向导设置了项目。但是如何添加 ksoap2?

ksoap 网站的全部内容是:

Gradle: The same coordinates for the JAR and the release repository URL as used for Apache Maven can be used.

但这并没有多大帮助。我假设我必须修改 Studio 为我生成的 Gradle 脚本中的一个或多个。或者是否存在某种自动化(就像 Nuget 对 Visual Studio 和 C# 项目所做的那样)。

在您的 gradle 构建中使用 compile 'com.google.code.ksoap2-android:ksoap2-android:3.6.1'

您应该将以下几行添加到您的应用级别 build.gradle

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

        dependencies {
            compile 'com.google.code.ksoap2-android:ksoap2-android:3.6.1' 
}