Skip to content

android/ folder is required for non-android plugins #46304

Closed

Description

@amirh

Applications that include non-android plugin packages (e.g a web-only plugin package) are failing to build for Android.

This regressed in #45379 and is fixed in #46282

Unfortunately there have been a few releases between the regression and the fix (as of writing v1.12.10 .. v1.13.0 all have the bug).

To make plugins work in the bad build range we're including a temporary android/ folder in non-android plugins. Once the fix makes it to a stable release plugins can bump the minimal Flutter constraint and cleanup their no-op android folder.

Keeping this open until the fix makes it to a stable release.

@blasten @hterkelsen @ditman

Activity

  1. mit-mit commented on Dec 8, 2019

    @mit-mit
    Member

    I think this is fine as long as we only do this to plugins where we use the explicit platform tags to specify that the plug-in does not support Android. That way we can remove the folder again later.

  2. cyanglaz commented on May 20, 2020

    @cyanglaz

    can we do the necessary work to close this issue now since the new stable is released?

  3. assigned and unassigned on May 20, 2020
  4. blasten commented on May 20, 2020

    @blasten

    @cg021 it should just be reverting flutter-team-archive/plugins#2403 and flutter-team-archive/plugins#2408, then publishing a patch in each of these plugins.

  5. creativecreatorormaybenot commented on May 23, 2020

    @creativecreatorormaybenot
    Contributor

    The fix does not seem to work for Android AARs 😕 #57846

  6. kw2019ltd commented on Sep 19, 2020

    @kw2019ltd

    flutter create project generate setting.gradle as below

    include ':app'

    def localPropertiesFile = new File(rootProject.projectDir, "local.properties")
    def properties = new Properties()

    assert localPropertiesFile.exists()
    localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) }

    def flutterSdkPath = properties.getProperty("flutter.sdk")
    assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
    apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"

    pls update it with old way like

    def flutterProjectRoot = rootProject.projectDir.parentFile.toPath()

    def plugins = new Properties()
    def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins')
    if (pluginsFile.exists()) {
    pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) }
    }

    plugins.each { name, path ->
    def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile()
    include ":$name"
    project(":$name").projectDir = pluginDirectory
    }

  7. github-actions commented on Aug 12, 2021

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  8. locked as resolved and limited conversation to collaborators on Aug 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    p: firebaseObsolete - Firebase pluginspackageflutter/packages repository. See also p: labels.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions