Skip to content

Adding flutter to an existing android app does not work with build variants #36479

@farkerhaiku

Description

@farkerhaiku

Steps to Reproduce

  1. Create a new android app.
  2. Add
    develop { initWith debug }
    to the buildTypes right above release in the build.gradle
  3. follow the directions on the wiki
  4. Trying to sync gradle after updating the build.gradle file results in an error. https://github.com/flutter/flutter/wiki/Add-Flutter-to-existing-apps/f695ef6d807668486ee85b67be99a48a6275d15e#use-the-flutter-module-from-your-java-code

Logs

ERROR: Unable to resolve dependency for ':app@develop/compileClasspath': Could not resolve project :flutter.
Show Details
Affected Modules: app

ERROR: Unable to resolve dependency for ':app@developUnitTest/compileClasspath': Could not resolve project :flutter.
Show Details
Affected Modules: app

[✓] Flutter (Channel master, v1.8.2-pre.67, on Mac OS X 10.13.6 17G7024, locale en-US)
• Flutter version 1.8.2-pre.67 at /Users/jason/Applications/flutter
• Framework revision 598ecb3 (26 hours ago), 2019-07-17 10:08:51 -0700
• Engine revision eb248c2
• Dart version 2.5.0 (build 2.5.0-dev.1.0 24725a8559)

[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
• Android SDK at /Users/jason/Library/Android/sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-28, build-tools 28.0.3
• ANDROID_HOME = /Users/jason/Library/Android/sdk
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1343-b01)
• All Android licenses accepted.

[!] Xcode - develop for iOS and macOS (Xcode 9.4.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 9.4.1, Build version 9F2000
! CocoaPods out of date (1.6.0 is recommended).
CocoaPods is used to retrieve the iOS and macOS platform side's plugin code that responds to your plugin usage on the Dart side.
Without CocoaPods, plugins will not work on iOS or macOS.
For more info, see https://flutter.dev/platform-plugins
To upgrade:
sudo gem install cocoapods
pod setup

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

[✓] Android Studio (version 3.4)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 37.0.1
• Dart plugin version 183.6270
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1343-b01)

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

[✓] Connected device (3 available)
• Android SDK built for x86 • emulator-5554 • android-x86 • Android 8.1.0 (API 27) (emulator)
• macOS • macOS • darwin-x64 • Mac OS X 10.13.6 17G7024
• Chrome • chrome • web-javascript • Google Chrome 75.0.3770.142

Metadata

Metadata

Assignees

No one assigned

    Labels

    a: existing-appsIntegration with existing apps via the add-to-app flowt: gradle"flutter build" and "flutter run" on AndroidtoolAffects the "flutter" command-line tool. See also t: labels.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions