You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+8-22Lines changed: 8 additions & 22 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -113,38 +113,24 @@ setup.
113
113
114
114
There is now a build script at `./scripts/build-java.sh` for building the java portion of the library on linux or macOS. This can also be used as a guide for manual building if need be.
115
115
116
-
Proguard optimization can be an issue when using btleplug, as the .aar file generated by the java
117
-
code in btleplug is only accessed by native code, and can be optimized out as part of dead code
118
-
removal and resource shrinking. To fix this, changes will need to be made to your build.gradle file, and proguard rules will need to be defined.
116
+
If your app uses Proguard/R8 with `minifyEnabled true`, you must add keep rules for btleplug's
117
+
Java classes. All of btleplug's Java code (including vendored jni-utils classes) is only accessed
118
+
via JNI from native code, so R8 will treat it as dead code and strip it without these rules.
119
119
120
-
For build.gradle:
120
+
In your `build.gradle`, ensure Proguard is configured for release builds:
121
121
```groovy
122
122
buildTypes {
123
123
release {
124
-
// TODO: Add your own signing config for the release build.
125
-
// Signing with the debug keys for now, so `flutter run --release` works.
0 commit comments