PlatformException- lateinit property singleFactorAuth has not been initialized

We have observed that in release mode, calling SingleFactorAuthFlutter.init throws a

PlatformException(error, Attempt to invoke virtual method 'int java.lang.String.hashCode()' on a null object reference, Attempt to invoke virtual method 'int java.lang.String.hashCode()' on a null object reference, null)
PlatformException(error, t8.w: lateinit property singleFactorAuth has not been initialized, t8.w: lateinit property singleFactorAuth has not been initialized, null)

This issue is only happening on Android and only in release mode

  • SDK Version: 6.0.1 (latest)
  • Platform: Android (release mode only)

@engelmmanuel Since this is happening only in release mode. Most probably its case of obsfuscation in release mode. Kindly add below rules in proguard-rules.pro:

-keep class com.web3auth.single_factor_auth_flutter.SingleFactorAuthFlutterPlugin { ; }
-keep class com.web3auth.singlefactorauth.
* { ; }
-keep class com.web3auth.singlefactorauth.types.
* { *; }
-keepclassmembers enum * { *; }

We are not using proguard, so there is no app specific proguard-rules.pro file in the Android module of the project. Here is what app level build.gradle looks like

buildTypes {
        debug {
            signingConfig signingConfigs.debug
        }
        profile {
            signingConfig signingConfigs.debug
        }
        release {
            signingConfig signingConfigs.release
        }
    }

As you will observe there is no reference to proguard-android.txt or proguard-rules.pro in any of the build types. Also, minifyEnabled , shrinkResources, or useProguard is not specified in any of the build types

I observe that you are not using any minifyEnabled, still i recommend you to use above rules and test it.