backButton listener not working when minifyEnabled is set to true
See original GitHub issueBug Report
Plugin(s)
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:
- Created a year ago
- Comments:7 (3 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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
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.