Skip to content
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

Initialization error on release mode #19

Open
Zazo032 opened this issue May 26, 2021 · 1 comment
Open

Initialization error on release mode #19

Zazo032 opened this issue May 26, 2021 · 1 comment

Comments

@Zazo032
Copy link

Zazo032 commented May 26, 2021

I've set up the plugin and it works correctly on debug/profile modes, but when I run it on release mode, I always get this error when the plugin is initialized:

E/flutter (31094): [ERROR:flutter/lib/ui/ui_dart_state.cc(213)] Unhandled Exception: type 'Null' is not a subtype of type 'bool'
E/flutter (31094): #0      new MsalMobileResult.fromJson (package:msal_mobile/result.dart:13)
E/flutter (31094): #1      MsalMobile.create (package:msal_mobile/msal_mobile.dart:45)

However, if I set minifyEnabled false in android/app/build.gradle, it works as intended, but the app size goes a lot bigger. I've tried adding many Proguard rules, but that doesn't seem to work.

I'm using #15

@Zazo032
Copy link
Author

Zazo032 commented May 26, 2021

When minified, the result being passed to Flutter looks like this:

{"a":true,"d":true,"e":false}

But without minify enabled, it looks like this:

{"isSuccess":true,"isUiRequired":false,"payload":true}

Therefore, when the plugin tries to read the following code on Flutter side, it fails, because the keys got minified and changed to other values:

isSuccess: json['isSuccess'],

For some reason, the json keys are getting minified.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant