mikepenz / AboutLibraries

AboutLibraries automatically collects all dependencies and licenses of any gradle project (Kotlin MultiPlatform), and provides easy to integrate UI components for Android and Compose-jb environments
http://mikepenz.github.io/AboutLibraries/
Apache License 2.0
3.62k stars 419 forks source link

Library definitions cannot be generated due to missing variant #817

Closed gelhan closed 1 year ago

gelhan commented 1 year ago

About this issue

Task :app:generateLibraryDefinitionsStandardQtest Variant (standardQtest) was missing from dependencies, this should never happen Available variants: -- deviceDebug -- deviceRelease -- standardDebug -- standardRelease

Any ideas how to solve this?

Details

Checklist

mikepenz commented 1 year ago

Thank you for the report.

Do you have a sample gradle configuration I could use to try to reproduce this locally? Or reproduce as part of the sample app?

gelhan commented 1 year ago

Sample gradle config:

android {
    compileSdkVersion 33
    defaultConfig {
        applicationId "xxx"
        applicationIdSuffix ".yyy"

        proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        minSdkVersion 26
        targetSdkVersion 33

        int localVersionCode = 1000
        String systemEnvBuildNumber = System.getenv('BUILD_NUMBER')
        versionCode = systemEnvBuildNumber != null ? Integer.parseInt(systemEnvBuildNumber) + 3000 : localVersionCode

        versionName "1.0.0"

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }

    bundle {
        language {
            enableSplit = false
        }
    }

    buildTypes {
        release {
        }
        qtest {
        }
        debug {
        }
    }

    flavorDimensions += "version"

    productFlavors {
        create("standard") {
            dimension = "version"

            buildConfigField("boolean", "XXX", "false")
        }
        create("device") {
            dimension = "version"
            applicationIdSuffix = ".zzz"
            versionName "2.0.0"

            buildConfigField("boolean", "XXX", "true")
        }
    }

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

    kotlinOptions {
        jvmTarget = "1.8"
    }
    packagingOptions {
        resources {
            excludes += ['META-INF/library_release.kotlin_module']
        }
    }

    viewBinding {
        enabled = true
    }
    dataBinding {
        enabled = true
    }
    lint {
        abortOnError false
        disable 'LockedOrientationActivity'
        ignore 'VectorPath', 'Typos'
        warning 'ContentDescription', 'ConvertToWebp', 'GradleDependency', 'IconDipSize', 'IconDuplicates', 'IconMissingDensityFolder', 'Icons', 'MissingTranslation', 'OldTargetApi', 'Overdraw', 'PluralsCandidate', 'PrivateResource', 'RtlSymmetry', 'TypographyDashes', 'TypographyEllipsis', 'UnusedResources', 'UseCompoundDrawables', 'UselessParent', 'NonConstantResourceId'
        warningsAsErrors true
    }
}

aboutLibraries {
    configPath = "config"
    exclusionPatterns = [~"androidx.*", ~"com.google.android.*", ~"org.jetbrains.*"]
    additionalLicenses = [ "apache_2_0" ]
}
mikepenz commented 1 year ago

Thanks for that. It's due to the name you use for this flavour.

The plugin marks it as a test variant and ignores it as such :/ Will fix it as part of the next update.