Android 3.0.1 Error:Unable to resolve dependency for ':app@debug/compileClasspath': Could not resolve project :app2

Android 3.0.1 Error:Unable to resolve dependency for ':app@debug/compileClasspath': Could not resolve project :app2

我将项目 'forecastie-master-master' 从 GitHub 导入到我自己的项目中。我按照导入项目的步骤操作。请帮我解决这个错误,我是导入项目的新手。

我自己的项目gradle:

apply plugin: 'com.android.application'

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

    }
    productFlavors {
    }
    buildToolsVersion '26.0.2'
}

dependencies {

    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation 'com.android.support:appcompat-v7:26.1.0'
    implementation 'com.android.support:cardview-v7:26.1.0'
    // implementation 'com.android.support:design:26.0.0'
    //implementation 'com.android.support:design:26.0.0'
    //imlementation 'com.android.support:support-v4:26.0.0'
    implementation 'com.android.support:design:26.1.0'
    compile 'com.android.support.constraint:constraint-layout:1.0.2'
    //implementatoin 'com.android.support.constraint:constraint-layout:1.0.2'
    // implementation 'com.google.android.gms.play-servies:11.8.0'
    implementation 'com.lapism:searchview:4.0'
    implementation 'com.google.firebase:firebase-core:11.8.0'
    implementation 'com.google.firebase:firebase-database:11.8.0'
    implementation 'com.google.firebase:firebase-auth:11.8.0'
    implementation 'com.google.android.gms:play-services-maps:11.8.0'
    implementation 'com.google.android.gms:play-services-location:11.8.0'
    implementation 'com.google.android.gms:play-services-places:11.8.0'

    //implementation project (':app2')//{
       // exclude group: 'com.android.support', module:'library'
    //}
    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'
    implementation project(':app2')
}
apply plugin: 'com.google.gms.google-services'



my imported project's gradle:
apply plugin: 'com.android.application'

android {
    compileSdkVersion 26
    defaultConfig {
        applicationId "cz.martykan.forecastie"
        minSdkVersion 21
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }

    lintOptions {
        checkReleaseBuilds true
        abortOnError false
        xmlReport true
        htmlReport true
    }

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

    }
    productFlavors {
    }
    buildToolsVersion '26.0.2'
}


dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'
    implementation 'com.google.android.apps.dashclock:dashclock-api:+'
    implementation 'com.roughike:bottom-bar:1.4.0.1'
    implementation 'com.diogobernardino:williamchart:2.2'
}

settings.gradle:

include ':app2',':app'

错误:

Unable to resolve dependency for ':app@debug/compileClasspath': Could not resolve project :app2. <a href="openFile:C:../build.gradle">Open File</a><br><a href="Unable to resolve dependency for ":app@debug/compileClasspath": Could not resolve project :app2.">

Unable to resolve dependency for ':app@debugAndroidTest/compileClasspath': Could not resolve project :app2. <a href="openFile:C:../build.gradle">Open File</a><br><a href="Unable to resolve dependency for ":app@debug/compileClasspath": Could not resolve project :app2.">

Unable to resolve dependency for ':app@debugUnitTest/compileClasspath': Could not resolve project :app2. <a href="openFile:C:../build.gradle">Open File</a><br><a href="Unable to resolve dependency for ":app@debug/compileClasspath": Could not resolve project :app2.">

Unable to resolve dependency for ':app@release/compileClasspath': Could not resolve project :app2. <a href="openFile:C:../build.gradle">Open File</a><br><a href="Unable to resolve dependency for ":app@debug/compileClasspath": Could not resolve project :app2.">

Unable to resolve dependency for ':app@releaseUnitTest/compileClasspath': Could not resolve project :app2. <a href="openFile:C:../build.gradle">Open File</a><br><a href="Unable to resolve dependency for ":app@debug/compileClasspath": Could not resolve project :app2.">

详情:

Unable to resolve dependency for ':app@debugAndroidTest/compileClasspath': Could not resolve project :app2. Could not resolve project :app2.

需要:项目:app

