mopro
mopro copied to clipboard
Flutter: Update Android Config for Release Build
Background
Previously, our Android release builds were incompatible with code shrinking and obfuscation due to UniFFI's dependency on JNA. This resulted in runtime crashes:
E/AndroidRuntime(17363): java.lang.UnsatisfiedLinkError: Can't obtain peer field ID for class com.sun.jna.Pointer
- See related issue: https://github.com/privacy-ethereum/zkID/issues/40
Solution
With the migration to Flutter Rust Bridge (FRB) in #583, we've removed the UniFFI/JNA dependency. This enables us to re-enable Android build optimizations that were previously disabled as a workaround.
Tasks
- [ ] Enable code shrinking and obfuscation in
android/app/build.gradle- Update minifyEnabled and shrinkResources flags
- Configure ProGuard/R8 rules if needed
- [ ] Update documentation at https://zkmopro.org/docs/setup/flutter-setup#%EF%B8%8F-error-when-running-flutter-run---release
- Remove workaround instructions for the UniFFI/JNA issue
- Add guidance for the new FRB-based configuration
References
- Flutter Rust Bridge: https://github.com/fzyzcjy/flutter_rust_bridge
- Migration PR: #583