Skip to content

Publish Flutter engine in online maven repo #11439

Closed

Description

@JFixby

Hello,

Can you please publish an official Flutter API stub artifact on a maven repo?

Here is an example of Android API stub: https://mvnrepository.com/artifact/com.google.android/android/4.1.1.4
That helps to compile your java libraries against the Android API.

Would be nice to have similar for Flutter.
Here is a working example of such artifact: https://github.com/Scarabei/Flutter

This is not functional and only provides stubbed implementations of the Flutter API.
All methods in all classes throw a runtime exception. Because an Android app runs
on a device, it will never use these libraries for execution, but the API compatibility
allows an app to be compiled as if it was the real library.

Activity

  1. eseidelGoogle commented on Jul 28, 2017

    @eseidelGoogle
    Contributor

    This is probably an @mravn-google or @jason-simmons question. :)

  2. sethladd commented on Jul 28, 2017

    @sethladd
    Contributor
  3. Hixie commented on Aug 1, 2017

    @Hixie
    Contributor

    Can you elaborate on why you want this?

  4. added this to the milestone on Aug 1, 2017
  5. added
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    and removed on Aug 1, 2017
  6. JFixby commented on Aug 1, 2017

    @JFixby
    Author

    Usage scenario assuming Flutter API stub is published on a repo:

    1. API user writes a library that imports Flutter API as a dependency. It is one line in a build.gradle file:
    dependencies {
        compile "com.google:flutter-api:2017-07-24-5278588d80"
    }
    
    1. The library compiles its Java-classes against the API and goes to a repo.

    Here is an example of such class: android implementation of a Flutter plugin

    The class depends on the io.flutter.plugin.common.*

    package com.jfixby.scarabei.red.flutter.example;
    
    import com.jfixby.scarabei.android.api.Android;
    import com.jfixby.scarabei.api.log.L;
    
    import io.flutter.plugin.common.MethodCall;
    import io.flutter.plugin.common.MethodChannel.MethodCallHandler;
    import io.flutter.plugin.common.MethodChannel.Result;
    
    public class ExamplePlugin implements MethodCallHandler {
    
    	@Override
    	public void onMethodCall (final MethodCall call, final Result result) {
    		L.d("ExamplePlugin.onMethodCall", call.method);
    		if (call.method.equals("getPlatformVersion")) {
    			final String message = "Android " + android.os.Build.VERSION.RELEASE + " " + Android.getSystemInfo();
    			result.success(message);
    		} else {
    			result.notImplemented();
    		}
    	}
    }
    1. Library user imports the ExamplePlugin into his Android project using gradle and binds it to implement Android part of a Flutter plugin: example activity
  7. JFixby commented on Aug 2, 2017

    @JFixby
    Author

    no need all the android framework settings i.e. project files, resources, gradle build settings and the manifest.
    android framework is no needed too and the library is published to be available via gradle and to be reused in different android apps
    otherwise each flutter plugin contains a full android project and requires a lot of attention to it's config files.

  8. JFixby commented on Aug 8, 2017

    @JFixby
    Author

    There are basically two options for including external libraries in your Android application. The first is to manually copy the jars into the libs directory within your project and update the classpath. The disadvantage is that you have to manage the dependencies manually. Alternatively, a third party plugin such as the Maven Android Plugin can be utilized to automatically include the dependencies from a Maven repository.

    In order to build an android application on the command line (and therefore in continuous integration environments..) the standard way is to use build systems. One of the most common systems with many additional benefits beyond ant is Apache Maven. Gradle understand this repository format and can retrieve artifacts from it.

    Currently users that want to build their Android project with Gradle need to publish the flutter.jar artifact into their private repository server or at minimum into their private local repository.

    On top with the current approach you have to manage the build.gradle file for each(!) plugin keeping it's settings aligned with compileSdkVersion, buildToolsVersion, minSdkVersion, targetSdkVersion, multiDexEnabled, dexOptions.javaMaxHeapSize and so on.

  9. removed
    t: gradle"flutter build" and "flutter run" on Android
    on Aug 18, 2017
  10. removed
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on May 24, 2018
  11. changed the title [-]Official Flutter API stub artifact[/-] [+]Official Flutter API stub artifact on maven[/+] on May 24, 2018
  12. 8 remaining items

  13. changed the title [-]Official Flutter API stub artifact on maven[/-] [+]Publish Flutter engine in online maven repo[/+] on Aug 1, 2019
  14. jmagman commented on Aug 9, 2019

    @jmagman
    Member
  15. JFixby commented on Aug 10, 2019

    @JFixby
    Author
  16. neiljaywarner commented on Aug 10, 2019

    @neiljaywarner

    Jfixby
    Sorry I did not acknowledge you fulfilling my request. I appreciate it.

    Perhaps flutter's approach produces some of its success and some of its weaknesses..

  17. blasten commented on Aug 10, 2019

    @blasten

    @JFixby we have started generating Maven artifacts. We will be updating the docs by the end of this month, so you can set the dependency on the embedding directly from Gradle.

  18. neiljaywarner commented on Aug 10, 2019

    @neiljaywarner

    When it is something really solid that works on iOS and Android both really well please make a huge deal about it in the conferences and YouTube channel and Twitter feed and all of that... It should be able to get to a point where an ordinary iOS or Android app could use it without caring or even really knowing what it was written in right?

  19. self-assigned this
    on Aug 19, 2019
  20. modified the milestones: , September 2019 on Aug 19, 2019
  21. dnfield commented on Aug 19, 2019

    @dnfield
  22. added
    t: gradle"flutter build" and "flutter run" on Android
    on Aug 19, 2019
  23. blasten commented on Oct 1, 2019

    @blasten

    This is already implemented. http://download.flutter.io/ is the repository.

  24. github-actions commented on Aug 27, 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.

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

Metadata

Metadata

Assignees

Labels

a: existing-appsIntegration with existing apps via the add-to-app flowc: new featureNothing broken; request for a new capabilityengineflutter/engine related. See also e: labels.platform-androidAndroid applications specificallyt: gradle"flutter build" and "flutter run" on Android

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions