New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reland #39157 #39798
Reland #39157 #39798
Conversation
)" This reverts commit d230234.
1d8588e
to
de2e98b
Compare
The tool generates a .java file that passes the fully qualified name of the plugin's main class to the registry: https://github.com/flutter/engine/blob/0a0f3305b5f086b3a413c5156bce810e1d6f4a32/shell/platform/android/io/flutter/plugin/common/PluginRegistry.java#L34 |
Codecov Report
@@ Coverage Diff @@
## master #39798 +/- ##
==========================================
+ Coverage 56.64% 57.93% +1.29%
==========================================
Files 194 194
Lines 18691 18729 +38
==========================================
+ Hits 10587 10851 +264
+ Misses 8104 7878 -226
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #39798 +/- ##
==========================================
+ Coverage 59.56% 59.89% +0.33%
==========================================
Files 192 192
Lines 18705 18742 +37
==========================================
+ Hits 11141 11226 +85
+ Misses 7564 7516 -48
Continue to review full report at Codecov.
|
@@ -51,6 +51,9 @@ android { | |||
// TODO: Add your own signing config for the release build. | |||
// Signing with the debug keys for now, so `flutter run --release` works. | |||
signingConfig signingConfigs.debug | |||
minifyEnabled true | |||
useProguard true | |||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What would be the difference between adding proguard-android.txt
instead of proguard-android-optimize.txt
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like proguard-android-optimize.txt
turns on optimizations that could cause issues on some versions of Dalvik.
https://android.googlesource.com/platform/sdk/+/master/files/proguard-android-optimize.txt#4
The docs indicate that build times may be affected. I wonder if @chinmaygarde or @cbracken have any of the context here. |
This comment has been minimized.
This comment has been minimized.
So this makes things worse by 153,180 bytes. That seems like a lot. |
Release mode build times being affected is a non-issue so long as they don't become an order of magnitude slower. |
@@ -45,6 +45,9 @@ android { | |||
// TODO: Add your own signing config for the release build. | |||
// Signing with the debug keys for now, so `flutter run --release` works. | |||
signingConfig signingConfigs.debug | |||
minifyEnabled true | |||
useProguard true | |||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' | |||
} | |||
} | |||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there some way we can do this that doesn't involve developers having to edit their build.grade files?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could configure the setting from the Flutter plugin, so developers don't have to set this up. However, we do need to provide a way to edit the proguard rules in the file proguard-rules.pro
, in case a plugin needs special rules.
I broke down the dependencies by size:
@Hixie if you think this is a non-starter, then the next option is separating the embedding into two dependencies such that the full app APK doesn't include |
This comment has been minimized.
This comment has been minimized.
082fcc3
to
7cc418b
Compare
The APK size will increase by just 5.81KB, which makes sense since that is the size of lifecycles according to this table: #39798 (comment) cc @xster |
PTAL |
It was a bit hard to figure out the context since there was a master merge in the middle of the commits but I'm assuming I'm just reviewing bdd27ea...blasten:e38a9a5b3d034862d1448b95f792a619f283c8bc and 7e95146...blasten:reland_maven_deps (done since you merged proguard enable separately) on top of the revert of your previous revert? If so LGTM. wrt size, we discussed offline and 5.8kb seems reasonable since the current APIs straight up don't implement large swaths of plugin functionalities that iOS implements https://github.com/flutter/engine/blob/c58c5939e95f8d0232e60d0db9f00bc510caec99/shell/platform/darwin/ios/framework/Headers/FlutterPlugin.h#L49. So whether we wrote bridging code ourselves or pulled in a dependency, 5.8kb seems like the right ballpark. |
What was the reason for the revert? Can you note what, if any, fixes were added for the re-land? |
@zanderso 👍I just updated the description. |
d3e4d1c
to
e4f8874
Compare
I reverted the commits that enabled proguard since #39986 already enabled Proguard.
The APK size increase (examples/hello_world): 5.81KB