ZupIT/beagle

Improve how Beagle Flutter loads yoga in Android

Closed this issue · 1 comments

Use case

yoga_engine is a plugin with support for Android and iOS. In Flutter, plugins are Dart packages with specific configurations for each platform. For iOS, yoga_engine accesses the native Yoga codes through the podspec configured by Flutter. On Android, .so files are available for each available architecture.

The problem with this approach taken on Android is to update the yoga_engine code as Yoga is updated, in addition to the increase the plugin size, as it no longer has only the native code in C++ and has the same artifact compiled for many architectures.

Proposal

There are 3 approaches that could be applied as a solution to this problem:

  1. Use the ExternalProject_Add function with the CMakeLists.txt to download the Yoga code straight from the Facebook's forked repository.
  2. Move the yoga_engine code from the Facebook's forked repository to a separate repository and use the Yoga code as a git submodule so be able to access it locally.
  3. Create a function in gradle that downloads and compiles native code from the Facebook's forked repository at application build time.