【问题标题】:Android error: Failed to resolve: :unspecified: Affected Modules: appAndroid错误:无法解决::未指定:受影响的模块:app
【发布时间】:2021-04-23 16:57:38
【问题描述】:

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

应用构建.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

【问题讨论】:

  • 我有一种预感,请您尝试在没有com.clevertap.android:clevertap-xiaomi-sdk:1.0.1 依赖的情况下构建并告诉我是否可行
  • 是的,它可以在没有依赖的情况下工作

标签: android android-studio


【解决方案1】:

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

https://search.maven.org/artifact/com.clevertap.android/clevertap-xiaomi-sdk/1.0.1/aar

您可以在此 repo 上与clevertap 团队创建问题 https://github.com/CleverTap/clevertap-android-sdk 对于模块clevertap-xps

希望我对你有所帮助。

干杯。

【讨论】:

  • 谢谢!我将就此与 CleverTap 团队核实。没有上述 SDK 或此 SDK 的较低版本,构建成功。
猜你喜欢
  • 2020-09-30
  • 1970-01-01
  • 2020-01-31
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2021-10-26
  • 1970-01-01
相关资源
最近更新 更多