I'm using the regular use case for Firebase (It's a Flutter app) authentication. When I log in unsuccessfully, it gives me an error as expected. Whenever I successfully log in with it, it crashes my app with this message:
E/JavaBinder( 4289): *** Uncaught remote exception! (Exceptions are not yet supported across processes.)
E/JavaBinder( 4289): java.lang.NoClassDefFoundError: Failed resolution of: Landroid/support/v4/util/ArrayMap;
E/JavaBinder( 4289): at com.google.firebase.auth.internal.zzam.zzc(Unknown Source:22)
E/JavaBinder( 4289): at com.google.firebase.auth.internal.zzam.zzde(Unknown Source:17)
E/JavaBinder( 4289): at com.google.firebase.auth.internal.zzam.zzdd(Unknown Source:8)
E/JavaBinder( 4289): at com.google.firebase.auth.internal.zzan.zzdf(Unknown Source:1)
E/JavaBinder( 4289): at com.google.firebase.auth.internal.zzm.isAnonymous(Unknown Source:47)
E/JavaBinder( 4289): at com.google.firebase.auth.internal.zzat.zzi(Unknown Source:57)
E/JavaBinder( 4289): at com.google.firebase.auth.internal.zzat.zzg(Unknown Source:10)
E/JavaBinder( 4289): at com.google.firebase.auth.FirebaseAuth.zza(Unknown Source:62)
E/JavaBinder( 4289): at com.google.firebase.auth.FirebaseAuth$zzb.zza(Unknown Source:5)
E/JavaBinder( 4289): at com.google.firebase.auth.api.internal.zzcr.zzdx(Unknown Source:15)
E/JavaBinder( 4289): at com.google.firebase.auth.api.internal.zzen.zzen(Unknown Source:35)
E/JavaBinder( 4289): at com.google.firebase.auth.api.internal.zzen.zza(Unknown Source:41)
E/JavaBinder( 4289): at com.google.firebase.auth.api.internal.zzep.zza(Unknown Source:9)
E/JavaBinder( 4289): at com.google.firebase.auth.api.internal.zzdx.dispatchTransaction(Unknown Source:9)
E/JavaBinder( 4289): at com.google.android.gms.internal.firebase_auth.zza.onTransact(Unknown Source:13)
E/JavaBinder( 4289): at android.os.Binder.execTransact(Binder.java:731)
E/JavaBinder( 4289): Caused by: java.lang.ClassNotFoundException: Didn't find class "android.support.v4.util.ArrayMap" on path: DexPathList[[zip file "/data/app/com.example.smartmoney-X1P2O9i7a7t81s9vttyrlA==/base.apk"],nativeLibraryDirectories=[/data/app/com.example.smartmoney-X1P2O9i7a7t81s9vttyrlA==/lib/x86, /data/app/com.example.smartmoney-X1P2O9i7a7t81s9vttyrlA==/base.apk!/lib/x86, /system/lib]]
E/JavaBinder( 4289): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:134)
E/JavaBinder( 4289): at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
E/JavaBinder( 4289): at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
E/JavaBinder( 4289): ... 16 more
E/AndroidRuntime( 4289): FATAL EXCEPTION: Binder:4289_4
E/AndroidRuntime( 4289): Process: com.example.smartmoney, PID: 4289
E/AndroidRuntime( 4289): java.lang.NoClassDefFoundError: Failed resolution of: Landroid/support/v4/util/ArrayMap;
E/AndroidRuntime( 4289): at com.google.firebase.auth.internal.zzam.zzc(Unknown Source:22)
E/AndroidRuntime( 4289): at com.google.firebase.auth.internal.zzam.zzde(Unknown Source:17)
E/AndroidRuntime( 4289): at com.google.firebase.auth.internal.zzam.zzdd(Unknown Source:8)
E/AndroidRuntime( 4289): at com.google.firebase.auth.internal.zzan.zzdf(Unknown Source:1)
E/AndroidRuntime( 4289): at com.google.firebase.auth.internal.zzm.isAnonymous(Unknown Source:47)
E/AndroidRuntime( 4289): at com.google.firebase.auth.internal.zzat.zzi(Unknown Source:57)
E/AndroidRuntime( 4289): at com.google.firebase.auth.internal.zzat.zzg(Unknown Source:10)
E/AndroidRuntime( 4289): at com.google.firebase.auth.FirebaseAuth.zza(Unknown Source:62)
E/AndroidRuntime( 4289): at com.google.firebase.auth.FirebaseAuth$zzb.zza(Unknown Source:5)
E/AndroidRuntime( 4289): at com.google.firebase.auth.api.internal.zzcr.zzdx(Unknown Source:15)
E/AndroidRuntime( 4289): at com.google.firebase.auth.api.internal.zzen.zzen(Unknown Source:35)
E/AndroidRuntime( 4289): at com.google.firebase.auth.api.internal.zzen.zza(Unknown Source:41)
E/AndroidRuntime( 4289): at com.google.firebase.auth.api.internal.zzep.zza(Unknown Source:9)
E/AndroidRuntime( 4289): at com.google.firebase.auth.api.internal.zzdx.dispatchTransaction(Unknown Source:9)
E/AndroidRuntime( 4289): at com.google.android.gms.internal.firebase_auth.zza.onTransact(Unknown Source:13)
E/AndroidRuntime( 4289): at android.os.Binder.execTransact(Binder.java:731)
E/AndroidRuntime( 4289): Caused by: java.lang.ClassNotFoundException: Didn't find class "android.support.v4.util.ArrayMap" on path: DexPathList[[zip file "/data/app/com.example.smartmoney-X1P2O9i7a7t81s9vttyrlA==/base.apk"],nativeLibraryDirectories=[/data/app/com.example.smartmoney-X1P2O9i7a7t81s9vttyrlA==/lib/x86, /data/app/com.example.smartmoney-X1P2O9i7a7t81s9vttyrlA==/base.apk!/lib/x86, /system/lib]]
E/AndroidRuntime( 4289): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:134)
E/AndroidRuntime( 4289): at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
E/AndroidRuntime( 4289): at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
E/AndroidRuntime( 4289): ... 16 more
I/Process ( 4289): Sending signal. PID: 4289 SIG: 9
Lost connection to device.
Sorry about the error dump. I've been working on this error for many hours. Here is project level gradle:
buildscript {
repositories {
google()
jcenter()
maven {
url 'https://maven.fabric.io/public'
}
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
classpath 'com.google.gms:google-services:4.2.0'
classpath 'io.fabric.tools:gradle:1.31.0' // Crashlytics plugin
classpath 'com.google.firebase:perf-plugin:1.3.1' // Performance Monitoring plugin
}
}
allprojects {
repositories {
google()
jcenter()
}
}
rootProject.buildDir = '../build'
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(':app')
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Here's my app level gradle:
def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
localPropertiesFile.withReader('UTF-8') { reader ->
localProperties.load(reader)
}
}
def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
flutterVersionCode = '1'
}
def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
flutterVersionName = '1.0'
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
apply plugin: 'com.google.gms.google-services'
apply plugin: 'com.google.firebase.firebase-perf'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
android {
compileSdkVersion 28
lintOptions {
disable 'InvalidPackage'
}
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.example.smartmoney"
minSdkVersion 21
targetSdkVersion 28
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
// TODO: Add your own signing config for the release build.
// Signing with the debug keys for now, so `flutter run --release` works.
signingConfig signingConfigs.debug
}
}
}
flutter {
source '../..'
}
dependencies {
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'com.google.firebase:firebase-core:17.0.1' // Firebase core
implementation 'com.crashlytics.sdk.android:crashlytics:2.10.1' // Firebase crashlytics
implementation 'com.google.firebase:firebase-perf:18.0.1' // Firebase performance
//implementation 'com.firebaseui:firebase-ui-auth:4.3.1'
}
Here is my pubspec file:
name: smartmoney
description: A new Flutter project.
# The following defines the version and build number for your application.
# A version number is three numbers separated by dots, like 1.2.43
# followed by an optional build number separated by a +.
# Both the version and the builder number may be overridden in flutter
# build by specifying --build-name and --build-number, respectively.
# In Android, build-name is used as versionName while build-number used as versionCode.
# Read more about Android versioning at https://developer.android.com/studio/publish/versioning
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
# Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
version: 1.0.0+1
environment:
sdk: ">=2.1.0 <3.0.0"
dependencies:
flutter:
sdk: flutter
flutter_bloc: ^0.14.0
toast: ^0.1.5
charts_flutter: ^0.6.0
firebase_auth: ^0.14.0
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^0.1.2
dev_dependencies:
flutter_test:
sdk: flutter
# For information on the generic Dart part of this file, see the
# following page: https://www.dartlang.org/tools/pub/pubspec
# The following section is specific to Flutter.
flutter:
# The following line ensures that the Material Icons font is
# included with your application, so that you can use the icons in
# the material Icons class.
uses-material-design: true
# To add assets to your application, add an assets section, like this:
# assets:
# - images/a_dot_burr.jpeg
# - images/a_dot_ham.jpeg
# An image asset can refer to one or more resolution-specific "variants", see
# https://flutter.io/assets-and-images/#resolution-aware.
# For details regarding adding assets from package dependencies, see
# https://flutter.io/assets-and-images/#from-packages
# To add custom fonts to your application, add a fonts section here,
# in this "flutter" section. Each entry in this list should have a
# "family" key with the font family name, and a "fonts" key with a
# list giving the asset and other descriptors for the font. For
# example:
# fonts:
# - family: Schyler
# fonts:
# - asset: fonts/Schyler-Regular.ttf
# - asset: fonts/Schyler-Italic.ttf
# style: italic
# - family: Trajan Pro
# fonts:
# - asset: fonts/TrajanPro.ttf
# - asset: fonts/TrajanPro_Bold.ttf
# weight: 700
#
# For details regarding fonts from package dependencies,
# see https://flutter.io/custom-fonts/#from-packages
Any help is appreciated. I have no lead on this besides I guess there might be some sort of messes up Java library. Which makes little sense because I rebuilt my project and it still failed. So I'm more or less scratching my head on this.
Please add the following lines in your gradle.properties file. It worked for me.
android.useAndroidX = true
android.enableJetifier = true
Thanks
Related
I'm trying to follow a simple Flutter and Firebase tutorial that I found on YouTube. At the moment the app is just a simple login screen with a button that tries to sign the user in using the signInAnonymously function that Firebase provides.
However, every time I click the button to sign in the app crashes but, the new user is created and can be seen under authentication->users in the Firebase Console.
Here is the output from the debug console:
W/BiChannelGoogleApi( 2621): [FirebaseAuth: ] getGoogleApiForMethod() returned Gms: com.google.firebase.auth.api.internal.zzak#e0bea08
W/DynamiteModule( 2621): Local module descriptor class for com.google.firebase.auth not found.
I/FirebaseAuth( 2621): [FirebaseAuth:] Loading module via FirebaseOptions.
I/FirebaseAuth( 2621): [FirebaseAuth:] Preparing to create service connection to gms implementation
E/JavaBinder( 2621): *** Uncaught remote exception! (Exceptions are not yet supported across processes.)
E/JavaBinder( 2621): java.lang.NoClassDefFoundError: Failed resolution of: Landroid/support/v4/util/ArrayMap;
E/JavaBinder( 2621): at com.google.firebase.auth.internal.zzam.zzc(Unknown Source:22)
E/JavaBinder( 2621): at com.google.firebase.auth.internal.zzam.zzde(Unknown Source:17)
E/JavaBinder( 2621): at com.google.firebase.auth.internal.zzam.zzdd(Unknown Source:8)
E/JavaBinder( 2621): at com.google.firebase.auth.internal.zzan.zzdf(Unknown Source:1)
E/JavaBinder( 2621): at com.google.firebase.auth.internal.zzm.isAnonymous(Unknown Source:47)
E/JavaBinder( 2621): at com.google.firebase.auth.internal.zzat.zzi(Unknown Source:57)
E/JavaBinder( 2621): at com.google.firebase.auth.internal.zzat.zzg(Unknown Source:10)
E/JavaBinder( 2621): at com.google.firebase.auth.FirebaseAuth.zza(Unknown Source:62)
E/JavaBinder( 2621): at com.google.firebase.auth.FirebaseAuth$zzb.zza(Unknown Source:5)
E/JavaBinder( 2621): at com.google.firebase.auth.api.internal.zzcl.zzdx(Unknown Source:13)
E/JavaBinder( 2621): at com.google.firebase.auth.api.internal.zzen.zzen(Unknown Source:35)
E/JavaBinder( 2621): at com.google.firebase.auth.api.internal.zzen.zza(Unknown Source:41)
E/JavaBinder( 2621): at com.google.firebase.auth.api.internal.zzep.zza(Unknown Source:9)
E/JavaBinder( 2621): at com.google.firebase.auth.api.internal.zzdx.dispatchTransaction(Unknown Source:9)
E/JavaBinder( 2621): at com.google.android.gms.internal.firebase_auth.zza.onTransact(Unknown Source:13)
E/JavaBinder( 2621): at android.os.Binder.execTransact(Binder.java:731)
E/JavaBinder( 2621): Caused by: java.lang.ClassNotFoundException: Didn't find class "android.support.v4.util.ArrayMap" on path: DexPathList[[zip file "/data/app/com.teegeedigital.teegee_digital_app-uIKbQPsmHSCIvS-nf2ZtLQ==/base.apk"],nativeLibraryDirectories=[/data/app/com.teegeedigital.teegee_digital_app-uIKbQPsmHSCIvS-nf2ZtLQ==/lib/x86, /data/app/com.teegeedigital.teegee_digital_app-uIKbQPsmHSCIvS-nf2ZtLQ==/base.apk!/lib/x86, /system/lib]]
E/JavaBinder( 2621): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:134)
E/JavaBinder( 2621): at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
E/JavaBinder( 2621): at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
E/JavaBinder( 2621): ... 16 more
E/AndroidRuntime( 2621): FATAL EXCEPTION: Binder:2621_1
E/AndroidRuntime( 2621): Process: com.teegeedigital.teegee_digital_app, PID: 2621
E/AndroidRuntime( 2621): java.lang.NoClassDefFoundError: Failed resolution of: Landroid/support/v4/util/ArrayMap;
E/AndroidRuntime( 2621): at com.google.firebase.auth.internal.zzam.zzc(Unknown Source:22)
E/AndroidRuntime( 2621): at com.google.firebase.auth.internal.zzam.zzde(Unknown Source:17)
E/AndroidRuntime( 2621): at com.google.firebase.auth.internal.zzam.zzdd(Unknown Source:8)
E/AndroidRuntime( 2621): at com.google.firebase.auth.internal.zzan.zzdf(Unknown Source:1)
E/AndroidRuntime( 2621): at com.google.firebase.auth.internal.zzm.isAnonymous(Unknown Source:47)
E/AndroidRuntime( 2621): at com.google.firebase.auth.internal.zzat.zzi(Unknown Source:57)
E/AndroidRuntime( 2621): at com.google.firebase.auth.internal.zzat.zzg(Unknown Source:10)
E/AndroidRuntime( 2621): at com.google.firebase.auth.FirebaseAuth.zza(Unknown Source:62)
E/AndroidRuntime( 2621): at com.google.firebase.auth.FirebaseAuth$zzb.zza(Unknown Source:5)
E/AndroidRuntime( 2621): at com.google.firebase.auth.api.internal.zzcl.zzdx(Unknown Source:13)
E/AndroidRuntime( 2621): at com.google.firebase.auth.api.internal.zzen.zzen(Unknown Source:35)
E/AndroidRuntime( 2621): at com.google.firebase.auth.api.internal.zzen.zza(Unknown Source:41)
E/AndroidRuntime( 2621): at com.google.firebase.auth.api.internal.zzep.zza(Unknown Source:9)
E/AndroidRuntime( 2621): at com.google.firebase.auth.api.internal.zzdx.dispatchTransaction(Unknown Source:9)
E/AndroidRuntime( 2621): at com.google.android.gms.internal.firebase_auth.zza.onTransact(Unknown Source:13)
E/AndroidRuntime( 2621): at android.os.Binder.execTransact(Binder.java:731)
E/AndroidRuntime( 2621): Caused by: java.lang.ClassNotFoundException: Didn't find class "android.support.v4.util.ArrayMap" on path: DexPathList[[zip file "/data/app/com.teegeedigital.teegee_digital_app-uIKbQPsmHSCIvS-nf2ZtLQ==/base.apk"],nativeLibraryDirectories=[/data/app/com.teegeedigital.teegee_digital_app-uIKbQPsmHSCIvS-nf2ZtLQ==/lib/x86, /data/app/com.teegeedigital.teegee_digital_app-uIKbQPsmHSCIvS-nf2ZtLQ==/base.apk!/lib/x86, /system/lib]]
E/AndroidRuntime( 2621): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:134)
E/AndroidRuntime( 2621): at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
E/AndroidRuntime( 2621): at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
E/AndroidRuntime( 2621): ... 16 more
I/Process ( 2621): Sending signal. PID: 2621 SIG: 9
Lost connection to device.
Exited (sigterm)
I'll also include my project build.gradle below:
buildscript {
ext.kotlin_version = '1.2.71'
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.google.gms:google-services:4.0.1'
}
}
allprojects {
repositories {
google()
jcenter()
}
}
rootProject.buildDir = '../build'
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(':app')
}
task clean(type: Delete) {
delete rootProject.buildDir
}
and my android/app build.gradle file:
def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
localPropertiesFile.withReader('UTF-8') { reader ->
localProperties.load(reader)
}
}
def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
flutterVersionCode = '1'
}
def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
flutterVersionName = '1.0'
}
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
android {
compileSdkVersion 28
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}
lintOptions {
disable 'InvalidPackage'
}
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.teegeedigital.teegee_digital_app"
minSdkVersion 21
targetSdkVersion 28
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
// TODO: Add your own signing config for the release build.
// Signing with the debug keys for now, so `flutter run --release` works.
signingConfig signingConfigs.debug
}
}
}
flutter {
source '../..'
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'com.google.firebase:firebase-analytics:17.2.0'
implementation 'com.google.firebase:firebase-firestore:19.0.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}
apply plugin: 'com.google.gms.google-services'
I'm relatively new to Mobile App Development so please let me know if I should include anything else. Any help would be appreciated.
You need to migrate to androidx, you can do that by adding:
android.useAndroidX=true
android.enableJetifier=true
In the android/gradle.properties.
You can find more about migration to androidx in this flutter guide:
https://flutter.dev/docs/development/androidx-migration
As the user clicks the button he gets registered using firebase (create user) .After that the just stops and quits and does not navigate to an another page.The app stops in the debug and quits the debug mode.
i tried flutter clean and reinstalled the app on my phone and it worked. I am able to see the registered users in firestore but after authentication the app just quits.
It's not navigating to a new page -
onPressed: () async { try{ final newuser = await
_auth.createUserWithEmailAndPassword(email: email,password: password);
if(newuser!=null){ Navigator.pushNamed(context, ChatScreen.id); } }
catch(e){ print(e); }
I think the error is this - E/JavaBinder(13980): java.lang.NoClassDefFoundError: Failed resolution of: Landroid/support/v4/util/ArrayMap;
the output is this
iChannelGoogleApi(13980): [FirebaseAuth: ] getGoogleApiForMethod()
returned Gms: com.google.firebase.auth.api.internal.zzak#2e2943
E /JavaBinder(13980): *** Uncaught remote exception! (Exceptions are not
yet supported across processes.)
E/JavaBinder(13980): java.lang.NoClassDefFoundError: Failed resolution of: Landroid/support/v4/util/ArrayMap;
E/JavaBinder(13980): at com.google.firebase.auth.internal.zzam.zzc(Unknown Source:22)
E/JavaBinder(13980): at com.google.firebase.auth.internal.zzam.zzde(Unknown Source:17)
E/JavaBinder(13980): at com.google.firebase.auth.internal.zzam.zzdd(Unknown Source:8)
E/JavaBinder(13980): at com.google.firebase.auth.internal.zzan.zzdf(Unknown Source:1)
E/JavaBinder(13980): at com.google.firebase.auth.internal.zzm.isAnonymous(Unknown Source:47)
E/JavaBinder(13980): at com.google.firebase.auth.internal.zzat.zzi(Unknown Source:57)
E/JavaBinder(13980): at com.google.firebase.auth.internal.zzat.zzg(Unknown Source:10)
E/JavaBinder(13980): at com.google.firebase.auth.FirebaseAuth.zza(Unknown Source:62)
E/JavaBinder(13980): at com.google.firebase.auth.FirebaseAuth$zzb.zza(Unknown Source:5)
E/JavaBinder(13980): at com.google.firebase.auth.api.internal.zzax.zzdx(Unknown Source:15)
E/JavaBinder(13980): at com.google.firebase.auth.api.internal.zzen.zzen(Unknown Source:35)
E/JavaBinder(13980): at com.google.firebase.auth.api.internal.zzen.zza(Unknown Source:41)
E/JavaBinder(13980): at com.google.firebase.auth.api.internal.zzep.zza(Unknown Source:9)
E/JavaBinder(13980): at com.google.firebase.auth.api.internal.zzdx.dispatchTransaction(Unknown Source:9)
E/JavaBinder(13980): at com.google.android.gms.internal.firebase_auth.zza.onTransact(Unknown Source:13)
E/JavaBinder(13980): at android.os.Binder.execTransact(Binder.java:739)
E/JavaBinder(13980): Caused by: java.lang.ClassNotFoundException: Didn't find class "android.support.v4.util.ArrayMap" on path: DexPathList[[zip file "/data/app/com.example.flashchat-TZhJVKnl0Lsx4l6grV97yQ==/base.apk"],nativeLibraryDirectories=[/data/app/com.example.flashchat-TZhJVKnl0Lsx4l6grV97yQ==/lib/arm64, /data/app/com.example.flashchat-TZhJVKnl0Lsx4l6grV97yQ==/base.apk!/lib/arm64-v8a, /system/lib64]]
E/JavaBinder(13980): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:134)
E/JavaBinder(13980): at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
E/JavaBinder(13980): at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
E/JavaBinder(13980): ... 16 more
E/AndroidRuntime(13980): FATAL EXCEPTION: Binder:13980_4
E/AndroidRuntime(13980): Process: com.example.flashchat, PID: 13980
E/AndroidRuntime(13980): java.lang.NoClassDefFoundError: Failed resolution of: Landroid/support/v4/util/ArrayMap;
E/AndroidRuntime(13980): at com.google.firebase.auth.internal.zzam.zzc(Unknown Source:22)
E/AndroidRuntime(13980): at com.google.firebase.auth.internal.zzam.zzde(Unknown Source:17)
E/AndroidRuntime(13980): at com.google.firebase.auth.internal.zzam.zzdd(Unknown Source:8)
E/AndroidRuntime(13980): at com.google.firebase.auth.internal.zzan.zzdf(Unknown Source:1)
E/AndroidRuntime(13980): at com.google.firebase.auth.internal.zzm.isAnonymous(Unknown Source:47)
E/AndroidRuntime(13980): at com.google.firebase.auth.internal.zzat.zzi(Unknown Source:57)
E/AndroidRuntime(13980): at com.google.firebase.auth.internal.zzat.zzg(Unknown Source:10)
E/AndroidRuntime(13980): at com.google.firebase.auth.FirebaseAuth.zza(Unknown Source:62)
E/AndroidRuntime(13980): at com.google.firebase.auth.FirebaseAuth$zzb.zza(Unknown Source:5)
E/AndroidRuntime(13980): at com.google.firebase.auth.api.internal.zzax.zzdx(Unknown Source:15)
E/AndroidRuntime(13980): at com.google.firebase.auth.api.internal.zzen.zzen(Unknown Source:35)
E/AndroidRuntime(13980): at com.google.firebase.auth.api.internal.zzen.zza(Unknown Source:41)
E/AndroidRuntime(13980): at com.google.firebase.auth.api.internal.zzep.zza(Unknown Source:9)
E/AndroidRuntime(13980): at com.google.firebase.auth.api.internal.zzdx.dispatchTransaction(Unknown Source:9)
E/AndroidRuntime(13980): at com.google.android.gms.internal.firebase_auth.zza.onTransact(Unknown Source:13)
E/AndroidRuntime(13980): at android.os.Binder.execTransact(Binder.java:739)
E/AndroidRuntime(13980): Caused by: java.lang.ClassNotFoundException: Didn't find class "android.support.v4.util.ArrayMap" on path: DexPathList[[zip file "/data/app/com.example.flashchat-TZhJVKnl0Lsx4l6grV97yQ==/base.apk"],nativeLibraryDirectories=[/data/app/com.example.flashchat-TZhJVKnl0Lsx4l6grV97yQ==/lib/arm64, /data/app/com.example.flashchat-TZhJVKnl0Lsx4l6grV97yQ==/base.apk!/lib/arm64-v8a, /system/lib64]]
E/AndroidRuntime(13980): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:134)
E/AndroidRuntime(13980): at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
E/AndroidRuntime(13980): at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
E/AndroidRuntime(13980): ... 16 more
Lost connection to device.
D/ViewRootImpl#3554d48MainActivity: MSG_WINDOW_FOCUS_CHANGED 0 1
D/InputMethodManager(13980): prepareNavigationBarInfo() DecorView#7f76e56[MainActivity]
D/InputMethodManager(13980): getNavigationBarColor() -855310
I/Process (13980): Sending signal. PID: 13980 SIG: 9
E/JavaBinder(13980): java.lang.NoClassDefFoundError: Failed resolution of: Landroid/support/v4/util/ArrayMap;
I guess that the ChatScreen.id is the route name.
Try to Navigate like this
Navigator.of(context).push(
MaterialPageRoute(builder: (context) => ChatScreen()),
);
If it works check again how to use the named route for navigation.
What's the error in your debug console?
Flutter App crashes when executing firebase auth function signInWithEmailAndPassword
I suggest the problem has someting to do with incompatible versions. But with lower versions, we have a problem with androidx.
Future<String> signInWithEmailAndPassword(String email, String password)async{
FirebaseUser user = (await _firebaseAuth.signInWithEmailAndPassword(email: email, password: password)).user; //Here it crashes
return user.uid;
}
The dependencies in pubspec.yaml:
dependencies:
flutter:
sdk: flutter
cloud_firestore: any
firebase_auth: 0.14.0+5
My dependencies in project level .gradle:
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
classpath 'com.google.gms:google-services:4.2.0'
}
In app level .gradle
defaultConfig {
applicationId "com.example.testtool"
minSdkVersion 16
targetSdkVersion 28
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true
}
and the dependencies (also in app level .gradle):
dependencies {
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'com.google.firebase:firebase-analytics:17.0.1'
implementation 'androidx.multidex:multidex:2.0.1'
}
apply plugin: 'com.google.gms.google-services'
And this is the error:
I/flutter (25442): Another exception was thrown: NoSuchMethodError: The getter 'position' was called on null.
I/chatty (25442): uid=10234(com.example.testtool) 2.ui identical 8 lines
I/flutter (25442): Another exception was thrown: NoSuchMethodError: The getter 'position' was called on null.
W/BiChannelGoogleApi(25442): [FirebaseAuth: ] getGoogleApiForMethod() returned Gms: com.google.firebase.auth.api.internal.zzak#98a1ffc
E/JavaBinder(25442): *** Uncaught remote exception! (Exceptions are not yet supported across processes.)
E/JavaBinder(25442): java.lang.NoClassDefFoundError: Failed resolution of: Landroid/support/v4/util/ArrayMap;
E/JavaBinder(25442): at com.google.firebase.auth.internal.zzam.zzc(Unknown Source:22)
E/JavaBinder(25442): at com.google.firebase.auth.internal.zzam.zzde(Unknown Source:17)
E/JavaBinder(25442): at com.google.firebase.auth.internal.zzam.zzdd(Unknown Source:8)
E/JavaBinder(25442): at com.google.firebase.auth.internal.zzan.zzdf(Unknown Source:1)
E/JavaBinder(25442): at com.google.firebase.auth.internal.zzm.isAnonymous(Unknown Source:47)
E/JavaBinder(25442): at com.google.firebase.auth.api.internal.zzep.zza(Unknown Source:9)
E/JavaBinder(25442): at com.google.firebase.auth.api.internal.zzdx.dispatchTransaction(Unknown Source:9)
E/JavaBinder(25442): at com.google.android.gms.internal.firebase_auth.zza.onTransact(Unknown Source:13)
E/JavaBinder(25442): at android.os.Binder.execTransact(Binder.java:731)
E/JavaBinder(25442): Caused by: java.lang.ClassNotFoundException: Didn't find class "android.support.v4.util.ArrayMap" on path: DexPathList[[zip file "/data/app/com.example.testtool-H8ql3WqJ13OCb4aCfdLNsQ==/base.apk"],nativeLibraryDirectories=[/data/app/com.example.testtool-H8ql3WqJ13OCb4aCfdLNsQ==/lib/arm64, /data/app/com.example.testtool-H8ql3WqJ13OCb4aCfdLNsQ==/base.apk!/lib/arm64-v8a, /system/lib64]]
E/JavaBinder(25442): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:134)
E/JavaBinder(25442): at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
E/JavaBinder(25442): at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
E/JavaBinder(25442): ... 16 more
E/AndroidRuntime(25442): FATAL EXCEPTION: Binder:25442_2
E/AndroidRuntime(25442): at com.google.firebase.auth.internal.zzat.zzi(Unknown Source:57)
E/AndroidRuntime(25442): at com.google.firebase.auth.internal.zzat.zzg(Unknown Source:10)
E/AndroidRuntime(25442): at com.google.firebase.auth.FirebaseAuth.zza(Unknown Source:62)
E/AndroidRuntime(25442): at com.google.firebase.auth.FirebaseAuth$zzb.zza(Unknown Source:5)
E/AndroidRuntime(25442): at com.google.firebase.auth.api.internal.zzcr.zzdx(Unknown Source:15)
E/AndroidRuntime(25442): at com.google.firebase.auth.api.internal.zzen.zzen(Unknown Source:35)
E/AndroidRuntime(25442): at com.google.firebase.auth.api.internal.zzen.zza(Unknown Source:41)
E/AndroidRuntime(25442): at com.google.firebase.auth.api.internal.zzep.zza(Unknown Source:9)
E/AndroidRuntime(25442): at com.google.firebase.auth.api.internal.zzdx.dispatchTransaction(Unknown Source:9)
E/AndroidRuntime(25442): at com.google.android.gms.internal.firebase_auth.zza.onTransact(Unknown Source:13)
E/AndroidRuntime(25442): at android.os.Binder.execTransact(Binder.java:731)
E/AndroidRuntime(25442): Caused by: java.lang.ClassNotFoundException: Didn't find class "android.support.v4.util.ArrayMap" on path: DexPathList[[zip file "/data/app/com.example.testtool-H8ql3WqJ13OCb4aCfdLNsQ==/base.apk"],nativeLibraryDirectories=[/data/app/com.example.testtool-H8ql3WqJ13OCb4aCfdLNsQ==/lib/arm64, /data/app/com.example.testtool-H8ql3WqJ13OCb4aCfdLNsQ==/base.apk!/lib/arm64-v8a, /system/lib64]]
E/AndroidRuntime(25442): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:134)
E/AndroidRuntime(25442): at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
E/AndroidRuntime(25442): at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
E/AndroidRuntime(25442): ... 16 more
I/Process (25442): Sending signal. PID: 25442 SIG: 9
Lost connection to device.
The problem was an incompability with androidx. If something similar happens to you, try to migrate your project to androidx https://flutter.dev/docs/development/packages-and-plugins/androidx-compatibility
Is your google-services.json file in your project?
i am new in android. i am currently working in android app and when i try to run the app this error occurs.
Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'.
com.android.build.api.transform.TransformException: java.util.zip.ZipException:
duplicate entry: com/google/android/gms/internal/zzaso.class
build.gradle(app level)
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
defaultConfig {
applicationId "com.drag.screenart"
minSdkVersion 19
targetSdkVersion 25
versionCode 1
versionName "1.0"
multiDexEnabled true
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
dexOptions {
javaMaxHeapSize "4g"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:multidex:1.0.1'
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.android.support:support-v4:25.3.1'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.makeramen:roundedimageview:2.3.0'
compile 'com.mcxiaoke.volley:library:1.0.19'
compile 'com.facebook.android:account-kit-sdk:4.+'
compile 'com.facebook.android:facebook-android-sdk:4.+'
compile 'com.google.firebase:firebase-messaging:10.0.1'
testCompile 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'
Thanks in advance.
This question already has answers here:
Failed to resolve: com.google.firebase:firebase-core:11.2.0
(6 answers)
Closed 5 years ago.
I recently updated Android studio from 2.1 to 2.3.3 on Ubuntu 17.04. Additionally, I had to update my android.support dependencies from version 25.0.0 to 26.0.1 and my firebase dependencies from 9.6.1 to 11.2.0. I have tried everything on SO to no avail, including completely re-imaging ubuntu. All google/firebase dependencies still fail to resolve so It must be an error on my side. Below are my gradle files.
Module build.gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion "26.0.1"
defaultConfig {
applicationId "me.myapp.app"
minSdkVersion 15
targetSdkVersion 26
versionCode 10
versionName "0.10.1"
}
buildTypes {
release {
shrinkResources true
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'),
'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:26.0.1'
compile 'com.android.support:support-v4:26.0.1'
compile 'com.android.support:design:26.0.1'
compile 'com.google.firebase:firebase-core:11.2.0'
compile 'com.google.firebase:firebase-database:11.2.0'
compile 'com.google.firebase:firebase-auth:11.2.0'
compile 'com.google.firebase:firebase-crash:11.2.0'
compile 'com.google.firebase:firebase-storage:11.2.0'
compile 'com.google.firebase:firebase-messaging:11.2.0'
compile 'com.facebook.android:facebook-android-sdk:[4,5)'
compile 'com.github.amlcurran.showcaseview:library:5.4.3'
}
apply plugin: 'com.google.gms.google-services'
Project build.gradle
buildscript {
repositories {
jcenter()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
classpath 'com.google.gms:google-services:3.1.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
try to add
maven {
url "https://maven.google.com"
}
after jcenter() like below
allprojects {
repositories {
jcenter()
maven {
url "https://maven.google.com"
}
}
}