首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Ksoap2库到安卓演播室错误消息,如何修复?

Ksoap2库到安卓演播室错误消息,如何修复?
EN

Stack Overflow用户
提问于 2020-12-28 03:43:24
回答 2查看 1K关注 0票数 1

我试图使用Ksoap2文件3.6.4版本在android中导入.jar库。我已经成功地将jar文件实现到了android。但是,在模块app活动中,当我试图导入“org.ksoap2.soapEnKabe;”时,它得到并出错了,它显示了以下结果:

“任务执行失败”:app:checkDebugAarMetadata‘。

无法解析配置的所有文件“:app:调试器运行时Could”。找不到com.google.code.ksoap2-android:ksoap2-android:3.6.4.在以下位置搜索:- https://repo.maven.apache.org/maven2/com/google/code/ksoap2-android/ksoap2-android/3.6.4/ksoap2-android-3.6.4.pom - https://dl.google.com/dl/android/maven2/com/google/code/ksoap2-android/ksoap2-android/3.6.4/ksoap2-android-3.6.4.pom - https://jcenter.bintray.com/com/google/code/ksoap2-android/ksoap2-android/3.6.4/ksoap2-android-3.6.4.pom所需: project :app

可能的解决办法:

提供工件的

  • 声明存储库,请参阅的文档

此外,导入库也有错误,请参见图:

下面是Build.gradle模块代码:

代码语言:javascript
复制
buildscript {
    repositories {
        google()
        jcenter()

    }
    dependencies {
        classpath "com.android.tools.build:gradle:4.1.1"


        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }

}

allprojects {
    repositories {
        mavenCentral()
        google()
        jcenter()
    }
}

task clean(type: Delete) {
   delete rootProject.buildDir
}

下面是Build.gradle(app)模块代码:

代码语言:javascript
复制
plugins {
    id 'com.android.application'
}

android {
    compileSdkVersion 30
    buildToolsVersion "30.0.3"

    defaultConfig {
        applicationId "com.kowloondairycompanykdl.milk_ic"
        minSdkVersion 27
        targetSdkVersion 30
        versionCode 1
        versionName "1.0"

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
}

dependencies {

    implementation 'androidx.appcompat:appcompat:1.2.0'
    implementation 'com.google.android.material:material:1.2.1'
    implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
    implementation files('libs\\ksoap2-android-assembly-3.6.4.jar')
    testImplementation 'junit:junit:4.+'
    androidTestImplementation 'androidx.test.ext:junit:1.1.2'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.google.code.ksoap2-android:ksoap2-android:3.6.4'

}

请帮帮我,我被困在这里很久了。如何修复错误以及如何正确地实现Ksoap2库。谢谢

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2020-12-28 03:50:28

似乎没有那个库的3.4.3版本。有一个3.4.0。最新的是3.6.4。你需要用其中之一。我会转到3.6.4,因为3.4.0已经超过5年了,而且可能缺乏安全更新。

票数 1
EN

Stack Overflow用户

发布于 2022-01-31 20:24:47

从dependencyResolutionManagement文件中删除setting.gradle块,使您的项目以旧的方式工作。

相关问题:Build was configured to prefer settings repositories over project repositories but repository 'maven' was added by build file 'build.gradle'

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/65472778

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档