-
Notifications
You must be signed in to change notification settings - Fork 26.9k
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
Dart plugin registration doesn't work when app is built with obfuscation #99477
Comments
/cc @stuartmorgan A bit of early debug suggests that when obfuscation is enabled, PathProviderWindows isn't registered at all and instead the default MethodChannelPathProvider instance is used, which is why the calls go nowhere. After disabling obfuscation this goes away and PathProviderWindows.registerWith() is called. |
Hi @tgucio, thanks for filing the issue, I was able to reproduce the issue flutter doctor -v (windows)
|
@gaaclarke It sounds like the new lookup system not robust against obfuscation, which would be a significant regression. |
It's probably this code:
combined with dart-lang/sdk#44215 @alexmarkov Is there a workaround we can use to call an entry point when obsfuscation is enabled? |
We're already iterating through all the libraries to find the right one... what if we just tried calling (Presumably that's slower; we could try to find it by name first, then fall back to trying everything.) |
One problem with that is we could face naming collisions with I'll wait to hear back about dart-lang/sdk#44215 from @alexmarkov since that's the ideal solution considering it has come up a few times already. |
Unfortunately I'm not aware of any workarounds. We should just fix the obfuscation (dart-lang/sdk#44215). |
@alexmarkov How quickly could we get that done? This is a non-trivial regression, so we need a solution in the short term. |
@mraleph might know better as he implemented the obfuscation. |
The fix should be fairly straightforward, can be done in pure Dart. See |
I asked @jensjoha to look at this on the Dart side. |
flutter/flutter#99477 #44215 TEST=Test was added. Change-Id: I585da436f9692d7f2e08db7f74c1a71ad09a1cb1 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/236220 Reviewed-by: Slava Egorov <vegorov@google.com> Reviewed-by: Alexander Markov <alexmarkov@google.com> Commit-Queue: Jens Johansen <jensj@google.com>
It looks like a fix has landed on the Dart side, and I believe it's rolled all the way through Flutter at this point. Is this still reproducible on latest master? |
Verified by running a binary built with Thanks a lot! |
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 |
When building without obfuscation, this works.
This has started failing recently. Same issue seen on Windows, Linux and possibly other platforms.
Steps to Reproduce (Windows)
flutter build windows --obfuscate --split-debug-info=build\app\symbols\windows
on the code sampleExpected results: Call to
getApplicationDocumentsDirectory()
completes and docs path is updatedActual results: Call never completes
pubspec.yaml
main.dart
Logs
The text was updated successfully, but these errors were encountered: