This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Embed ICU data inside libflutter.so on Android#7588
Merged
jason-simmons merged 1 commit intoflutter:masterfrom Jan 30, 2019
Merged
Embed ICU data inside libflutter.so on Android#7588jason-simmons merged 1 commit intoflutter:masterfrom
jason-simmons merged 1 commit intoflutter:masterfrom
Conversation
chinmaygarde
suggested changes
Jan 25, 2019
common/settings.h
Outdated
| bool verbose_logging = false; | ||
| std::string log_tag = "flutter"; | ||
| std::string icu_data_path; | ||
| std::string icu_symbol; |
Contributor
There was a problem hiding this comment.
Can you make this a MappingCallback instead. That way, the embedders can setup the mapping from whatever source they choose.
sky/tools/objcopy.py
Outdated
| subprocess.check_call([ | ||
| args.objcopy, | ||
| '-I', 'binary', | ||
| '-O', 'elf32-littlearm', |
Contributor
There was a problem hiding this comment.
This isn't architecture agnostic. Thinking of release modes for Android aarch64, x64, etc..
cdb4d33 to
b2e191c
Compare
chinmaygarde
approved these changes
Jan 26, 2019
Contributor
|
Just a heads up, I tried compiling the same locally on Mac but ran into the same issue as the buildbots. |
Member
Author
|
The build errors are happening because this needs to be combined with a roll to flutter/buildroot#211 |
b2e191c to
42a1bde
Compare
Prior to this the Android embedder code would extract the icudtl.dat asset out of the APK and write it to local disk during the first startup of the app. This change will make that work unnecessary and eliminate the risk of ICU failures due to errors in the extraction process.
42a1bde to
a5ba655
Compare
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/flutter
that referenced
this pull request
Jan 31, 2019
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/flutter
that referenced
this pull request
Jan 31, 2019
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/flutter
that referenced
this pull request
Jan 31, 2019
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/flutter
that referenced
this pull request
Jan 31, 2019
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/flutter
that referenced
this pull request
Jan 31, 2019
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/flutter
that referenced
this pull request
Jan 31, 2019
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/flutter
that referenced
this pull request
Feb 1, 2019
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/flutter
that referenced
this pull request
Feb 1, 2019
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/flutter
that referenced
this pull request
Feb 1, 2019
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/flutter
that referenced
this pull request
Feb 1, 2019
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/flutter
that referenced
this pull request
Feb 1, 2019
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/flutter
that referenced
this pull request
Feb 1, 2019
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/flutter
that referenced
this pull request
Feb 1, 2019
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/flutter
that referenced
this pull request
Feb 1, 2019
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/flutter
that referenced
this pull request
Feb 2, 2019
This was referenced Feb 2, 2019
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/flutter
that referenced
this pull request
Feb 2, 2019
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/flutter
that referenced
this pull request
Feb 2, 2019
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/flutter
that referenced
this pull request
Feb 2, 2019
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/flutter
that referenced
this pull request
Feb 3, 2019
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/flutter
that referenced
this pull request
Feb 3, 2019
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/flutter
that referenced
this pull request
Feb 4, 2019
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/flutter
that referenced
this pull request
Feb 4, 2019
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The advantage of this is simpler packaging of the APK, less risk at runtime, and faster startup time.
Previously icudtl.dat was packaged as an asset in the flutter_shared directory within the APK zip file. The Gradle script had to ensure that icudtl.dat is placed there exactly once (even if multiple Flutter apps are packaged within the APK).
At runtime, the Android embedder code had to extract icudtl.dat out of the APK and write it to local disk before the engine can start. We've seen situations where something goes wrong with that process and the app crashes because the on disk copy is malformed.
With this change, the ICU data is available through a symbol lookup in the Flutter library and does not need to be copied to local storage.
The APK size should be unchanged if there is only one version of libflutter.so in the APK (the data is just being moved out of the standalone asset and into libflutter.so). However, if an APK is built with multiple versions of libflutter.so for different architectures, then the ICU data will be duplicated in each libflutter.so