Skip to content

Having to flutter build apk to get gradle dependencies is problematic #628

Closed

Description

@HosseinYousefi

After updating the version of package:jni, some of the previously written generated code naturally became incorrect. Regenerating the code using JNIgen prompts you to run flutter build apk but flutter build apk needs all Dart code to be valid to succeed.

One could technically first build the apk and only then update the package:jni version but in general it's annoying to be fully building an app just to get the gradle dependencies.

Instead we can use an isolated command that only fetches the dependencies and mention that in our documentation intead of flutter build apk.

cc/ @mahesh-hegde

Activity

  1. mahesh-hegde commented on Jun 1, 2023

    @mahesh-hegde
    Contributor

    The problem is that, to do all this we need some knowledge of gradle which takes a week of study.

    Further complicating matters AGP (android gradle plugin) is a different kind of beast than standard java gradle project.

    In case of maven, it was 1 command, haha.

    I won't be getting sufficient time to focus on coding anytime soon. You might want to check with someone at Google who already knows AGP pretty well.

  2. HosseinYousefi commented on Jun 1, 2023

    @HosseinYousefi
    ContributorAuthor

    No worries, was just letting you know because you worked on the gradle stuff.

    It's not a pressing issue, but still useful to solve. Will ask around!

  3. mahesh-hegde commented on Jun 28, 2023

    @mahesh-hegde
    Contributor

    Gradle plugins will usually require you to add a line like this in build.gradle

    apply "myplugin"
    

    If that's fine, we can probably implement a plugin, which is more reliable than editing build scripts in place..

  4. moved this from Backlog to Todo in JNIgen trackeron May 22, 2024
  5. moved this from Todo to In Progress in JNIgen trackeron Jul 24, 2024
  6. removed this from the JNI / JNIgen 0.12.0 milestone on Oct 1, 2024
  7. moved this from In Progress to Backlog in JNIgen trackeron Oct 1, 2024
  8. added
    contributions-welcomeContributions welcome to help resolve this (the resolution is expected to be clear from the issue)
    on Feb 3, 2026
  9. liamappelbe commented on Feb 3, 2026

    @liamappelbe
    Contributor

    Eliminating the need to run flutter build apk would be a huge usability improvement. But it sounds like it will require a level of gradle expertise I don't have. If any external contributors know enough about gradle to be able to fetch the deps without a full build, please chime in.

  10. liamappelbe commented on Feb 10, 2026

    @liamappelbe
    Contributor
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

    Flappy-BirdBlocking or strongly desired issue for pigeoncontributions-welcomeContributions welcome to help resolve this (the resolution is expected to be clear from the issue)package:jnipackage:jnigen

    Type

    No type

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions