首页 > 解决方案 > Android错误:无法解决::未指定:受影响的模块:app

问题描述

每当我同步我的 gradle 时,我都会收到错误“无法解决::unspecified:受影响的模块:app”。此错误不是描述性的,因此很难找出造成此错误的确切原因。

应用程序构建.gradle:

plugins {
   id 'com.android.application'
}

android {
   compileSdkVersion 29
   buildToolsVersion "30.0.3"

   defaultConfig {
       applicationId "com.sample.sample"
       minSdkVersion 19
       targetSdkVersion 29
       versionCode 1
       versionName "1.0"
       multiDexEnabled true
       vectorDrawables.useSupportLibrary = true
       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.3.0'
   implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
   //testImplementation 'junit:junit:4.+'
   androidTestImplementation 'androidx.test.ext:junit:1.1.2'
   androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'

   implementation 'com.clevertap.android:clevertap-xiaomi-sdk:1.0.1'
}

项目 build.gradle:

// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
    repositories {
        google()
        mavenCentral()
        maven {
            url "https://maven.google.com"
        }
        maven {
            url "https://jitpack.io"
        }
        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 {
        google()
        mavenCentral()
        maven {
            url "https://maven.google.com"
        }
        maven {
            url "https://jitpack.io"
        }
        jcenter()

    }
}

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

我在装有 macOS 10.15.7 的 MacBook Air 上使用 Android Studio 4.1.3

标签: androidandroid-studio

解决方案


这是因为'com.clevertap.android:clevertap-xiaomi-sdk:1.0.1'这个库没有在他们的 pom 文件中指定正确的依赖关系。您可以在下面的链接中检查相同的内容并向下滚动到依赖项标签,您将看到问题。 在此处输入图像描述

https://search.maven.org/artifact/com.clevertap.android/clevertap-xi​​aomi-sdk/1.0.1/aar

您可以在此 repo https://github.com/CleverTap/clevertap-android-sdk上为clevertap 团队创建一个问题以 获取模块clevertap-xps

希望我对你有任何帮助。

干杯。


推荐阅读