当我将Kotlin从1.2升级到1.3.11时,如何解决“无法解析项目:模块”?

时间:2019-01-03 08:42:55

标签: kotlin android-gradle build.gradle

当我将Kotlin版本从1.2.71升级到1.3.11时,我的项目构建失败。

这是错误:

Unable to resolve dependency for ':app@commonLeadingsigningdebug/compileClasspath': Could not resolve project :modulea.
Open File
Show Details


Unable to resolve dependency for ':app@commonLeadingsigningdebugUnitTest/compileClasspath': Could not resolve project :modulea.
Open File
Show Details


Unable to resolve dependency for ':app@commonCommonsigningdebug/compileClasspath': Could not resolve project :modulea.
Open File
Show Details


Unable to resolve dependency for ':app@commonCommonsigningdebugUnitTest/compileClasspath': Could not resolve project :modulea.
Open File
Show Details


Unable to resolve dependency for ':app@leadingLeadingsigningdebug/compileClasspath': Could not resolve project :modulea.
Open File
Show Details


Unable to resolve dependency for ':app@leadingLeadingsigningdebugUnitTest/compileClasspath': Could not resolve project :modulea.
Open File
Show Details


Unable to resolve dependency for ':app@leadingCommonsigningdebug/compileClasspath': Could not resolve project :modulea.
Open File
Show Details


Unable to resolve dependency for ':app@leadingCommonsigningdebugUnitTest/compileClasspath': Could not resolve project :modulea.
Open File
Show Details

我试图修改build.gradle中的依赖关系,但这不起作用。

这是项目的build.gradle


    // Top-level build file where you can add configuration options common to all sub-projects/modules.

    buildscript {
        ext.kotlin_version = '1.3.11'
        repositories {
            google()
            jcenter()
        }
        dependencies {
            classpath 'com.android.tools.build:gradle:3.3.0-alpha02'
            classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"

            // NOTE: Do not place your application dependencies here; they belong
            // in the individual module build.gradle files
        }
    }

    allprojects {
        repositories {
            google()
            jcenter()
            maven { url "https://jitpack.io" }
        }
    }

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

这是应用程序的build.gradle


    apply plugin: 'com.android.application'

    apply plugin: 'kotlin-android'
    apply plugin: 'kotlin-android-extensions'

    android {
        compileSdkVersion 28
        defaultConfig {
            applicationId "sguotao.top"
            minSdkVersion 15
            targetSdkVersion 28
            versionCode 1
            versionName "1.0"
        }

        signingConfigs {
            def releaseStoreFile = ''
            def releaseStorePassword = ''
            def releaseKeyAlias = ''
            def releaseKeyPassword = ''
            def configFile = rootProject.file("sign/sign.properties")
            if (configFile.exists()) {
                def properties = new Properties()
                properties.load(new FileInputStream(configFile))
                releaseStoreFile = 'key/letvAndroidClientKey'
                releaseStorePassword = properties.getProperty('keystorePassword')
                releaseKeyAlias = properties.getProperty('keyAlias')
                releaseKeyPassword = properties.getProperty('keyPassword')
            }
            if (releaseStorePassword.equals("") || releaseKeyAlias.equals("") || releaseKeyPassword.equals("")) {
                releaseStoreFile = 'key/userdebug.keystore'
                releaseStorePassword = 'android'
                releaseKeyAlias = 'androiddebugkey'
                releaseKeyPassword = 'android'
            }
            releaseConfig {
                storeFile file('key/userdebug.keystore')
                keyAlias 'androiddebugkey'
                keyPassword 'android'
                storePassword 'android'
            }
            leadingConfig {
                storeFile file('key/userdebug.keystore')
                keyAlias 'androiddebugkey'
                keyPassword 'android'
                storePassword 'android'
            }
            debug {
                storeFile file('key/userdebug.keystore')
                keyAlias 'androiddebugkey'
                keyPassword 'android'
                storePassword 'android'
            }
        }

        flavorDimensions 'default'

        productFlavors {
            leading {

            }

            common {

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

            commonsigningdebug{
                signingConfig signingConfigs.releaseConfig
                minifyEnabled false
                matchingFallbacks = ['debug','release']

            }

            leadingsigningdebug{
                signingConfig signingConfigs.releaseConfig
                minifyEnabled false
                matchingFallbacks = ['debug','release']

            }
        }
    }

    dependencies {
        implementation fileTree(include: ['*.jar'], dir: 'libs')
        implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
        implementation project(':modulea')

    }

0 个答案:

没有答案