Skip to content

No matching variant of project :flutter was found #118180

@pastapareo

Description

@pastapareo

Steps to Reproduce

  1. Create an android project
  2. Create build types and product flavors
    build types: release, qa, debug
    flavors: dev, internal
  3. Create/use a flutter module
  4. Integrate the flutter module to the android project
    Add the Flutter module as a dependency using Option B
  5. Run the android project using one build variant (i.e. internalQa)

Expected results: App will run showing a basic screen

Actual results: Build fails with message No matching variant of project :flutter was found.

Sample build.gradle: https://gist.github.com/pastapareo/5e3dc479b4c53925b2d7d4064f6e91f2
Logs
Could not determine the dependencies of task ':app:mergeInternalQaNativeLibs'.
> Could not resolve all task dependencies for configuration ':app:internalQaRuntimeClasspath'.
   > Could not resolve project :flutter.
     Required by:
         project :app
      > No matching variant of project :flutter was found. The consumer was configured to find a runtime of a component, preferably optimized for Android, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'qa', attribute 'com.android.build.api.attributes.ProductFlavor:custom' with value 'internal', attribute 'com.android.build.api.attributes.AgpVersionAttr' with value '7.3.0', attribute 'org.jetbrains.kotlin.platform.type' with value 'androidJvm' but:
          - Variant 'debugApiElements' capability com.example.dmb_flutter:flutter:1.0 declares a component, as well as attribute 'com.android.build.api.attributes.AgpVersionAttr' with value '7.3.0':
              - Incompatible because this component declares an API of a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'debug' and the consumer needed a runtime of a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'qa'
              - Other compatible attributes:
                  - Doesn't say anything about com.android.build.api.attributes.ProductFlavor:custom (required 'internal')
                  - Doesn't say anything about its target Java environment (preferred optimized for Android)
                  - Doesn't say anything about org.jetbrains.kotlin.platform.type (required 'androidJvm')
          - Variant 'debugRuntimeElements' capability com.example.dmb_flutter:flutter:1.0 declares a runtime of a component, as well as attribute 'com.android.build.api.attributes.AgpVersionAttr' with value '7.3.0':
              - Incompatible because this component declares a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'debug' and the consumer needed a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'qa'
              - Other compatible attributes:
                  - Doesn't say anything about com.android.build.api.attributes.ProductFlavor:custom (required 'internal')
                  - Doesn't say anything about its target Java environment (preferred optimized for Android)
                  - Doesn't say anything about org.jetbrains.kotlin.platform.type (required 'androidJvm')
          - Variant 'profileApiElements' capability com.example.dmb_flutter:flutter:1.0 declares a component, as well as attribute 'com.android.build.api.attributes.AgpVersionAttr' with value '7.3.0':
              - Incompatible because this component declares an API of a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'profile' and the consumer needed a runtime of a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'qa'
              - Other compatible attributes:
                  - Doesn't say anything about com.android.build.api.attributes.ProductFlavor:custom (required 'internal')
                  - Doesn't say anything about its target Java environment (preferred optimized for Android)
                  - Doesn't say anything about org.jetbrains.kotlin.platform.type (required 'androidJvm')
          - Variant 'profileRuntimeElements' capability com.example.dmb_flutter:flutter:1.0 declares a runtime of a component, as well as attribute 'com.android.build.api.attributes.AgpVersionAttr' with value '7.3.0':
              - Incompatible because this component declares a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'profile' and the consumer needed a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'qa'
              - Other compatible attributes:
                  - Doesn't say anything about com.android.build.api.attributes.ProductFlavor:custom (required 'internal')
                  - Doesn't say anything about its target Java environment (preferred optimized for Android)
                  - Doesn't say anything about org.jetbrains.kotlin.platform.type (required 'androidJvm')
          - Variant 'releaseApiElements' capability com.example.dmb_flutter:flutter:1.0 declares a component, as well as attribute 'com.android.build.api.attributes.AgpVersionAttr' with value '7.3.0':
              - Incompatible because this component declares an API of a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'release' and the consumer needed a runtime of a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'qa'
              - Other compatible attributes:
                  - Doesn't say anything about com.android.build.api.attributes.ProductFlavor:custom (required 'internal')
                  - Doesn't say anything about its target Java environment (preferred optimized for Android)
                  - Doesn't say anything about org.jetbrains.kotlin.platform.type (required 'androidJvm')
          - Variant 'releaseRuntimeElements' capability com.example.dmb_flutter:flutter:1.0 declares a runtime of a component, as well as attribute 'com.android.build.api.attributes.AgpVersionAttr' with value '7.3.0':
              - Incompatible because this component declares a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'release' and the consumer needed a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'qa'
              - Other compatible attributes:
                  - Doesn't say anything about com.android.build.api.attributes.ProductFlavor:custom (required 'internal')
                  - Doesn't say anything about its target Java environment (preferred optimized for Android)
                  - Doesn't say anything about org.jetbrains.kotlin.platform.type (required 'androidJvm')
Analyzing dmb_android...                                        
No issues found! (ran in 0.8s)
[✓] Flutter (Channel stable, 3.0.5, on macOS 12.5.1 21G83 darwin-arm, locale en-PH)
    • Flutter version 3.0.5 at /Applications/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision f1875d570e (6 months ago), 2022-07-13 11:24:16 -0700
    • Engine revision e85ea0e79c
    • Dart version 2.17.6
    • DevTools version 2.12.2

[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
    • Android SDK at /Users/kurichannn/Library/Android/sdk
    • Platform android-33, build-tools 33.0.0
    • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.13+0-b1751.21-8125866)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 14.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • CocoaPods version 1.11.3

[✗] Chrome - develop for the web (Cannot find Chrome executable at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome)
    ! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.

[✓] Android Studio (version 2021.3)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.13+0-b1751.21-8125866)

[✓] Android Studio (version 2021.2)
    • Android Studio at /Volumes/Echidna/Apps/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.12+0-b1504.28-7817840)

[✓] IntelliJ IDEA Ultimate Edition (version 2022.2)
    • IntelliJ at /Applications/IntelliJ IDEA.app
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart

[✓] IntelliJ IDEA Community Edition (version 2022.1.1)
    • IntelliJ at /Volumes/Echidna/Apps/IntelliJ IDEA CE.app
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart

[✓] VS Code (version 1.74.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.54.0

[✓] VS Code (version 1.63.2)
    • VS Code at /Volumes/Echidna/Apps/Visual Studio Code.app/Contents
    • Flutter extension version 3.54.0

[✓] Connected device (2 available)
    • sdk gphone64 arm64 (mobile) • emulator-5554 • android-arm64 • Android 13 (API 33) (emulator)
    • macOS (desktop)             • macos         • darwin-arm64  • macOS 12.5.1 21G83 darwin-arm

[✓] HTTP Host Availability
    • All required HTTP hosts are available

Metadata

Metadata

Assignees

No one assigned

    Labels

    in triagePresently being triaged by the triage teamwaiting for customer responseThe Flutter team cannot make further progress on this issue until the original reporter responds

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions