-
-
Notifications
You must be signed in to change notification settings - Fork 145
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
btleplug on Android crashes on release builds #272
Comments
First stop gap: Just turn off all code stripping. This seems to work. In the android/app build.gradle:
In android/app/proguard-rules.pro:
Obviously this isn't ideal, as we'd like to only keep the symbols out of our AAR, but I'm still figuring out the rules for that. |
Slightly simpler catch all that doesn't require a proguard rules file:
|
Ok, this is all about getting the proguard rules correct. Turned out that I was missing some extra symbols for the jni-utils-rs library. For build.gradle: buildTypes {
release {
// TODO: Add your own signing config for the release build.
// Signing with the debug keys for now, so `flutter run --release` works.
signingConfig signingConfigs.debug
shrinkResources true
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
} proguard-rules.pro:
|
Describe the bug
Expected behavior
Application runs
Actual behavior
Application crashes immediately on startup
Additional context
This crash looks very similar to completely forgetting to add the droidplug.aar file and running the debug version. This points to dead code elimination possibly cutting out the aar file entirely, since it's only linked on the other side of native binaries current. We probably need some sort of glue method that does nothing but creates/calls objects in the aar anyways.
The text was updated successfully, but these errors were encountered: