x/mobile: proguard strips generated proxy classes from AAR #30251
Milestone
Comments
Change https://golang.org/cl/164798 mentions this issue: |
@halseth please test https://golang.org/cl/164798 as I couldn't figure out how to enable class stripping for our gradle tests. |
Confirming that https://golang.org/cl/164798 fixes my issue! Thanks |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
Build android library using gomobile (commit
a42111704963f4f0d1266674e1e97489aa8dcca0
):where the package
lndmobile
is defined as here: https://github.com/halseth/lnd/tree/mobile-support/mobileThis creates a library
Lndmobile.aar
which I import into an Android Studio project: https://github.com/lightninglabs/lightning-app/blob/expokit-32/mobile/android/app/src/main/java/host/exp/exponent/LndNativeModule.javaWhat did you expect to see?
App builds and runs, both in debug and release modes.
What did you see instead?
App works in debug mode, but in release mode (Build->Generate Signed APK) it crashes with error
Inspecting the generated APKs shows that
lndmobile.Lndmobile$proxyCallback
gets stripped from the release APK. The following patch seems to resolve it, by adding the package name to the proguard rules:Let me know if this is a desired addition, or if there is a better way to resolve this issue.
The text was updated successfully, but these errors were encountered: