XCosmo
XCosmo

Reputation: 31

Unable to resolve dependency for ':app@betaDebug/compileClasspath': Could not resolve project :libraries:humla

I'm using a F-Droid open source project called "mumla-3.6.3". While importing this project in android studio Electric Eel 2022.1.1, I'm getting sync build successful with this warning:

Unable to resolve dependency for ':app@betaDebugUnitTest/compileClasspath': Could not resolve project :libraries:humla.

But then when I try to make Project, I'm getting error as:

Could not determine the dependencies of task ':app:compileBetaDebugJavaWithJavac'.
> Could not resolve all task dependencies for configuration ':app:betaDebugCompileClasspath'.
   > Could not resolve project :libraries:humla.
     Required by:
         project :app
      > No matching configuration of project :libraries:humla was found. The consumer was configured to find an API of a component, preferably optimized for Android, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'debug', attribute 'release' with value 'beta' but:
          - None of the consumable configurations have attributes.

My app build.gradle file content is:

/*
 * Copyright (C) 2014 Andrew Comminos
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

buildscript {
    repositories {
        mavenCentral()
        google()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:7.0.4'
    }
}
apply plugin: 'com.android.application'

repositories {
    mavenCentral()
    google()
}

def gitDescribe = { ->
    def stdout = new ByteArrayOutputStream()
    exec {
        commandLine "cmd", "git", "describe", "--tags", "--always"
        standardOutput = stdout
    }
    return stdout.toString().trim()
}

def signingFile = file 'signing.gradle'
if (signingFile.exists()) apply from: signingFile
def signingBetaFile = file 'signing-beta.gradle'
if (signingBetaFile.exists()) apply from: signingBetaFile

allprojects {
    tasks.withType(JavaCompile) {
        // TODO include deprecations at some point, but currently they are *many*
        options.compilerArgs << "-Xlint:all" << "-Xlint:-deprecation" << "-Xlint:-dep-ann"
    }
}

android {
    compileSdkVersion 31

    defaultConfig {
        minSdkVersion 14
        targetSdkVersion 31
        multiDexEnabled true

        applicationId "se.lublin.mumla"
        versionCode 98
        versionName gitDescribe()

        setProperty("archivesBaseName", "mumla")
        buildConfigField "long", "TIMESTAMP", System.currentTimeMillis() + "L"

        testInstrumentationRunner "android.test.InstrumentationTestRunner"
    }

    flavorDimensions "release"
    productFlavors {
        official {
            dimension "release"
            applicationId "se.lublin.mumla"
        }
        donation {
            dimension "release"
            applicationId "se.lublin.mumla.donation"
        }
        beta {
            dimension "release"
            applicationId "se.lublin.mumla.beta"
        }
    }

    buildTypes {
        // signingConfig beta will override
        release {
            if (android.hasProperty("signingConfigs")) {
                if (signingConfigs.hasProperty("release")) {
                    signingConfig signingConfigs.release
                }
                if (signingConfigs.hasProperty("beta")) {
                    signingConfig signingConfigs.beta
                }
            }
        }
        debug {
            versionNameSuffix "-debug"
            if (android.hasProperty("signingConfigs")) {
                if (signingConfigs.hasProperty("beta")) {
                    signingConfig signingConfigs.beta
                }
            }
        }
    }

    // betas may be released every minute
    // TODO? dynamic stuff, have to rebuild a lot
    applicationVariants.all { variant ->
        if (variant.flavorName == "beta") {
            variant.outputs.each { output ->
                output.versionCodeOverride = System.currentTimeSeconds() / 60
            }
        }
    }

    lintOptions {
        quiet false

        // spongycastle-related
        disable "InvalidPackage"

        disable "MissingTranslation"

        ignoreWarnings false
        abortOnError true
        explainIssues true
    }
}

dependencies {
    implementation 'androidx.multidex:multidex:2.0.1'
    /*implementation project(":libraries:humla") {
        targetConfiguration = "runtime"
    }*/
    implementation project(":libraries:humla")
    implementation 'androidx.appcompat:appcompat:1.6.1'
    implementation 'androidx.cardview:cardview:1.0.0'
    implementation 'androidx.documentfile:documentfile:1.0.1'
    implementation 'androidx.fragment:fragment:1.5.6'
    implementation 'androidx.recyclerview:recyclerview:1.3.0'
    implementation 'androidx.exifinterface:exifinterface:1.3.6'
    implementation 'org.jsoup:jsoup:1.13.1'
    implementation 'info.guardianproject.netcipher:netcipher:2.1.0'
}

My project settings.gradle file content is:

/*
 * Copyright (C) 2014 Andrew Comminos
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */


include ':libraries:humla', ':app'

My project build.gradle file has NO content in it as:

/*
 * Copyright (C) 2014 Andrew Comminos
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */


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

Upvotes: 0

Views: 101

Answers (0)

Related Questions