@@ -3544,19 +3544,21 @@ private void registerConfigSignInProviders(final AWSConfiguration awsConfigurati
35443544 Log .d (TAG , "Using the SignInProviderConfig from `awsconfiguration.json`." );
35453545 final IdentityManager identityManager = IdentityManager .getDefaultIdentityManager ();
35463546
3547- if ( isConfigurationKeyPresent ( USER_POOLS , awsConfiguration )
3548- && ! identityManager . getSignInProviderClasses (). contains ( CognitoUserPoolsSignInProvider . class )) {
3549- identityManager .addSignInProvider (CognitoUserPoolsSignInProvider .class );
3550- }
3547+ try {
3548+ if ( isConfigurationKeyPresent ( USER_POOLS , awsConfiguration )) {
3549+ identityManager .addSignInProvider (CognitoUserPoolsSignInProvider .class );
3550+ }
35513551
3552- if (isConfigurationKeyPresent (FACEBOOK , awsConfiguration )
3553- && !identityManager .getSignInProviderClasses ().contains (FacebookSignInProvider .class )) {
3554- identityManager .addSignInProvider (FacebookSignInProvider .class );
3555- }
3552+ if (isConfigurationKeyPresent (FACEBOOK , awsConfiguration )) {
3553+ identityManager .addSignInProvider (FacebookSignInProvider .class );
3554+ }
35563555
3557- if (isConfigurationKeyPresent (GOOGLE , awsConfiguration )
3558- && !identityManager .getSignInProviderClasses ().contains (GoogleSignInProvider .class )) {
3559- identityManager .addSignInProvider (GoogleSignInProvider .class );
3556+ if (isConfigurationKeyPresent (GOOGLE , awsConfiguration )) {
3557+ identityManager .addSignInProvider (GoogleSignInProvider .class );
3558+ }
3559+ } catch (NoClassDefFoundError exception ) {
3560+ Log .w (TAG , "Sign in provider was not registered due to missing optional dependency. " +
3561+ "showSignIn() API may not work as expected." , exception );
35603562 }
35613563 }
35623564
0 commit comments