Skip to content

Add Flutter to Existing App Fails, Flutter Tools Generates Incorrect Files #22090

@rayliverified

Description

@rayliverified

The generated files created by Flutter Tooling do not work.

https://github.com/flutter/flutter/wiki/Add-Flutter-to-existing-apps

View sample project here -> https://github.com/searchy2/FlutterAndroid

Steps to Reproduce

  1. Create new Android project using Kotlin and targeting SDK v28.
  2. Follow the steps at "Add Flutter to existing apps"
  3. Build project. Flutter tooling generates .android files.
  4. Generated files cannot find android packages.
    maxthonsnap20180920115050

I think the issue is the generated Flutter build.gradle doesn't match the packages used by the generated files.

Flutter.java and FlutterFragment.java use android.arch.lifecycle components and the android.support.annotation package.
maxthonsnap20180920115424
The generated build.gradle file does not import the correct packages.
maxthonsnap20180920115206

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions