question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

backButton listener not working when minifyEnabled is set to true

See original GitHub issue

Bug Report

Plugin(s)

@capacitor/app

Capacitor Version

Latest Dependencies:

  @capacitor/cli: 3.5.1
  @capacitor/core: 3.5.1
  @capacitor/android: 3.5.1
  @capacitor/ios: 3.5.1

Installed Dependencies:

  @capacitor/ios: not installed
  @capacitor/cli: 3.5.1
  @capacitor/core: 3.5.1
  @capacitor/android: 3.5.1

[success] Android looking great! 👌

Platform(s)

Android

Current Behavior

backButton handling listener is not working in release build if minifyEnabled is set to true in build.gradle inside app folder

Expected Behavior

backButton listener should function normally in release build even if minifyEnabled is set to true

Code Reproduction

https://github.com/Nikhil1920/back-button-bug-reproduction

Other Technical Details

Bug only occurs when building release android app bundle it does not occur when building APK

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
jcesarmobilecommented, May 10, 2022

It’s still not working as you explain, but if I set minifyEnabled true it no longer alerts, so it’s true that it’s broken Looks like the proguard rules we are using in @capacitor/android package are not being published on npm.

as workaround you can put them in your own progruard file

https://github.com/ionic-team/capacitor/blob/main/android/capacitor/proguard-rules.pro

0reactions
ionitron-bot[bot]commented, Nov 10, 2022

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Capacitor, please create a new issue and ensure the template is fully filled out.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Android studio 1.1.0 setting minifyEnabled true causing issues ...
Now when minifiyEnabled is false, the entire code works just fine but I set minifyEnabled true, the network call doesn't happen. My app...
Read more >
How to Handle Back Button in Android - YouTube
How to Handle Back Button on AndroidIn this video, we are going to learn How to Handle Back Button on Android.
Read more >
Make better choices while coding - Android Tips & Tricks
(app's build.gradle should have minifyEnabled true set for this to work). # Remove all debug logs -assumenosideeffects class android.util.
Read more >
App crashes when navigating to a composable and setting the ...
When I remove the inclusive = true (or when I set it to false ) the app doesn't crash, but then tapping the...
Read more >
Boost Android Development Skills To Produce Quality Apps
called everytime when user comes to this activity @Override protected ... Enable progurad: * Open build.gradle (module) * set "minifyEnabled" flag to true....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found