-
Notifications
You must be signed in to change notification settings - Fork 344
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
Example app crashing in Release scheme #131
Comments
@dawidb-appdate I need a bit more background on this do you use firebase or google play services in the app? Also which version of the library are you using? Can you try it out with version 2.5.1 and 2.6.1 ? |
@remonh87 i was using the latest release 2.6.0 and 2.5.3 - both the same issue (debug build works correctly on the same device) |
@dawidb-appdate it is not a signing problem but I suspect something related to building releases (can be pro guard for example). Can you try it out with the versions I described in my previous comment? (2.5.1 and 2.6.1). Just want to excluded that the protobuf upgrade is related to the problem. |
@remonh87 i just wanted to stressed out that nothing was changed in the code ;) `
So you need to build debug first flutter build apk --debug, but then you get
So you need to build flutter build apk --profile and you'll get error-free release build with flutter build apk --release |
I think there is still a collision with a Firebase plugin and the protobuf upgrade that we did. I had the same issue with firebase remote config and could reproduce it on release builds .I will revert the upgrade and will launch a new version, probably tomorrow. |
@dawidb-appdate fix for this is avaialble in version 2.6.1+1 . |
Hey @dawidb-appdate, how'd you get the log from the phone? I'm having the exact same issue, where it's crashing in release mode only. I'm running the latest version, 2.7.1, and I've gone back to 2.5.1 where it works like a charm. This observation is on my own application instead of the example app. |
@omarkamal since latest update you need to add our library to the the ProGuard exceptions. For some reason the generated protobuf files are stripped when we use the latest one. See our readme how to do this. Let me know if this works for you |
Thanks for your swift response! Will check it out and share my findings here |
I don't have a proguard rules file, I haven't enabled it. Proguard seems to have even disappeared from the flutter official docs deployment page for android. |
By default Android uses shrinking of the code. See for more info https://developer.android.com/studio/build/shrink-code. Check you release config in
The last line is very important if you do not have it I will suggest you add |
Thanks @remonh87, I did that and it worked fine! Cheers, and thanks for your wonderful library. |
Describe the bug
hey, when building android app using standard command 'flutter build apk --release' package is created, but when loaded to actual phone it crashes every time. I was managed to figure out that it's the very first line is crashing 'final _ble = FlutterReactiveBle();', so basically loading/initializing the library.
When running in debug on the same device it works well.
Have you guys had similar problems? What could be causing the problem.
To Reproduce
Steps to reproduce the behavior:
Smartphone / tablet
Additional context
Android studio 4.0.2
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 1.22.1, on Mac OS X 10.15.7 19H2, locale en-PL)
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
[✓] Xcode - develop for iOS and macOS (Xcode 12.0.1)
[✓] Android Studio (version 4.0)
Log from phone:
d.b.z.d: The exception was not handled due to missing onError handler in the subscribe() method call. Further reading: https://github.com/ReactiveX/RxJava/wiki/Error-Handling | java.lang.RuntimeException: Field status_ for c.d.a.a.c not found. Known fields are [private static final c.d.a.a.c c.d.a.a.c.e, private static volatile c.a.a.b1 c.d.a.a.c.f] at d.b.b0.b.a$h.a(Unknown Source:2) at d.b.b0.b.a$h.f(Unknown Source:2) at d.b.b0.d.h.b(Unknown Source:13) at d.b.b0.d.h.e(Unknown Source:25) at d.b.b0.e.e.i0$a.l(Unknown Source:47) at d.b.b0.e.e.i0$a.run(Unknown Source:8) at d.b.x.b.b$b.run(Unknown Source:2) at android.os.Handler.handleCallback(Handler.java:873) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:201) at android.app.ActivityThread.main(ActivityThread.java:6806) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:547) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:873) Caused by: java.lang.RuntimeException: Field status_ for c.d.a.a.c not found. Known fields are [private static final c.d.a.a.c c.d.a.a.c.e, private static volatile c.a.a.b1 c.d.a.a.c.f]
The text was updated successfully, but these errors were encountered: