Code Monkey home page Code Monkey logo

Comments (35)

NoamDev avatar NoamDev commented on May 12, 2024 19

Hey @erluxman, try changing classpath 'com.google.gms:google-services:4.3.0'
in your project gradle.build to classpath 'com.google.gms:google-services:3.2.1'

let me know if it worked for you

from flutterfire.

hridoy100 avatar hridoy100 commented on May 12, 2024 16

worked for me after adding these lines....

  1. Inside app folder in file build.gradle
  • add 'multiDexEnabled true' inside 'defaultConfig'
defaultConfig {
    multiDexEnabled true
}
  • Then,
dependencies {
    implementation 'com.google.firebase:firebase-analytics:17.2.0'
    implementation 'com.google.firebase:firebase-firestore:19.0.0'
    implementation 'com.android.support:multidex:1.0.3'
}
  1. The main problem arises with dependency version added in the build.gradle file located outside of app folder...Generally firebase tells to add dependency like this:
dependencies {
        classpath 'com.google.gms:google-services:4.3.2'
    }

but the conflict is with the version 4.3.2 as the line before it in my project is
classpath 'com.android.tools.build:gradle:3.2.1'
So, it conflicts with this tools version.

  • So, change it to this:
dependencies {
        classpath 'com.google.gms:google-services:3.2.1'
    }
  1. If you're using android X, don't forget to add the following lines in gradle.properties file..
android.useAndroidX=true
android.enableJetifier=true

Now, I hope your project will run.

from flutterfire.

lakwsh01 avatar lakwsh01 commented on May 12, 2024 7

With same problem when import firebase_database
classpath 'com.android.tools.build:gradle:3.2.1'
classpath com.google.gms:google-services:3.2.1

and in
gradle.properties add
android.useAndroidX=true
android.enableJetifier=true

Seems everything goes to normal.

from flutterfire.

ArtfulDodgerB92 avatar ArtfulDodgerB92 commented on May 12, 2024 5

For me the issue with this error, and why it is so difficult to find a solution for it is that it is wrong. It took me weeks to resolve this issue because the error has absolutely 0 to do with firebase being incompatible with androidx and everything to do with my key file (your .jks file). For me, the file path was incorrect, and correcting this made everything work again like magic.

It is likely that if you are tearing your hair out over this issue, that this is not even an issue. Have a look at your key store file and make sure everything is correct with it. If the app runs perfectly fine, but will not build, there are only two files involved that are different. Your google-services.json and your keystore file.

Absolutely terrible error reporting.

from flutterfire.

wa11breaker avatar wa11breaker commented on May 12, 2024 3

Try changing the minimum target SDK version from v16 to v21.

from flutterfire.

idurvesh avatar idurvesh commented on May 12, 2024 1

I am facing it as well. It stops recognizing the GradleException inside of a build.gradle

from flutterfire.

erluxman avatar erluxman commented on May 12, 2024 1

Hey @erluxman, try changing classpath 'com.google.gms:google-services:4.3.0'
in your project gradle.build to classpath 'com.google.gms:google-services:3.2.1'

let me know if it worked for you

Did not work

from flutterfire.

NoamDev avatar NoamDev commented on May 12, 2024 1

Yeah, I wasn't sure it'll work.
I have another idea, try to add in the end of depndencies(){}
those two lines

implementation 'firebase-core:16.0.9'
implementation 'com.google.firebase:firebase-firestore:19.0.0'

from flutterfire.

NoamDev avatar NoamDev commented on May 12, 2024 1

@erluxman
I'm sorry, my mistake, could you try this instead?
If it doesn't work, could publish the new android build log so I can know if the problem was partially solved?

implementation 'com.google.firebase:firebase-core:16.0.9'
implementation 'com.google.firebase:firebase-firestore:19.0.0'

from flutterfire.

satsin06 avatar satsin06 commented on May 12, 2024 1

Hey @erluxman, try changing classpath 'com.google.gms:google-services:4.3.0'
in your project gradle.build to classpath 'com.google.gms:google-services:3.2.1'

let me know if it worked for you
Still not working

from flutterfire.

erluxman avatar erluxman commented on May 12, 2024 1

It's all hit and trial until now, no real solution...

from flutterfire.

alinabel avatar alinabel commented on May 12, 2024 1

any updates here ? i have same problem nothing of above works

edit: i search more and find sul down

from flutterfire.

alinabel avatar alinabel commented on May 12, 2024 1

im find sulution work with me try goto android/setting.gradle on realy top add this tow liens

include ':library'
include ':app'

from flutterfire.

Shivanshi1706 avatar Shivanshi1706 commented on May 12, 2024 1

It's all hit and trial until now, no real solution...

I have spent 3 days with 0 output

from flutterfire.

