Неудачные разрешения построителя учетных данных ⇐ JAVA
-
Anonymous
Неудачные разрешения построителя учетных данных
I want to continue an old android project of mine and started fixing issues with that. My program launches well in android virtual device but then goes background.(I tried it on my phone it doesn't do that) Then checked logcats and saw erros like below
java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/gms/auth/api/credentials/CredentialsOptions$Builder; at com.firebase.ui.auth.util.GoogleApiUtils.getCredentialsClient(GoogleApiUtils.java:29) at com.firebase.ui.auth.viewmodel.AuthViewModelBase.onCreate(AuthViewModelBase.java:30) at com.firebase.ui.auth.viewmodel.ViewModelBase.init(ViewModelBase.java:24) at com.firebase.ui.auth.KickoffActivity.onCreate(KickoffActivity.java:38) at android.app.Activity.performCreate(Activity.java:8595) at android.app.Activity.performCreate(Activity.java:8573) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1456) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3764) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3922) at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:103) at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:139) App has facebook,google and mail login check at start and it is giving errors there as far as i understand. Here is the deprecated code i have below;
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); providers = new ArrayList(); setContentView(R.layout.activity_main); auth = FirebaseAuth.getInstance(); if(auth.getCurrentUser() != null){ //USER ALREADY SIGNED IN Log.d("AUTH", auth.getCurrentUser().getEmail()); String firebaseuser = auth.getCurrentUser().getDisplayName(); String uid = auth.getCurrentUser().getUid(); Log.i("myuserid: ", uid); Intent intent = new Intent(getApplicationContext(),MainActivity.class); intent.putExtra("firebaseuser", firebaseuser); intent.putExtra("firebaseuid", uid); startActivity(intent); }else{ Log.d("AUTH222","burada"); startActivityForResult(AuthUI.getInstance() .createSignInIntentBuilder() .setAvailableProviders(Arrays.asList( new AuthUI.IdpConfig.FacebookBuilder().build(), new AuthUI.IdpConfig.EmailBuilder().build(), new AuthUI.IdpConfig.GoogleBuilder().build() )) .build(), RC_SIGN_IN); } } @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); if(requestCode==RC_SIGN_IN){ if(resultCode==RESULT_OK){ //users logged in Log.d("AUTH", auth.getCurrentUser().getEmail()); Intent intent = new Intent(getApplicationContext(),MainActivity.class); startActivity(intent); }else{ // users not authenticated Log.d("AUTH", "NOT AUTHENTİCATED"); } } } After a bit research i found out that startactivtyforresult is depreceated, is it the reason for this to happen or something else?. if it is what is the correct way to fix this with registerForActivityResult method?
Thanks in advance
Источник: https://stackoverflow.com/questions/780 ... alsbuilder
I want to continue an old android project of mine and started fixing issues with that. My program launches well in android virtual device but then goes background.(I tried it on my phone it doesn't do that) Then checked logcats and saw erros like below
java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/gms/auth/api/credentials/CredentialsOptions$Builder; at com.firebase.ui.auth.util.GoogleApiUtils.getCredentialsClient(GoogleApiUtils.java:29) at com.firebase.ui.auth.viewmodel.AuthViewModelBase.onCreate(AuthViewModelBase.java:30) at com.firebase.ui.auth.viewmodel.ViewModelBase.init(ViewModelBase.java:24) at com.firebase.ui.auth.KickoffActivity.onCreate(KickoffActivity.java:38) at android.app.Activity.performCreate(Activity.java:8595) at android.app.Activity.performCreate(Activity.java:8573) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1456) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3764) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3922) at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:103) at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:139) App has facebook,google and mail login check at start and it is giving errors there as far as i understand. Here is the deprecated code i have below;
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); providers = new ArrayList(); setContentView(R.layout.activity_main); auth = FirebaseAuth.getInstance(); if(auth.getCurrentUser() != null){ //USER ALREADY SIGNED IN Log.d("AUTH", auth.getCurrentUser().getEmail()); String firebaseuser = auth.getCurrentUser().getDisplayName(); String uid = auth.getCurrentUser().getUid(); Log.i("myuserid: ", uid); Intent intent = new Intent(getApplicationContext(),MainActivity.class); intent.putExtra("firebaseuser", firebaseuser); intent.putExtra("firebaseuid", uid); startActivity(intent); }else{ Log.d("AUTH222","burada"); startActivityForResult(AuthUI.getInstance() .createSignInIntentBuilder() .setAvailableProviders(Arrays.asList( new AuthUI.IdpConfig.FacebookBuilder().build(), new AuthUI.IdpConfig.EmailBuilder().build(), new AuthUI.IdpConfig.GoogleBuilder().build() )) .build(), RC_SIGN_IN); } } @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); if(requestCode==RC_SIGN_IN){ if(resultCode==RESULT_OK){ //users logged in Log.d("AUTH", auth.getCurrentUser().getEmail()); Intent intent = new Intent(getApplicationContext(),MainActivity.class); startActivity(intent); }else{ // users not authenticated Log.d("AUTH", "NOT AUTHENTİCATED"); } } } After a bit research i found out that startactivtyforresult is depreceated, is it the reason for this to happen or something else?. if it is what is the correct way to fix this with registerForActivityResult method?
Thanks in advance
Источник: https://stackoverflow.com/questions/780 ... alsbuilder
Мобильная версия