实现app模块时,Gradle Sync失败。 ':projectpodosample @ debug / compileClasspath':无法解析项目:app

时间:2018-04-27 01:17:30

标签: android gradle

当我尝试在名为ProjectPodoSample(仅包含新创建的空活动)的模块中实现我的app模块时,我得到了这些错误:

Unable to resolve dependency for ':projectpodosample@debug/compileClasspath': Could not resolve project :app.
Unable to resolve dependency for ':projectpodosample@debugAndroidTest/compileClasspath': Could not resolve project :app.
Unable to resolve dependency for ':projectpodosample@debugUnitTest/compileClasspath': Could not resolve project :app.
Unable to resolve dependency for ':projectpodosample@release/compileClasspath': Could not resolve project :app.
Unable to resolve dependency for ':projectpodosample@releaseUnitTest/compileClasspath': Could not resolve project :app.

我尝试删除模块并重新创建它。我试图清理我的项目并重建它。我尝试在settings.gradle中更新我的Gradle版本。我试图取消选中“离线工作”选项。没有任何效果。这是我的两个gradle.build文件。

在app模块中

gradle.build:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 27
    defaultConfig {
        applicationId "com.visionnaires.projectpodo"
        minSdkVersion 23
        targetSdkVersion 27
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])

    implementation 'com.android.support:appcompat-v7:27.1.1'
    implementation 'com.android.support.constraint:constraint-layout:1.1.0'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.1'
   androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
}

projectpodosample模块中的gradle.build:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 27

    defaultConfig {
        applicationId "com.visionnaires.projectpodosample"
        minSdkVersion 23
        targetSdkVersion 27
        versionCode 1
        versionName "1.0"

        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"

    }

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

}

dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation project(':app')

    implementation 'com.android.support:appcompat-v7:27.1.1'
    implementation 'com.android.support.constraint:constraint-layout:1.1.0'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.1'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
}

我使用64位的Android Studio 3.1.2。

0 个答案:

没有答案