android 模块版本未找到异常

blmhpbnm  于 2022-11-20  发布在  Android
关注(0)|答案(4)|浏览(165)

当我点击运行按钮,然后我得到这个错误
错误:org.gradle.api.工件。解决异常:无法解析配置“:app:_debugApkCopy”的所有依赖项。
错误:未找到模块版本异常:无法找到com.android.support。
请参见以下屏幕截图

当我尝试gradle同步时,我遇到了这个问题
请参见以下屏幕截图

我建筑。Gradle

buildscript {
    repositories {
        maven { url 'https://maven.fabric.io/public' }
    }
    dependencies {
        classpath 'io.fabric.tools:gradle:1.+'
    }

}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'

repositories {
    maven { url 'https://maven.fabric.io/public' }
}
android {
    signingConfigs {
        config {
        }
    }
    repositories {
        mavenCentral()
    }
    compileSdkVersion 25
    buildToolsVersion '26.0.0'
    useLibrary 'org.apache.http.legacy'
    defaultConfig {
        applicationId "com.hechat"
        minSdkVersion 18
        targetSdkVersion 25
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        multiDexEnabled true

    }
    dexOptions {
        javaMaxHeapSize "2048M"
    }
    packagingOptions {
        exclude 'META-INF/DEPENDENCIES.txt'
        exclude 'META-INF/LICENSE.txt'
        exclude 'META-INF/NOTICE.txt'
        exclude 'META-INF/NOTICE'
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/DEPENDENCIES'
        exclude 'META-INF/notice.txt'
        exclude 'META-INF/license.txt'
        exclude 'META-INF/dependencies.txt'
        exclude 'META-INF/LGPL2.1'
        exclude 'project.properties'
        exclude 'META-INF/INDEX.LIST'

    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }

}

    repositories {
        maven { url "https://dl.bintray.com/hani-momanii/maven" }
    }
dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
        exclude group: 'com.google.code.findbugs'
    })
    compile('com.twitter.sdk.android:twitter:2.3.1@aar') { transitive = true; }
    compile('com.crashlytics.sdk.android:crashlytics:2.6.5@aar') { transitive = true; }
    compile 'com.facebook.android:facebook-android-sdk:[4,5)'
    compile 'com.theartofdev.edmodo:android-image-cropper:2.3.1'
    compile 'com.android.support:appcompat-v7:25.0.0'
    compile 'com.android.support:cardview-v7:25.0.0'
    compile 'com.android.support:design:25.0.0'
    compile 'net.gotev:uploadservice:2.1'
    compile 'com.android.support:recyclerview-v7:25.0.0'
    compile 'com.squareup.picasso:picasso:2.5.2'
    compile 'hani.momanii.supernova_emoji_library:supernova-emoji-library:0.0.2'
    compile 'com.google.android.gms:play-services:11.0.4'
    compile 'com.google.firebase:firebase-core:10.2.1'
    compile 'com.google.code.gson:gson:2.3'
    compile 'org.apache.httpcomponents:httpcore:4.3.2'
    compile 'org.apache.httpcomponents:httpmime:4.3.3'
    compile 'com.mcxiaoke.volley:library:1.0.17'
    compile 'com.github.clans:fab:1.6.2'
    compile 'org.jsoup:jsoup:1.8.1'
    compile 'com.parse.bolts:bolts-tasks:1.4.0'
    compile 'com.commit451:PhotoView:1.2.4'
    compile 'com.android.support:multidex:1.0.0'
    compile 'com.splitwise:tokenautocomplete:1.3.3'
    compile 'com.tubb.smrv:swipemenu-recyclerview:5.2.1'
    compile 'com.github.bumptech.glide:glide:3.5.2'
    compile 'se.emilsjolander:stickylistheaders:2.7.0'
    compile 'com.mindorks:placeholderview:0.6.4'
    compile 'org.twitter4j:twitter4j-core:4.0.2'
    compile 'jp.wasabeef:fresco-processors:2.1.0'
    compile 'jp.co.cyberagent.android.gpuimage:gpuimage-library:1.3.0'
    compile 'com.google.firebase:firebase-messaging:10.2.1'
    compile 'com.android.billingclient:billing:1.0'

    testCompile 'junit:junit:4.12'
    compile project(':cometchat_platinum-sdk')

}

apply plugin: 'com.google.gms.google-services'

我没有使用过v-27,那么为什么我面临着v7的问题,提前感谢

ogq8wdun

ogq8wdun1#

在应用程序级生成文件中添加allprojects块
1.

allprojects {
    repositories {
        jcenter()
        maven {
            url 'https://maven.google.com'
        }}}

2.使用Android Studio 3.0及更高版本创建的新项目还包括

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

然后将compileSdkVersion更改为26,同时将buildToolsVersion更改为“26.0.1”,然后同步项目
希望这对你有帮助。

li9yvcax

li9yvcax2#

试试这个,我有同样的问题,我解决了使用以下dependencies的Facebook

用这个

compile 'com.facebook.android:facebook-android-sdk:4.26.0'

"而不是这个"

compile 'com.facebook.android:facebook-android-sdk:[4,5)'
dldeef67

dldeef673#

有些依赖关系要求整个模块层次结构都包含存储库。
使用KotlinDSL

build.gradle.kts(项目)

allprojects {
    repositories {
        // ...
        
        maven(url = "<YOUR-URL>")
    }
}

使用Groovy

build.gradle(项目)

allprojects {
    repositories {
        // ...
        
        maven {
            url '<YOUR-URL>'
        }
    }
}

GL语言

arknldoa

arknldoa4#

在我的情况下,我使用的是旧插件,所以需要添加

jcenter()

之后

mavenCentral()

相关问题