Ja'afar Zakariya
Ja'afar Zakariya

Reputation: 135

how do I fix my flutter app not building with cloud firestore?

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(),

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?

Upvotes: 4

Views: 2137

Answers (1)

AndrewSheetMetal
AndrewSheetMetal

Reputation: 176

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 šŸ‘

Do not forget to run flutter clean.

Hope that helps :)

Upvotes: 16

Related Questions