Здесь я реализовал логин гугл. Я использовал google_sign_in 4.1.4 , пожалуйста, помогите мне узнать, где я делаю ошибку или что-то упустил. Заранее спасибо .. !!
эта ошибка Отклонение повторной инициализации для ранее неудачного класса java .lang.Class: java .lang.NoClassDefFoundError: Не удалось разрешить: Landroidx / lifecycle / LifecycleEventObserver; I / zygote64 (27656): в java .lang.Object java .lang.Class.newInstance () (Class. java: - 2)
onTap: () async{
_signIn(context)
.then((FirebaseUser user) => print(user))
.catchError((e) => print(e));
},
final FirebaseAuth _auth = FirebaseAuth.instance;
final GoogleSignIn _googleSignIn = new GoogleSignIn();
Future<FirebaseUser> _signIn(BuildContext context) async{
GoogleSignInAccount googleSignInAccount = await _googleSignIn.signIn(); //crash on this line
GoogleSignInAuthentication gSA = await googleSignInAccount.authentication;
final AuthCredential credential = GoogleAuthProvider.getCredential(idToken: gSA.idToken, accessToken: gSA.accessToken);
final AuthResult authResult = await _auth.signInWithCredential(credential);
final FirebaseUser userDetails = authResult.user;
ProviderDetails providerInfo = new ProviderDetails(userDetails.providerId);
List<ProviderDetails> providerData = new List<ProviderDetails>();
providerData.add(providerInfo);
UserDetails details = new UserDetails(
userDetails.providerId,
userDetails.displayName,
userDetails.photoUrl,
userDetails.email,
providerData,
);
Navigator.push(
context,
new MaterialPageRoute(
builder: (context) => new ChooseCollegeScreen(),
),
);
return userDetails;
}
здесь мой журнал ошибок =========>
Rejecting re-init on previously-failed class java.lang.Class<androidx.activity.ComponentActivity$2>: java.lang.NoClassDefFoundError: Failed resolution of: Landroidx/lifecycle/LifecycleEventObserver;
I/zygote64(27656): at java.lang.Object java.lang.Class.newInstance() (Class.java:-2)
I/zygote64(27656): at android.app.Activity android.app.Instrumentation.newActivity(java.lang.ClassLoader, java.lang.String, android.content.Intent) (Instrumentation.java:1175)
I/zygote64(27656): at android.app.Activity android.app.ActivityThread.performLaunchActivity(android.app.ActivityThread$ActivityClientRecord, android.content.Intent) (ActivityThread.java:2708)
I/zygote64(27656): at void android.app.ActivityThread.handleLaunchActivity(android.app.ActivityThread$ActivityClientRecord, android.content.Intent, java.lang.String) (ActivityThread.java:2895)
I/zygote64(27656): at void android.app.ActivityThread.-wrap11(android.app.ActivityThread, android.app.ActivityThread$ActivityClientRecord, android.content.Intent, java.lang.String) (ActivityThread.java:-1)
I/zygote64(27656): at void android.app.ActivityThread$H.handleMessage(android.os.Message) (ActivityThread.java:1616)
I/zygote64(27656): at void android.os.Handler.dispatchMessage(android.os.Message) (Handler.java:106)
I/zygote64(27656): at void android.os.Looper.loop() (Looper.java:176)
I/zygote64(27656): at void android.app.ActivityThread.main(java.lang.String[]) (ActivityThread.java:6651)
I/zygote64(27656): at java.lang.Object java.lang.reflect.Method.invoke(java.lang.Object, java.lang.Object[]) (Method.java:-2)
I/zygote64(27656): at void com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run() (RuntimeInit.java:547)
I/zygote64(27656): at void com.android.internal.os.ZygoteInit.main(java.lang.String[]) (ZygoteInit.java:824)
I/zygote64(27656): Caused by: java.lang.ClassNotFoundException: Didn't find class "androidx.lifecycle.LifecycleEventObserver" on path: DexPathList[[zip file "/data/app/moon.campushaat.com-_doLzLlPm2QzmtHCYUYAfg==/base.apk"],nativeLibraryDirectories=[/data/app/moon.campushaat.com-_doLzLlPm2QzmtHCYUYAfg==/lib/arm64, /data/app/moon.campushaat.com-_doLzLlPm2QzmtHCYUYAfg==/base.apk!/lib/arm64-v8a, /system/lib64, /system/vendor/lib64]]
I/zygote64(27656): at java.lang.Class dalvik.system.BaseDexClassLoader.findClass(java.lang.String) (BaseDexClassLoader.java:125)
I/zygote64(27656): at java.lang.Class java.lang.ClassLoader.loadClass(java.lang.String, boolean) (ClassLoader.java:379)
I/zygote64(27656): at java.lang.Class java.lang.ClassLoader.loadClass(java.lang.String) (ClassLoader.java:312)
I/zygote64(27656): at java.lang.Object java.lang.Class.newInstance() (Class.java:-2)
I/zygote64(27656): at android.app.Activity android.app.Instrumentation.newActivity(java.lang.ClassLoader, java.lang.String, android.content.Intent) (Instrumentation.java:1175)
I/zygote64(27656): at android.app.Activity android.app.ActivityThread.performLaunchActivity(android.app.ActivityThread$ActivityClientRecord, android.content.Intent) (ActivityThread.java:2708)
I/zygote64(27656): at void android.app.ActivityThread.handleLaunchActivity(android.app.ActivityThread$ActivityClientRecord, android.content.Intent, java.lang.String) (ActivityThread.java:2895)
I/zygote64(27656): at void android.app.ActivityThread.-wrap11(android.app.ActivityThread, android.app.ActivityThread$ActivityClientRecord, android.content.Intent, java.lang.String) (ActivityThread.java:-1)
I/zygote64(27656): at void android.app.ActivityThread$H.handleMessage(android.os.Message) (ActivityThread.java:1616)
I/zygote64(27656): at void android.os.Handler.dispatchMessage(android.os.Message) (Handler.java:106)
I/zygote64(27656): at void android.os.Looper.loop() (Looper.java:176)
I/zygote64(27656): at void android.app.ActivityThread.main(java.lang.String[]) (ActivityThread.java:6651)
I/zygote64(27656): at java.lang.Object java.lang.reflect.Method.invoke(java.lang.Object, java.lang.Object[]) (Method.java:-2)
I/zygote64(27656): at void com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run() (RuntimeInit.java:547)
I/zygote64(27656): at void com.android.internal.os.ZygoteInit.main(java.lang.String[]) (ZygoteInit.java:824)