flutter_inappwebview icon indicating copy to clipboard operation
flutter_inappwebview copied to clipboard

Update proguard-rules.pro

Open Neelansh-ns opened this issue 1 year ago • 5 comments

Connection with issue(s)

Resolve issue:

ERROR: Missing classes detected while running R8. Please add the missing classes or apply additional keep rules that are generated in /Users/manishpatel/Documents/gen3/iv-pro-mobile/build/flutter_inappwebview_android/outputs/mapping/release/missing_rules.txt.
ERROR: R8: Missing class android.window.BackEvent (referenced from: void io.flutter.embedding.android.FlutterActivity.startBackGesture(android.window.BackEvent) and 3 other contexts)

Connected to:

The latest master channel in flutter gives the above error.

Testing and Review Notes

Screenshots or Videos

To Do

  • [ ] double check the original issue to confirm it is fully satisfied
  • [ ] add testing notes and screenshots in PR description to help guide reviewers
  • [ ] request the "UX" team perform a design review (if/when applicable)

Neelansh-ns avatar Apr 11 '24 06:04 Neelansh-ns

Hello, I was wondering if this could get merged in shortly, this is holding up using the newest Android Gradle

chillbrodev avatar May 17 '24 01:05 chillbrodev

Hello, I was wondering if this could get merged in shortly, this is holding up using the newest Android Gradle

It would be really great if it can be done asap. As it is a blocking issue.

teklund avatar Jun 07 '24 11:06 teklund

Workaround pubspec.yaml

dependency_overrides:
  # TODO: Check once flutter_inappwebview version >6.0.0 is released
  flutter_inappwebview_android:
    git:
      url: [email protected]:YOUR_FORK_WITH_FIX/flutter_inappwebview.git
      path: flutter_inappwebview_android
      ref: YOUR_LAST_COMMIT_ID

Kaskyi avatar Jun 07 '24 12:06 Kaskyi

@pichillilorenzo Could we get this merged in and released?

chillbrodev avatar Jul 11 '24 18:07 chillbrodev

As a workaround, you can add Proguard rules to ignore or exclude what is causing the warning from minimization.

Run:

./gradlew build

Go to the warnings section, and ignore the warning:

-dontwarn android.window.BackEvent

You will need to include it in proguard.pro or proguard-rules.pro (depending on Gradle configuration)

Of the app project itself instead.

See Proguard Manual Usage and Proguard Manual Home for more details.

[!NOTE] This suggestion provides a hint to fix the issue, I haven't seen the full output or what causes the issue, though I'm pretty sure it's possible to fix it without changes from the plugin itself.

Also noticed the rules fully exclude the plugin from minimization. It might be because all methods and classes are all required, though still it's possible to minimize the bundle size further.

EchoEllet avatar Jul 11 '24 20:07 EchoEllet

https://github.com/pichillilorenzo/flutter_inappwebview/pull/2231

pichillilorenzo avatar Sep 23 '24 13:09 pichillilorenzo