Salakar avatar Salakar commented on May 12, 2024 1

Hey πŸ‘‹

Our rework of the the FlutterFire plugins to depend on a shared 'core' (which controls the versions of the Firebase SDKs used on Android) as part of the FlutterFire roadmap was published over a week ago with a ton of fixes and new features.

Please could you try the new versions and see if this is still an issue? Additionally the documentation site now covers Android installation, https://firebase.flutter.dev

If this is still an issue then please submit a new up to date GitHub issue.

For help migrating to the new plugins please see the new migration guide: https://firebase.flutter.dev/docs/migration

from flutterfire.

arudp avatar arudp commented on May 12, 2024

Same here, when trying to actually run (not build, it does actually build) the _firebaseAuth.signInWithCustomToken(token: token) method, it goes like this:

W/BiChannelGoogleApi(19269): [FirebaseAuth: ] getGoogleApiForMethod() returned Gms: com.google.firebase.auth.api.internal.zzak@826aa86
E/JavaBinder(19269): *** Uncaught remote exception!  (Exceptions are not yet supported across processes.)
E/JavaBinder(19269): java.lang.NoClassDefFoundError: Failed resolution of: Landroid/support/v4/util/ArrayMap;
E/JavaBinder(19269): 	at com.google.firebase.auth.internal.zzam.zzc(Unknown Source:22)
E/JavaBinder(19269): 	at com.google.firebase.auth.internal.zzam.zzde(Unknown Source:17)
E/JavaBinder(19269): 	at com.google.firebase.auth.internal.zzam.zzdd(Unknown Source:8)
E/JavaBinder(19269): 	at com.google.firebase.auth.internal.zzan.zzdf(Unknown Source:1)
E/JavaBinder(19269): 	at com.google.firebase.auth.internal.zzm.isAnonymous(Unknown Source:47)
E/JavaBinder(19269): 	at com.google.firebase.auth.internal.zzat.zzi(Unknown Source:57)
E/JavaBinder(19269): 	at com.google.firebase.auth.internal.zzat.zzg(Unknown Source:10)
E/JavaBinder(19269): 	at com.google.firebase.auth.FirebaseAuth.zza(Unknown Source:62)
E/JavaBinder(19269): 	at com.google.firebase.auth.FirebaseAuth$zzb.zza(Unknown Source:5)
E/JavaBinder(19269): 	at com.google.firebase.auth.api.internal.zzcp.zzdx(Unknown Source:14)
E/JavaBinder(19269): 	at com.google.firebase.auth.api.internal.zzen.zzen(Unknown Source:35)
E/JavaBinder(19269): 	at com.google.firebase.auth.api.internal.zzen.zza(Unknown Source:41)
E/JavaBinder(19269): 	at com.google.firebase.auth.api.internal.zzep.zza(Unknown Source:9)
E/JavaBinder(19269): 	at com.google.firebase.auth.api.internal.zzdx.dispatchTransaction(Unknown Source:9)
E/JavaBinder(19269): 	at com.google.android.gms.internal.firebase_auth.zza.onTransact(Unknown Source:13)
E/JavaBinder(19269): 	at android.os.Binder.execTransactInternal(Binder.java:1021)
E/JavaBinder(19269): 	at android.os.Binder.execTransact(Binder.java:994)
E/JavaBinder(19269): Caused by: java.lang.ClassNotFoundException: Didn't find class "android.support.v4.util.ArrayMap" on path: DexPathList[[zip file "/data/app/com.app.myproject-NarLETRcOMNLCL2bBLZTdg==/base.apk"],nativeLibraryDirectories=[/data/app/com.app.myproject-NarLETRcOMNLCL2bBLZTdg==/lib/arm64, /data/app/com.app.myproject-NarLETRcOMNLCL2bBLZTdg==/base.apk!/lib/arm64-v8a, /system/lib64, /system/product/lib64]]
E/JavaBinder(19269): 	at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:196)
E/JavaBinder(19269): 	at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
E/JavaBinder(19269): 	at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
E/JavaBinder(19269): 	... 17 more
E/AndroidRuntime(19269): FATAL EXCEPTION: Binder:19269_2
E/AndroidRuntime(19269): Process: com.app.myproject, PID: 19269
E/AndroidRuntime(19269): java.lang.NoClassDefFoundError: Failed resolution of: Landroid/support/v4/util/ArrayMap;
E/AndroidRuntime(19269): 	at com.google.firebase.auth.internal.zzam.zzc(Unknown Source:22)
E/AndroidRuntime(19269): 	at com.google.firebase.auth.internal.zzam.zzde(Unknown Source:17)
E/AndroidRuntime(19269): 	at com.google.firebase.auth.internal.zzam.zzdd(Unknown Source:8)
E/AndroidRuntime(19269): 	at com.google.firebase.auth.internal.zzan.zzdf(Unknown Source:1)
E/AndroidRuntime(19269): 	at com.google.firebase.auth.internal.zzm.isAnonymous(Unknown Source:47)
E/AndroidRuntime(19269): 	at com.google.firebase.auth.internal.zzat.zzi(Unknown Source:57)
E/AndroidRuntime(19269): 	at com.google.firebase.auth.internal.zzat.zzg(Unknown Source:10)
E/AndroidRuntime(19269): 	at com.google.firebase.auth.FirebaseAuth.zza(Unknown Source:62)
E/AndroidRuntime(19269): 	at com.google.firebase.auth.FirebaseAuth$zzb.zza(Unknown Source:5)
E/AndroidRuntime(19269): 	at com.google.firebase.auth.api.internal.zzcp.zzdx(Unknown Source:14)
E/AndroidRuntime(19269): 	at com.google.firebase.auth.api.internal.zzen.zzen(Unknown Source:35)
E/AndroidRuntime(19269): 	at com.google.firebase.auth.api.internal.zzen.zza(Unknown Source:41)
E/AndroidRuntime(19269): 	at com.google.firebase.auth.api.internal.zzep.zza(Unknown Source:9)
E/AndroidRuntime(19269): 	at com.google.firebase.auth.api.internal.zzdx.dispatchTransaction(Unknown Source:9)
E/AndroidRuntime(19269): 	at com.google.android.gms.internal.firebase_auth.zza.onTransact(Unknown Source:13)
E/AndroidRuntime(19269): 	at android.os.Binder.execTransactInternal(Binder.java:1021)
E/AndroidRuntime(19269): 	at android.os.Binder.execTransact(Binder.java:994)
E/AndroidRuntime(19269): Caused by: java.lang.ClassNotFoundException: Didn't find class "android.support.v4.util.ArrayMap" on path: DexPathList[[zip file "/data/app/com.app.myproject-NarLETRcOMNLCL2bBLZTdg==/base.apk"],nativeLibraryDirectories=[/data/app/com.app.myproject-NarLETRcOMNLCL2bBLZTdg==/lib/arm64, /data/app/com.app.myproject-NarLETRcOMNLCL2bBLZTdg==/base.apk!/lib/arm64-v8a, /system/lib64, /system/product/lib64]]
E/AndroidRuntime(19269): 	at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:196)
E/AndroidRuntime(19269): 	at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
E/AndroidRuntime(19269): 	at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
E/AndroidRuntime(19269): 	... 17 more
I/Process (19269): Sending signal. PID: 19269 SIG: 9
Lost connection to device.

