Skip to content

Commit 6ad6641

Browse files
Remove allowoptimization modifier from FlutterPlugin proguard rules (flutter#154715)
Fixes: flutter#154580 Previous PR: flutter#154677 More info: flutter#154580 (comment) The errors described in the original issue [are still occurring](flutter#154580 (comment)) after flutter#154677. Before this change, the repro [broken_demo](https://github.com/rajveermalviya/broken_demo) mentioned in the original issue logs: ```shell-session $ flutter run --release Launching lib/main.dart on sdk gphone64 arm64 in release mode... Running Gradle task 'assembleRelease'... 14.5s � Built build/app/outputs/flutter-apk/app-release.apk (7.4MB) Installing build/app/outputs/flutter-apk/app-release.apk... 739ms Flutter run key commands. h List all available interactive commands. c Clear the screen q Quit (terminate the application on the device). W/FlutterEngineCxnRegstry(13284): Attempted to register plugin (a0.a@53b33b6) but it was already registered with this FlutterEngine (d0.c@8baa8b7). E/flutter (13284): [ERROR:flutter/runtime/dart_vm_initializer.cc(40)] Unhandled Exception: PlatformException(channel-error, Unable to establish connection on channel., null, null) E/flutter (13284): #0 PathProviderApi.getApplicationSupportPath (package:path_provider_android/messages.g.dart:65) E/flutter (13284): <asynchronous suspension> E/flutter (13284): #1 getApplicationSupportDirectory (package:path_provider/path_provider.dart:78) E/flutter (13284): <asynchronous suspension> E/flutter (13284): #2 _BorkenDemoHomePageState.build.<anonymous closure> (package:broken_demo/main.dart:44) E/flutter (13284): <asynchronous suspension> E/flutter (13284): ``` After this change: ```shell-session $ flutter run --release Launching lib/main.dart on sdk gphone64 arm64 in release mode... Running Gradle task 'assembleRelease'... 15.2s � Built build/app/outputs/flutter-apk/app-release.apk (7.4MB) Installing build/app/outputs/flutter-apk/app-release.apk... 857ms Flutter run key commands. h List all available interactive commands. c Clear the screen q Quit (terminate the application on the device). I/flutter (13040): path_provider: Directory: '/data/user/0/com.example.broken_demo/files' ```
1 parent 84757af commit 6ad6641

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/flutter_tools/gradle/flutter_proguard_rules.pro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@
1111
# why this is the case.
1212
# See https://github.com/flutter/flutter/issues/154580.
1313
-if class * implements io.flutter.embedding.engine.plugins.FlutterPlugin
14-
-keep,allowoptimization,allowshrinking,allowobfuscation class <1>
14+
-keep,allowshrinking,allowobfuscation class <1>

0 commit comments

Comments
 (0)