So I am new to flutter and firebase and I wanted to add firestore capabilities to my app, but when I tried to use firestore I got an error
The plugin cloud_firestore requires a higher Android SDK version. │ │ Fix this issue by adding the following to the file │ │ C:\Users\Jaff\StudioProjects\priv_chat\android\app\build.gradle:
After fixing the SDK version, then I got another error,
C:\src\flutter.pub-cache\hosted\pub.dartlang.org\cloud_firestore-3.4.0\android\src\main\java\io\flutter\plugins\firebase\firestore\streamhandler\TransactionStreamHandler.java:13: error: cannot find symbol import com.google.firebase.firestore.TransactionOptions; symbol: class TransactionOptions location: package com.google.firebase.firestore C:\src\flutter.pub-cache\hosted\pub.dartlang.org\cloud_firestore-3.4.0\android\src\main\java\io\flutter\plugins\firebase\firestore\streamhandler\TransactionStreamHandler.java:66: error: package TransactionOptions does not exist new TransactionOptions.Builder().setMaxAttempts(maxAttempts).build(),
- What went wrong: Execution failed for task ':cloud_firestore:compileDebugJavaWithJavac'.
Compilation failed; see the compiler error output for details.
This is where I got completely confused, I have no idea how to solve this, can somebody help me?
CodePudding user response:
I had the same issue and noticed, that my firebase_core
dependency in pubspec.yaml was not updated.
Now I use firebase_core: ^1.20.0
and it works