libapp.so contains compiled application Dart code. On most Android systems,
this library can be loaded by calling dlopen("libapp.so"), which will search
Android's default library directories.
On some Android devices this does not work as expected. As a workaround, this
patch provides a fallback path to libapp.so based on ApplicationInfo.nativeLibraryDir.
Fixes https://github.com/flutter/flutter/issues/35838
* Remove deprecated runBundle APIs
* Remove code related to dynamic patching (including support for multiple
bundle paths)
* Change FlutterRunArugments.bundlePath to be the Android AssetManager path
where the app's assets are located
The engine RunBundleAndSnapshotFromLibrary API expects a bundle path directory
containing the application's assets. If the Android embedding is using
AOT ELF library packaging and does not need to extract assets, then create an
empty directory at the bundle path.
Fixes https://github.com/flutter/flutter/issues/34287
Previously AOT compiled Dart code would be packaged as a group of assets
within the APK. This has been replaced by a single ELF library containing
the same data.
FlutterMain.findAppBundlePath is using the presence of the flutter_assets
directory as a signal that the app is initialized. For consistency,
FlutterMain will run the resource extractor at startup and create
flutter_assets even if no resources need to be extracted.
The ICU data is packaged within libflutter.so, and the engine uses
dlsym(RTLD_DEFAULT) to look up the ICU data symbols in the libraries
loaded by the process.
This approach apparently fails on some Xiaomi devices. If RTLD_DEFAULT
can not find the symbols, then the platform will pass the path to the
libflutter.so library so the engine can use that to resolve the symbols.
Fixes https://github.com/flutter/flutter/issues/28208