Unable to find a matching configuration of project :app2: - Configuration 'debugApiElements': - Required com.android.build.api.attributes.BuildTypeAttr 'debug' and found compatible value 'debug'. - Required com.android.build.gradle.internal.dependency.AndroidTypeAttr 'Aar' and found incompatible value 'Apk'. - Found com.android.build.gradle.internal.dependency.VariantAttr 'debug' but wasn't required. - Required org.gradle.api.attributes.Usage 'java-api' and found compatible value 'java-api'. - Configuration 'debugMetadataElements': - Required com.android.build.api.attributes.BuildTypeAttr 'debug' and found compatible value 'debug'. - Required com.android.build.gradle.internal.dependency.AndroidTypeAttr 'Aar' and found incompatible value 'Metadata'. - Found com.android.build.gradle.internal.dependency.VariantAttr 'debug' but wasn't required. - Required org.gradle.api.attributes.Usage 'java-api' but no value provided. - Configuration 'debugRuntimeElements': - Required com.android.build.api.attributes.BuildTypeAttr 'debug' and found compatible value 'debug'. - Required com.android.build.gradle.internal.dependency.AndroidTypeAttr 'Aar' and found incompatible value 'Apk'. - Found com.android.build.gradle.internal.dependency.VariantAttr 'debug' but wasn't required. - Required org.gradle.api.attributes.Usage 'java-api' and found incompatible value 'java-runtime'. - Configuration 'profileApiElements': - Required com.android.build.api.attributes.BuildTypeAttr 'debug' and found incompatible value 'profile'. - Required com.android.build.gradle.internal.dependency.AndroidTypeAttr 'Aar' and found incompatible value 'Apk'. - Found com.android.build.gradle.internal.dependency.VariantAttr 'profile' but wasn't required. - Required org.gradle.api.attributes.Usage 'java-api' and found compatible value 'java-api'. - Configuration 'profileMetadataElements': - Required com.android.build.api.attributes.BuildTypeAttr 'debug' and found incompatible value 'profile'. - Required com.android.build.gradle.internal.dependency.AndroidTypeAttr 'Aar' and found incompatible value 'Metadata'. - Found com.android.build.gradle.internal.dependency.VariantAttr 'profile' but wasn't required. - Required org.gradle.api.attributes.Usage 'java-api' but no value provided. - Configuration 'profileRuntimeElements': - Required com.android.build.api.attributes.BuildTypeAttr 'debug' and found incompatible value 'profile'. - Required com.android.build.gradle.internal.dependency.AndroidTypeAttr 'Aar' and found incompatible value 'Apk'. - Found com.android.build.gradle.internal.dependency.VariantAttr 'profile' but wasn't required. - Required org.gradle.api.attributes.Usage 'java-api' and found incompatible value 'java-runtime'. - Configuration 'releaseApiElements': - Required com.android.build.api.attributes.BuildTypeAttr 'debug' and found incompatible value 'release'. - Required com.android.build.gradle.internal.dependency.AndroidTypeAttr 'Aar' and found incompatible value 'Apk'. - Found com.android.build.gradle.internal.dependency.VariantAttr 'release' but wasn't required. - Required org.gradle.api.attributes.Usage 'java-api' and found compatible value 'java-api'. - Configuration 'releaseMetadataElements': - Required com.android.build.api.attributes.BuildTypeAttr 'debug' and found incompatible value 'release'. - Required com.android.build.gradle.internal.dependency.AndroidTypeAttr 'Aar' and found incompatible value 'Metadata'. - Found com.android.build.gradle.internal.dependency.VariantAttr 'release' but wasn't required. - Required org.gradle.api.attributes.Usage 'java-api' but no value provided. - Configuration 'releaseRuntimeElements': - Required com.android.build.api.attributes.BuildTypeAttr 'debug' and found incompatible value 'release'. - Required com.android.build.gradle.internal.dependency.AndroidTypeAttr 'Aar' and found incompatible value 'Apk'. - Found com.android.build.gradle.internal.dependency.VariantAttr 'release' but wasn't required. - Required org.gradle.api.attributes.Usage 'java-api' and found incompatible value 'java-runtime'.

您不能将 'Apk' 作为模块导入到应用程序中。它必须是 'Aar'.

错误:

Required com.android.build.gradle.internal.dependency.AndroidTypeAttr 'Aar' and found incompatible value 'Apk'

通常意味着您需要将模块的 build.gradle 从

更改为
apply plugin: 'com.android.application'

apply plugin: 'com.android.library'