Error while trying to authenticate login using firebase in flutter - firebase

I am creating a logging system using firebase, i have connected my project to firebase and enabled
email and password authentication and added users. But when i run the app and try to login using the
email and password that i have added,it shows the below error and the app crashes.
class _AdminLoginState extends State<AdminLogin> {
String _username, _password;
final GlobalKey<FormState> _formkey = GlobalKey<FormState>();
Future<void> login() async{
final formState = _formkey.currentState;
if(formState.validate()){
formState.save();
try{
final FirebaseUser user = (await FirebaseAuth.instance.signInWithEmailAndPassword(email: _username, password: _password)).user;
Navigator.push(context, MaterialPageRoute(builder: (context) => Dashboard()));
}catch(e){
print(e.message);
}
}
}
}
when i enter the username and password the app shutdowns and throws me this error.
W/BiChannelGoogleApi(29343): [FirebaseAuth: ] getGoogleApiForMethod() returned Gms: com.google.firebase.auth.api.internal.zzak#4b54d30
E/JavaBinder(29343): *** Uncaught remote exception! (Exceptions are not yet supported across processes.)
E/JavaBinder(29343): java.lang.NoClassDefFoundError: Failed resolution of: Landroid/support/v4/util/ArrayMap;
E/JavaBinder(29343): at com.google.firebase.auth.internal.zzam.zzc(Unknown Source:22)
E/JavaBinder(29343): at com.google.firebase.auth.internal.zzam.zzde(Unknown Source:17)
E/JavaBinder(29343): at com.google.firebase.auth.api.internal.zzep.zza(Unknown Source:9)
E/JavaBinder(29343): at android.os.Binder.execTransact(Binder.java:735)
E/JavaBinder(29343): Caused by: java.lang.ClassNotFoundException: Didn't find class "android.support.v4.util.ArrayMap" on path: DexPathList[[zip file "/data/app/m20zero.adminbookingpage-tivSbYSPqm94eArdHgurKQ==/base.apk"],nativeLibraryDirectories=[/data/app/m20zero.adminbookingpage-tivSbYSPqm94eArdHgurKQ==/lib/arm64, /data/app/m20zero.adminbookingpage-tivSbYSPqm94eArdHgurKQ==/base.apk!/lib/arm64-v8a, /system/lib64, /vendor/lib64]]
E/JavaBinder(29343): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:134)
E/JavaBinder(29343): at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
E/JavaBinder(29343): at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
E/JavaBinder(29343): ... 16 more
E/AndroidRuntime(29343): FATAL EXCEPTION: Binder:29343_1
E/AndroidRuntime(29343): Process: m20zero.adminbookingpage, PID: 29343
E/AndroidRuntime(29343): java.lang.NoClassDefFoundError: Failed resolution of: Landroid/support/v4/util/ArrayMap;
E/AndroidRuntime(29343): at com.google.firebase.auth.internal.zzam.zzc(Unknown Source:22)
E/AndroidRuntime(29343): at com.google.firebase.auth.internal.zzam.zzde(Unknown Source:17)
E/AndroidRuntime(29343): at com.google.android.gms.internal.firebase_auth.zza.onTransact(Unknown Source:13)
E/AndroidRuntime(29343): at android.os.Binder.execTransact(Binder.java:735)
E/AndroidRuntime(29343): Caused by: java.lang.ClassNotFoundException: Didn't find class "android.support.v4.util.ArrayMap" on path: DexPathList[[zip file "/data/app/m20zero.adminbookingpage-tivSbYSPqm94eArdHgurKQ==/base.apk"],nativeLibraryDirectories=[/data/app/m20zero.adminbookingpage-tivSbYSPqm94eArdHgurKQ==/lib/arm64, /data/app/m20zero.adminbookingpage-tivSbYSPqm94eArdHgurKQ==/base.apk!/lib/arm64-v8a, /system/lib64, /vendor/lib64]]
E/AndroidRuntime(29343): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:134)
E/AndroidRuntime(29343): at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
E/AndroidRuntime(29343): at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
E/AndroidRuntime(29343): ... 16 more
I/Process (29343): Sending signal. PID: 29343 SIG: 9
Lost connection to device.
'''

Did you change the minSdk version on build.gradle file?

Related

SafetyNet Attestation fails Flutter Firebase Phone Authentication

I am working on one of my flutter project and trying to add firebase phone authentication but I encountered with the error related to safetynet.Whereas i am able to use other authentication methods e.g. SignInWithEmailAndPassword. Whenever I am calling my phoneLogin function i am getting the error. I have already installed google play service on my emulator.
CODE
Future phoneLogin(String phone) async {
BuildContext context;
try {
await auth.verifyPhoneNumber(
phoneNumber: '+91$phone',
timeout: const Duration(seconds: 30),
verificationCompleted: (PhoneAuthCredential credentials) async {
await auth.signInWithCredential(credentials);
},
verificationFailed: (FirebaseAuthException exception) {},
codeSent: (String verificationId, [int forcedResendingToken]) {
// print('1')
Navigator.push(
context,
MaterialPageRoute(
builder: (BuildContext context) => OtpPage(phone: phone),
),
);
},
codeAutoRetrievalTimeout: (String abc) {});
return null;
} catch (e) {
return null;
}
}
ERROR
E/zzbf ( 6483): SafetyNet Attestation fails basic integrity.
I/zzkn ( 6483): Provider GmsCore_OpenSSL not available
W/System ( 6483): Ignoring header X-Firebase-Locale because its value was null.
D/AndroidRuntime( 6483): Shutting down VM
E/AndroidRuntime( 6483): FATAL EXCEPTION: main
E/AndroidRuntime( 6483): Process: com.oneobit.greenobit, PID: 6483
E/AndroidRuntime( 6483): java.lang.NoClassDefFoundError: Failed resolution of: Landroidx/browser/customtabs/CustomTabsIntent$Builder;
E/AndroidRuntime( 6483): at com.google.firebase.auth.internal.RecaptchaActivity.zza(com.google.firebase:firebase-auth##20.0.2:13)
E/AndroidRuntime( 6483): at com.google.android.gms.internal.firebase-auth-api.zztw.zzb(com.google.firebase:firebase-auth##20.0.2:7)
E/AndroidRuntime( 6483): at com.google.android.gms.internal.firebase-auth-api.zztw.onPostExecute(Unknown Source:2)
E/AndroidRuntime( 6483): at android.os.AsyncTask.finish(AsyncTask.java:771)
E/AndroidRuntime( 6483): at android.os.AsyncTask.access$900(AsyncTask.java:199)
E/AndroidRuntime( 6483): at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:788)
E/AndroidRuntime( 6483): at android.os.Handler.dispatchMessage(Handler.java:106)
E/AndroidRuntime( 6483): at android.os.Looper.loop(Looper.java:223)
E/AndroidRuntime( 6483): at android.app.ActivityThread.main(ActivityThread.java:7656)
E/AndroidRuntime( 6483): at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime( 6483): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
E/AndroidRuntime( 6483): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
E/AndroidRuntime( 6483): Caused by: java.lang.ClassNotFoundException: Didn't find class "androidx.browser.customtabs.CustomTabsIntent$Builder" on path: DexPathList[[zip file "/data/app/~~VMK8TkW9ozBJD9t7dnRn8g==/com.oneobit.greenobit-EtKxl5CBj6rDZiliq4I1ZQ==/base.apk"],nativeLibraryDirectories=[/data/app/~~VMK8TkW9ozBJD9t7dnRn8g==/com.oneobit.greenobit-EtKxl5CBj6rDZiliq4I1ZQ==/lib/x86, /data/app/~~VMK8TkW9ozBJD9t7dnRn8g==/com.oneobit.greenobit-EtKxl5CBj6rDZiliq4I1ZQ==/base.apk!/lib/x86, /system/lib, /system_ext/lib]]
E/AndroidRuntime( 6483): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:207)
E/AndroidRuntime( 6483): at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
E/AndroidRuntime( 6483): at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
E/AndroidRuntime( 6483): ... 12 more
I/Process ( 6483): Sending signal. PID: 6483 SIG: 9
Lost connection to device.
I have already updated SHA256 key to my Firebase console.
Firebase have updated certain things one of them is they have included captcha verification before sending the code or OTP to mobile devices.
To solve this issue see bellow:
add the following to project/android/app/build.gradle
implementation "androidx.browser:browser:1.3.0"
add this in the dependencies section ...
dependencies {
implementation "androidx.browser:browser:1.3.0"
///
}
you can find the latest version here: android browser .
REASON:
The app tries to verify the captcha and send the code, for that it tries to launch a browser but because of the missing implementation it fails to load a browser and crashes the application.

IllegalArgumentException: Unsupported value: null while login with twitter

I am trying to login with Twitter when i used dependency firebase_auth:^0.6.6 it was working perfactly and i fetch the user's Profile picture and the Code was
final TwitterLoginResult result = await twitterLogin.authorize();
switch (result.status)
{
case TwitterLoginStatus.loggedIn:
var session = result.session;
FirebaseUser user = await _auth.signInWithTwitter(
authToken: session.token, authTokenSecret: session.secret);
img=user.photoUrl;
}
but i migrated the app to AndroidX and this dependency was not compatible so i used firebase_auth: ^0.14.0+5 and this code was not working so i change the code to
final TwitterLoginResult result = await twitterLogin.authorize();
switch (result.status) {
case TwitterLoginStatus.loggedIn:
var session = result.session;
final AuthCredential credential =
TwitterAuthProvider.getCredential(authToken: session.token,
authTokenSecret: session.secret);
FirebaseUser user = (await _auth.signInWithCredential(credential)).user;
and this code is not working app is Crashing and showing the error
W/BiChannelGoogleApi(18829): [FirebaseAuth: ] getGoogleApiForMethod() returned Gms: com.google.firebase.auth.api.internal.zzak#70a4ccf
W/InputMethodManager(18829): startInputReason = 1
D/FirebaseAuth(18829): Notifying id token listeners about user ( D71yiiEX7ubSon4xxcddKlSydn72 ).
D/FirebaseAuth(18829): Notifying auth state listeners about user ( D71yiiEXccccccccKlSydn72 ).
I/zygote64(18829): Do full code cache collection, code=124KB, data=91KB
I/zygote64(18829): After code cache collection, code=123KB, data=68KB
I/zygote64(18829): Do partial code cache collection, code=123KB, data=68KB
I/zygote64(18829): After code cache collection, code=123KB, data=68KB
I/zygote64(18829): Increasing code cache capacity to 512KB
D/AndroidRuntime(18829): Shutting down VM
E/AndroidRuntime(18829): FATAL EXCEPTION: main
E/AndroidRuntime(18829): Process: com.example.login_app, PID: 18829
E/AndroidRuntime(18829): java.lang.IllegalArgumentException: Unsupported value: null
E/AndroidRuntime(18829): at io.flutter.plugin.common.StandardMessageCodec.writeValue(StandardMessageCodec.java:294)
E/AndroidRuntime(18829): at io.flutter.plugin.common.StandardMessageCodec.writeValue(StandardMessageCodec.java:291)
E/AndroidRuntime(18829): at io.flutter.plugin.common.StandardMessageCodec.writeValue(StandardMessageCodec.java:291)
E/AndroidRuntime(18829): at io.flutter.plugin.common.StandardMessageCodec.writeValue(StandardMessageCodec.java:291)
E/AndroidRuntime(18829): at io.flutter.plugin.common.StandardMethodCodec.encodeSuccessEnvelope(StandardMethodCodec.java:57)
E/AndroidRuntime(18829): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler$1.success(MethodChannel.java:225)
E/AndroidRuntime(18829): at io.flutter.plugins.firebaseauth.FirebaseAuthPlugin$SignInCompleteListener.onComplete(FirebaseAuthPlugin.java:691)
E/AndroidRuntime(18829): at com.google.android.gms.tasks.zzj.run(Unknown Source:4)
E/AndroidRuntime(18829): at android.os.Handler.handleCallback(Handler.java:808)
E/AndroidRuntime(18829): at android.os.Handler.dispatchMessage(Handler.java:101)
E/AndroidRuntime(18829): at android.os.Looper.loop(Looper.java:166)
E/AndroidRuntime(18829): at android.app.ActivityThread.main(ActivityThread.java:7529)
E/AndroidRuntime(18829): at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime(18829): at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:245)
E/AndroidRuntime(18829): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:921)
I/Process (18829): Sending signal. PID: 18829 SIG: 9
Lost connection to device.
Please can someone explain to me how to resolve this problem?
Problem is with login task AND Androidx twitter_login_issue
Add this dependency in your pubspec.yaml file and let me know this working or not?
flutter_twitter_login:
git: git://github.com/eudangeld/flutter_twitter_login.git
Same issue (question) login_issue

Flutter app crashes on concurrent transactions performed on cloud Firestore

I am trying to develop an app where multiple users log in and completes a poll concurrently.
In this, as soon as user submits the answer the transaction is ran to increment the counter for given answer
try {
DocumentSnapshot freshsnap = await tx.get(reff);
try {
await tx.update(reff, <String, dynamic>{
'$i': freshsnap['$i'] + 1,
});
} catch (error) {
print("Error" + error.code);
}
} catch (error) {
if (error is PlatformException &&
error.code == 'Error performing transaction') {
// await tx.set(ref, data);
print("Error" + error.code);
} else
rethrow;
}
}).catchError((onError){
print("Error on: "+onError);
});
as soon as the multiple users submit the same answer for same question concurrently i.e The same field in same document is requested to update by multiple users concurrently the app crashes and generates following error:
FATAL EXCEPTION: AsyncTask #1
E/AndroidRuntime(12169): Process: com.rrcg.tumerboared, PID: 12169
E/AndroidRuntime(12169): java.lang.RuntimeException: An error occurred while executing doInBackground()
E/AndroidRuntime(12169): at android.os.AsyncTask$3.done(AsyncTask.java:354)
E/AndroidRuntime(12169): at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:383)
E/AndroidRuntime(12169): at java.util.concurrent.FutureTask.setException(FutureTask.java:252)
E/AndroidRuntime(12169): at java.util.concurrent.FutureTask.run(FutureTask.java:271)
E/AndroidRuntime(12169): at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:245)
E/AndroidRuntime(12169): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
E/AndroidRuntime(12169): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
E/AndroidRuntime(12169): at java.lang.Thread.run(Thread.java:764)
E/AndroidRuntime(12169): Caused by: java.lang.AssertionError: INTERNAL ASSERTION FAILED: A transaction object cannot be used after its update callback has been invoked.
E/AndroidRuntime(12169): at com.google.firebase.firestore.util.Assert.fail(com.google.firebase:firebase-firestore##21.2.1:46)
E/AndroidRuntime(12169): at com.google.firebase.firestore.util.Assert.hardAssert(com.google.firebase:firebase-firestore##21.2.1:31)
E/AndroidRuntime(12169): at com.google.firebase.firestore.core.Transaction.ensureCommitNotCalled(com.google.firebase:firebase-firestore##21.2.1:246)
E/AndroidRuntime(12169): at com.google.firebase.firestore.core.Transaction.lookup(com.google.firebase:firebase-firestore##21.2.1:81)
E/AndroidRuntime(12169): at com.google.firebase.firestore.Transaction.getAsync(com.google.firebase:firebase-firestore##21.2.1:191)
E/AndroidRuntime(12169): at com.google.firebase.firestore.Transaction.get(com.google.firebase:firebase-firestore##21.2.1:228)
E/AndroidRuntime(12169): at io.flutter.plugins.firebase.cloudfirestore.CloudFirestorePlugin$5.doInBackground(CloudFirestorePlugin.java:550)
E/AndroidRuntime(12169): at io.flutter.plugins.firebase.cloudfirestore.CloudFirestorePlugin$5.doInBackground(CloudFirestorePlugin.java:545)
E/AndroidRuntime(12169): at android.os.AsyncTask$2.call(AsyncTask.java:333)
E/AndroidRuntime(12169): at java.util.concurrent.FutureTask.run(FutureTask.java:266)
E/AndroidRuntime(12169): ... 4 more
Have no idea why is this happening, since transaction should allow multiple users to update a field of a document concurrently.
If you are running on a physical iOS device, the crash is caused by this bug in the FlutterFire binding library. There doesn't seem to be a workaround, so keep an eye on the issue for updates.
I solved this by making the transaction object (tx) non-async and moving the async logic outside the transaction block. After all, the whole point of transactions is to execute its instructions atomically and async instructions kind of defeat this purpose.

FirebaseAuth.signInWithCredential is causing my Flutter app to crash when I call it

I'm new to Flutter and Firebase. I'm trying to set up Phone Authentication with Firebase. I created a project on Firebase and my Flutter app is registered.
My app keeps crashing when I run FirebaseAuth.instance.signInWithCredential(credential).
// Successfully ran this and got a verificationID back.
await FirebaseAuth.instance.verifyPhoneNumber(
phoneNumber: '+18005558989',
timeout: const Duration(seconds: 0),
verificationCompleted: verificationCompleted,
verificationFailed: verificationFailed,
codeSent: codeSent,
codeAutoRetrievalTimeout: codeAutoRetrievalTimeout);
// This works
final AuthCredential credential = PhoneAuthProvider.getCredential(
verificationId: argVerificationID,
smsCode: smsCode,
);
// This is where the app crashes.
AuthResult authResult = await FirebaseAuth.instance
.signInWithCredential(credential)
.catchError((onError) {
// Handle Errors here.
var errorCode = onError.code;
var errorMessage = onError.message;
// The firebase.auth.AuthCredential type that was used.
var credential = errorCode.credential;
print("ERROR CODE:$errorCode");
print("ERROR MESSAGE:$errorMessage");
print("ERROR CREDENTIAL:$credential");
});
Here is the Error Output:
W/BiChannelGoogleApi(23681): [FirebaseAuth: ] getGoogleApiForMethod()
returned Gms: com.google.firebase.auth.api.internal.zzak#30ab46a
E/JavaBinder(23681): *** Uncaught remote exception! (Exceptions are
not yet supported across processes.) E/JavaBinder(23681):
java.lang.NoClassDefFoundError: Failed resolution of:
Landroid/support/v4/util/ArrayMap; E/JavaBinder(23681): at
com.google.firebase.auth.internal.zzam.zzc(Unknown Source:22)
E/JavaBinder(23681): at
com.google.firebase.auth.internal.zzam.zzde(Unknown Source:17)
E/JavaBinder(23681): at
com.google.firebase.auth.internal.zzam.zzdd(Unknown Source:8)
E/JavaBinder(23681): at
com.google.firebase.auth.internal.zzan.zzdf(Unknown Source:1)
E/JavaBinder(23681): at
com.google.firebase.auth.internal.zzm.isAnonymous(Unknown Source:47)
E/JavaBinder(23681): at
com.google.firebase.auth.internal.zzat.zzi(Unknown Source:57)
E/JavaBinder(23681): at
com.google.firebase.auth.internal.zzat.zzg(Unknown Source:10)
E/JavaBinder(23681): at
com.google.firebase.auth.FirebaseAuth.zza(Unknown Source:62)
E/JavaBinder(23681): at
com.google.firebase.auth.FirebaseAuth$zzb.zza(Unknown Source:5)
E/JavaBinder(23681): at
com.google.firebase.auth.api.internal.zzcv.zzdx(Unknown Source:14)
E/JavaBinder(23681): at
com.google.firebase.auth.api.internal.zzen.zzen(Unknown Source:35)
E/JavaBinder(23681): at
com.google.firebase.auth.api.internal.zzen.zza(Unknown Source:41)
E/JavaBinder(23681): at
com.google.firebase.auth.api.internal.zzep.zza(Unknown Source:9)
E/JavaBinder(23681): at
com.google.firebase.auth.api.internal.zzdx.dispatchTransaction(Unknown
Source:9) E/JavaBinder(23681): at
com.google.android.gms.internal.firebase_auth.zza.onTransact(Unknown
Source:13) E/JavaBinder(23681): at
android.os.Binder.execTransactInternal(Binder.java:1021)
E/JavaBinder(23681): at
android.os.Binder.execTransact(Binder.java:994) E/JavaBinder(23681):
Caused by: java.lang.ClassNotFoundException: Didn't find class
"android.support.v4.util.ArrayMap" on path: DexPathList[[zip file...
I'm expecting a FirebaseUser return and successfully authenticated. It looks like Firebase updated their authentication because a lot of the methods that are found used in tutorials are no longer there.
In case anyone else runs into this problem, this happened because while developing the Flutter app, Android Studio prompted a new version of Flutter is available and I hit upgrade. But a manual flutter upgrade needed to be executed in the Terminal and upgrading Kotlin to the latest version.
Steps I took to solve this issue:
Updated the following files:
project_folder/android/build.gradle. Changed "ext.kotlin_version = '1.2.71'" to "ext.kotlin_version='1.3.50'"
project_folder/android/gradle/gradle-wrapper.properties. Set distributionUrl to the latest gradle, "distributionUrl=https://services.gradle.org/distributions/gradle-5.4.1-all.zip". Android Studio notified to use the latest gradle and stated where to make the change.
Add these two lines to project_folder/android/gradle.properties:
android.useAndroidX=true
android.enableJetifier=true
Then go to Refactor > Migrate to AndroidX. Waited for that to complete then ran the bottom commands in the terminal.
Commands to run in Terminal (Mac OS):
$ flutter upgrade
$ flutter pub upgrade
$ flutter clean
That did it for me. Now when I run
await FirebaseAuth.instance
.signInWithCredential(credential).then((authResult){
print(authResult.user);})
I get an AuthResult object returned back with the FireBaseUser object inside of it. Here is the output:
FirebaseUser({uid: yZXXXXXXXXXXXX, isAnonymous: false, phoneNumber: +18005558989, ...})
Open on Android Studio on your Flutter Project
Then, Update all gradle and kotlin and migrate kotlin
Then, Migrate to Android X
Then, Open Flutter Project
Flutter Upgrade
Flutter pub Upgrade
Flutter Clean

Android App - using multidex and firebase - app crashes

In my app I'm using a barcode reader from play-services-vision. Because of added firebase messages dependencies, I had to add multidex suppport. But as soon as I add the firebase dependencies, the app crashes on my Galaxy S8 (Andriod 9). When I run the app and like to start the barcode functionality, the ap crashes with a class not found exception:
I did the steps to add multidex and firebase dependency adding step by step, as soon as I add firebase dependency - the crash occurs in the app.
exception:
E/AndroidRuntime: FATAL EXCEPTION: main
Process: info....app, PID: 15574
java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/gms/internal/zzsb;
at com.google.android.gms.vision.barcode.internal.client.zzd.zzchw(Unknown Source:13)
at com.google.android.gms.vision.barcode.internal.client.zzd.<init>(Unknown Source:20)
at com.google.android.gms.vision.barcode.BarcodeDetector$Builder.build(Unknown Source:6)
at com.google.android.gms.samples.vision.barcodereader.BarcodeCaptureActivity.createCameraSource(BarcodeCaptureActivity.java:184)
at com.google.android.gms.samples.vision.barcodereader.BarcodeCaptureActivity.onCreate(BarcodeCaptureActivity.java:105)
at android.app.Activity.performCreate(Activity.java:7327)
at android.app.Activity.performCreate(Activity.java:7318)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1271)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3094)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3257)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1948)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:214)
at android.app.ActivityThread.main(ActivityThread.java:7050)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:965)
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.android.gms.internal.zzsb" on path: DexPathList[[zip file "/system/framework/org.apache.http.legacy.boot.jar", zip file "/data/app/info....app-wZywn7WMb4zo51Qz3E_qpg==/base.apk"],nativeLibraryDirectories=[/data/app/info....app-wZywn7WMb4zo51Qz3E_qpg==/lib/arm64, /system/lib64, /system/vendor/lib64]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:134)
at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
at com.google.android.gms.vision.barcode.internal.client.zzd.zzchw(Unknown Source:13)
at com.google.android.gms.vision.barcode.internal.client.zzd.<init>(Unknown Source:20)
at com.google.android.gms.vision.barcode.BarcodeDetector$Builder.build(Unknown Source:6)
at com.google.android.gms.samples.vision.barcodereader.BarcodeCaptureActivity.createCameraSource(BarcodeCaptureActivity.java:184)
at com.google.android.gms.samples.vision.barcodereader.BarcodeCaptureActivity.onCreate(BarcodeCaptureActivity.java:105)
at android.app.Activity.performCreate(Activity.java:7327)
at android.app.Activity.performCreate(Activity.java:7318)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1271)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3094)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3257)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1948)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:214)
at android.app.ActivityThread.main(ActivityThread.java:7050)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:965)
build.gradle excerpt:
compileSdkVersion 27
defaultConfig {
applicationId "info....app"
minSdkVersion 16
targetSdkVersion 27
versionCode 101
versionName "1.0.1"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.configrelease
}
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:multidex:1.0.3'
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
implementation 'com.android.support:support-compat:27.1.1'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
// Important - the CameraSource implementation in this project requires version 8.1 or higher.
implementation 'com.google.android.gms:play-services-vision:9.4.0+'
implementation 'com.android.support:design:27.1.1'
// firebase
implementation 'com.google.firebase:firebase-messaging:17.3.4'
implementation 'com.google.firebase:firebase-inappmessaging-display:17.0.4'
}

Resources