nodriver-ai / flutter_azure_b2c

A flutter library to handle the Azure B2C authentication protocol.
MIT License
7 stars 19 forks source link

App crash in release #16

Closed BusyBaptiste closed 1 year ago

BusyBaptiste commented 1 year ago

Hello,

I have integrated the flutter_azure_b2c package in my application. Everything works perfectly in DEBUG, on emulator or on a real phone. When I build in DEBUG and install the APK it works too, but if I build in RELEASE the application crashes. I think this is because in RELEASE the auth_config file is not found. How is this possible and how to fix it?

Thanks

jchirinosodio commented 1 year ago

Hi there, same issue here

Hello,

I have integrated the flutter_azure_b2c package in my application. Everything works perfectly in DEBUG, on emulator or on a real phone. When I build in DEBUG and install the APK it works too, but if I build in RELEASE the application crashes. I think this is because in RELEASE the auth_config file is not found. How is this possible and how to fix it?

Thanks

Have you found any solution? I am experiencing the same issue!

euphoria3k commented 1 year ago

I found the fix for this issue! You have to set minifyEnabled to false and shrinkResources to false in the buildTypes -> release section of your app's build.gradle.

I hope this helps!

emaborsa commented 1 year ago

This fixed it:

 buildTypes {
        release {
            ...
            minifyEnabled false
            shrinkResources false
        }
    }
markopex commented 2 months ago

Fix is working but I think it's maybe wrong way to solve it, why not try to add missing stuffs in the ProGuard file? -keep class com.microsoft.** { *; } This will probably solve the issue without losing optimisations. Please check https://github.com/AzureAD/microsoft-authentication-library-for-android/issues/513