Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding some plugins to a Flutter module causes the whole app to fail to build #21473

Open
efortuna opened this issue Sep 6, 2018 · 7 comments
Labels
a: plugins Support for writing, building, and running plugin packages P2 Important issues not at the top of the work list t: gradle "flutter build" and "flutter run" on Android team-tool Owned by Flutter Tool team tool Affects the "flutter" command-line tool. See also t: labels. triaged-tool Triaged by Flutter Tool team

Comments

@efortuna
Copy link
Contributor

efortuna commented Sep 6, 2018

Steps to Reproduce

  1. Check out https://github.com/mjohnsullivan/dof
  2. Build with Android Studio, see that everything runs as expected.
  3. Edit flutter_dof/pubspec.yaml to add fluwx: ^0.1.3 in the dependencies section.
  4. run flutter packages get while standing in the flutter_dof directory.
  5. Attempt to run the Android program in Android Studio. Cry. (Kidding. Actually you'll see Error:Failed to notify project evaluation listener.)

Now, technically to use this plugin I need to make some changes to the build.gradle files and such. You can see those changes here and here,
but that shouldn't matter. I think adding a dependency, regardless of whether it's used or not shouldn't prevent me from building the app.

I suspect other plugins may cause this behavior, but I haven't tested others yet.

[✓] Flutter (Channel master, v0.7.6-pre.56, on Linux, locale en_US.UTF-8)
    • Flutter version 0.7.6-pre.56 at /usr/local/google/home/efortuna/googleio/flutter
    • Framework revision 409baff3ac (4 hours ago), 2018-09-05 21:31:29 +0100
    • Engine revision de4c7a53f2
    • Dart version 2.1.0-dev.3.0.flutter-760a9690c2

[✓] Android toolchain - develop for Android devices (Android SDK 27.0.3)
    • Android SDK at /usr/local/google/home/efortuna/Android/Sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-28, build-tools 27.0.3
    • Java binary at: /opt/android-studio-3.0/jre/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-915-b01)
    • All Android licenses accepted.

[✓] Android Studio (version 3.0)
    • Android Studio at /opt/android-studio-3.0
    • Flutter plugin version 23.2.1
    • Dart plugin version 171.4424
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-915-b01)

[✓] IntelliJ IDEA Community Edition (version 2018.1)
    • IntelliJ at /opt/intellij-ce-2018.1
    • Flutter plugin version 27.0.2
    • Dart plugin version 181.4892.1

[✓] IntelliJ IDEA Community Edition (version 2017.3)
    • IntelliJ at /opt/intellij-ce-2017.3
    • Flutter plugin version 26.0.1
    • Dart plugin version 173.4700

[✓] VS Code (version 1.25.1)
    • VS Code at /usr/share/code
    • Flutter extension version 2.18.0

[✓] Connected devices (1 available)
    • Pixel 2 XL • 711KPAE0891080 • android-arm64 • Android 8.1.0 (API 27)

• No issues found!
@zoechi zoechi added tool Affects the "flutter" command-line tool. See also t: labels. p: framework t: gradle "flutter build" and "flutter run" on Android labels Sep 6, 2018
@zoechi zoechi added this to the Goals milestone Sep 6, 2018
@jason-simmons
Copy link
Member

I was able to build this app by changing ext.kotlin_version in android_dof/build.gradle to 1.2.60

The build had been failing due to an exception in the Kotlin Gradle plugin:

Caused by: org.gradle.internal.event.ListenerNotificationException: Failed to notify project evaluation listener.
        at org.gradle.internal.event.AbstractBroadcastDispatch.dispatch(AbstractBroadcastDispatch.java:86)
        ...
Caused by: java.lang.AbstractMethodError
        at org.jetbrains.kotlin.gradle.plugin.KotlinPluginKt.resolveSubpluginArtifacts(KotlinPlugin.kt:776)
        ...

The Fluwx build script specifies Kotlin version 1.2.60. Apparently the app's main script needs to use the same version.

@efortuna
Copy link
Contributor Author

efortuna commented Sep 11, 2018

Is this a tooling issue we can improve to better surface that error when building in Android Studio? cc @devoncarew @stevemessick

@matthew-carroll
Copy link
Contributor

Note after chatting with @jason-simmons: I think it is probably OK to ship with this issue for Add2App since, I think, the Kotlin version would be specified within the existing Android app and therefore the developer could change that just as Jason did here and they'll be OK.

However, this issue could be more problematic for a standard project with a generated host app because the host app can't be edited without converting to a non-generated form. This might still be acceptable for the time being if this situation does not arise very often. However, if this situation is at all commonplace then I think we need to do something to handle generated host apps.

@efortuna
Copy link
Contributor Author

okay, sounds good. Feel free to close then. My side of the issue is solved. (I just didn't see the error, because AS hid it a little better than from the command line)

@matthew-carroll
Copy link
Contributor

I'll leave the issue open until I'm sure the Add2App project structure changes aren't adversely impacted by this.

@ThinkDigitalSoftware
Copy link
Contributor

I was able to build this app by changing ext.kotlin_version in android_dof/build.gradle to 1.2.60
@jason-simmons where is this file located? I have a different project I'm trying to build and I don't see this folder

@ThinkDigitalSoftware
Copy link
Contributor

Oh, it's just the regular YOUR_PROJECT/android/build.gradle file

@zoechi zoechi added the p: tooling Affects the flutter_plugin_tools package label Feb 20, 2019
@jmagman jmagman added this to Awaiting triage in Tools - Gradle review Jan 10, 2020
@jonahwilliams jonahwilliams moved this from Awaiting triage to Engineer reviewed in Tools - Gradle review Mar 18, 2020
@kf6gpe kf6gpe added the P2 Important issues not at the top of the work list label May 29, 2020
@Hixie Hixie removed this from the None. milestone Aug 17, 2020
@stuartmorgan stuartmorgan added a: plugins Support for writing, building, and running plugin packages and removed p: tooling Affects the flutter_plugin_tools package labels Mar 4, 2023
@flutter-triage-bot flutter-triage-bot bot added team-tool Owned by Flutter Tool team triaged-tool Triaged by Flutter Tool team labels Jul 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a: plugins Support for writing, building, and running plugin packages P2 Important issues not at the top of the work list t: gradle "flutter build" and "flutter run" on Android team-tool Owned by Flutter Tool team tool Affects the "flutter" command-line tool. See also t: labels. triaged-tool Triaged by Flutter Tool team
Projects
Tools - Gradle review
  
Engineer reviewed
Add-to-App (stale)
Awaiting triage
Development

No branches or pull requests

8 participants