On the other hand I can't even manage to build in iOS:

Xcode build done.                                           24.1s
Failed to build iOS app
Error output from Xcode build:
↳
    ** BUILD FAILED **
Xcode's output:
↳
    /Users/aru/workspace/beyla/beylastaff/beylastaff/ios/Runner/GeneratedPluginRegistrant.m:6:9: fatal error: 'cloud_firestore/CloudFirestorePlugin.h' file not found
    #import <cloud_firestore/CloudFirestorePlugin.h>
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    1 error generated.

from flutterfire.

 avatar commented on May 12, 2024

I had a similar error. Adding this at the bottom of android/app/build.gradle solved the problem temporarily for me, maybe it will work for you too:

apply plugin: 'com.google.gms.google-services'
com.google.gms.googleservices.GoogleServicesPlugin.config.disableVersionCheck = true

from flutterfire.

erluxman avatar erluxman commented on May 12, 2024

I had a similar error. Adding this at the bottom of android/app/build.gradle solved the problem temporarily for me, maybe it will work for you too:

apply plugin: 'com.google.gms.google-services'
com.google.gms.googleservices.GoogleServicesPlugin.config.disableVersionCheck = true

I tried that but I get this error
A problem occurred evaluating project ':app'.

No such property: config for class: com.google.gms.googleservices.GoogleServicesPlugin

from flutterfire.

erluxman avatar erluxman commented on May 12, 2024

Yeah, I wasn't sure it'll work.
I have another idea, try to add in the end of depndencies(){}
those two lines

implementation 'firebase-core:16.0.9'
implementation 'com.google.firebase:firebase-firestore:19.0.0'

Did not help :(

from flutterfire.

Babiosik avatar Babiosik commented on May 12, 2024

I have similar problem with firebase_auth. On line
await _auth.signInWithCredential(credential)
app crashed with error java.lang.IllegalArgumentException: Unsupported value: null

from flutterfire.

samdx avatar samdx commented on May 12, 2024

Hey @erluxman, try changing classpath 'com.google.gms:google-services:4.3.0'
in your project gradle.build to classpath 'com.google.gms:google-services:3.2.1'

let me know if it worked for you

Cloned an old repo, and this really helped.

from flutterfire.

iapicca avatar iapicca commented on May 12, 2024

Hi @erluxman
did the proposed solution fix the issue?
If didn't and you are still experiencing this issue
with the latest version of Flutter and FlutterFire plugin
can you please provide your updated flutter doctor -v
and your and your flutter run --verbose/flutter build --verbose ?
Also, to better address the issue, would be helpful
if you could post a self contained app on github
or the steps to reproduce it.
Thank you

from flutterfire.

iapicca avatar iapicca commented on May 12, 2024

Hi @erluxman
does the proposed solution fix the issue?

from flutterfire.

erluxman avatar erluxman commented on May 12, 2024

That solution fixed my issue even without having to put manual dependencies to app.gradle file.

Thanks a lot.

from flutterfire.

as1ndu avatar as1ndu commented on May 12, 2024

For me the issue with this error, and why it is so difficult to find a solution for it is that it is wrong. It took me weeks to resolve this issue because the error has absolutely 0 to do with firebase being incompatible with androidx and everything to do with my key file (your .jks file). For me, the file path was incorrect, and correcting this made everything work again like magic.

It is likely that if you are tearing your hair out over this issue, that this is not even an issue. Have a look at your key store file and make sure everything is correct with it. If the app runs perfectly fine, but will not build, there are only two files involved that are different. Your google-services.json and your keystore file.

Absolutely terrible error reporting.

I share your sentiment <3

from flutterfire.

iapicca avatar iapicca commented on May 12, 2024

Hi all
are you still experiencing the issue with the latest stable version of flutter
and the latest version of firebase?
thank you

from flutterfire.

ahtishamansari avatar ahtishamansari commented on May 12, 2024

i have same issue

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':cloud_firestore:javaPreCompileDebug'.

Could not resolve all files for configuration ':cloud_firestore:debugCompileClasspath'.
Failed to transform artifact 'firebase-auth-interop.aar (com.google.firebase:firebase-auth-interop:18.0.0)' to match attributes {artifactType=android-classes, org.gradle.usage=java-api}.
> Execution failed for AarToClassTransform: C:\Users\ahtisham.gradle\caches\transforms-2\files-2.1\0184456ab8db2ccbb1ff88e00c2a36f8\jetified-firebase-auth-interop-18.0.0.aar.
> error in opening zip file

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org

BUILD FAILED in 17m 27s
Finished with error: Gradle task assembleDebug failed with exit code 1

from flutterfire.

ginuxone avatar ginuxone commented on May 12, 2024

any news on this?

from flutterfire.

DBSumation avatar DBSumation commented on May 12, 2024

Got the same issue:

dependencies {
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    classpath 'com.android.tools.build:gradle:3.3.2'
    classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
    classpath 'com.google.gms:google-services:3.2.1'

}

Running Gradle task 'assembleDebug'...

FAILURE: Build failed with an exception.

  • Where:
    Build file '/Users/ed/AndroidStudioProjects/flutter_app/android/app/build.gradle' line: 66

  • What went wrong:
    A problem occurred evaluating project ':app'.

Could not find method classpath() for arguments [com.android.tools.build:gradle:3.3.2] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

from flutterfire.

dhikshith12 avatar dhikshith12 commented on May 12, 2024

@erluxman
I'm sorry, my mistake, could you try this instead?
If it doesn't work, could publish the new android build log so I can know if the problem was partially solved?

implementation 'com.google.firebase:firebase-core:16.0.9'
implementation 'com.google.firebase:firebase-firestore:19.0.0'

i have same issue i didnt help

from flutterfire.

dhikshith12 avatar dhikshith12 commented on May 12, 2024

Got the same issue:

dependencies {
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    classpath 'com.android.tools.build:gradle:3.3.2'
    classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
    classpath 'com.google.gms:google-services:3.2.1'

}

Running Gradle task 'assembleDebug'...

FAILURE: Build failed with an exception.

  • Where:
    Build file '/Users/ed/AndroidStudioProjects/flutter_app/android/app/build.gradle' line: 66
  • What went wrong:
    A problem occurred evaluating project ':app'.

Could not find method classpath() for arguments [com.android.tools.build:gradle:3.3.2] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

same problem bro

from flutterfire.

as1ndu avatar as1ndu commented on May 12, 2024

My advice is to switch to https://appwrite.io/

from flutterfire.

dhikshith12 avatar dhikshith12 commented on May 12, 2024

It's all hit and trial until now, no real solution...

i've wasted so much of my timeπŸ˜₯

from flutterfire.

erluxman avatar erluxman commented on May 12, 2024

yea me too

from flutterfire.

naveen6768 avatar naveen6768 commented on May 12, 2024

me too

from flutterfire.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.