Skip to content

Unable to run Android app on stable 2.10 if it uses a plugin with an android folder but no Android support #97729

@Tom3652

Description

@Tom3652

Steps to Reproduce

The app can't be built on Android if a plugin is only iOS targetting.
It's the case with apple_map_flutter.

I can't run my app under Android with the new release Flutter: 2.10 because the tool expect all plugins to support both Android and iOS or something like this (i have another project that builds find without apple_map_flutter)

  1. Create a new project under flutter: 2.10
  2. Add apple_maps_flutter dependency using flutter pub add apple_maps_flutter
  3. Build your app on Android device on flutter 2.10 stable/master

Expected results:

The app should be built on Android (and on iOS) even if a plugin is missing for one of the platform, as it was done before flutter: 2.10.

Actual results:

Launching lib/main.dart on moto g 8 power in debug mode...
Running Gradle task 'assembleDebug'...
Plugin project :apple_maps_flutter not found. Please update settings.gradle.

FAILURE: Build failed with an exception.

* Where:
Script '/Users/foxtom/Desktop/flutter/packages/flutter_tools/gradle/flutter.gradle' line: 421

* What went wrong:
A problem occurred evaluating root project 'android'.
> A problem occurred configuring project ':app'.
   > Cannot invoke method afterEvaluate() on null object
Logs
[✓] Flutter (Channel stable, 2.10.0, on macOS 12.2 21D49 darwin-x64, locale fr-FR)
    • Flutter version 2.10.0 at /Users/foxtom/Desktop/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 5f105a6ca7 (2 days ago), 2022-02-01 14:15:42 -0800
    • Engine revision 776efd2034
    • Dart version 2.16.0
    • DevTools version 2.9.2

[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
    • Android SDK at /Users/foxtom/Library/Android/sdk
    • Platform android-31, build-tools 31.0.0
    • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.11+0-b60-7590822)
    • All Android licenses accepted.

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

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2021.1)
    • 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.11+0-b60-7590822)

[✓] VS Code (version 1.63.2)
    • VS Code at /Users/foxtom/Desktop/Visual Studio Code.app/Contents
    • Flutter extension version 3.34.0

[✓] Connected device (3 available)
    • moto g 8 power (mobile) • ZY22BNDW2C • android-arm64  • Android 11 (API 30)
    • macOS (desktop)         • macos      • darwin-x64     • macOS 12.2 21D49 darwin-x64
    • Chrome (web)            • chrome     • web-javascript • Google Chrome 98.0.4758.80

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

• No issues found!

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work lista: buildBuilding flutter applications with the toolc: regressionIt was better in the past than it is nowfound in release: 2.10Found to occur in 2.10has reproducible stepsThe issue has been confirmed reproducible and is ready to work onplatform-androidAndroid applications specificallyteam-androidOwned by Android platform teamtoolAffects the "flutter" command-line tool. See also t: labels.triaged-androidTriaged by Android platform team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions