Home:ALL Converter>Build failed trying to follow Firebase for Flutter tutorial (Android Studio)

Build failed trying to follow Firebase for Flutter tutorial (Android Studio)

Ask Time:2020-01-12T08:48:50         Author:robert00

Json Formatter

New to mobile app dev, I am attempting to follow this Firebase for Flutter tutorial: https://codelabs.developers.google.com/codelabs/flutter-firebase/#4

Importing the firestore package per the very first line in main.dart is presumably what is causing the following result when I try to run it. Am I not following the tutorial correctly?? My code looks exactly as in the tutorial. I copied & pasted.

This is with Android Studio 3.5.3.

Launching lib\main.dart on Android SDK built for x86 in debug mode...
Running Gradle task 'assembleDebug'...
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
C:\Users\rober\OneDrive\Documents\flutter\.pub-cache\hosted\pub.dartlang.org\cloud_firestore-0.7.4\android\src\main\java\io\flutter\plugins\firebase\cloudfirestore\CloudFirestorePlugin.java:8: error: package android.support.annotation does not exist
import android.support.annotation.NonNull;
                                 ^
C:\Users\rober\OneDrive\Documents\flutter\.pub-cache\hosted\pub.dartlang.org\cloud_firestore-0.7.4\android\src\main\java\io\flutter\plugins\firebase\cloudfirestore\CloudFirestorePlugin.java:9: error: package android.support.annotation does not exist
import android.support.annotation.Nullable;
                                 ^
C:\Users\rober\OneDrive\Documents\flutter\.pub-cache\hosted\pub.dartlang.org\cloud_firestore-0.7.4\android\src\main\java\io\flutter\plugins\firebase\cloudfirestore\CloudFirestorePlugin.java:248: error: cannot find symbol
          public void onFailure(@NonNull Exception e) {
                                 ^
  symbol: class NonNull
C:\Users\rober\OneDrive\Documents\flutter\.pub-cache\hosted\pub.dartlang.org\cloud_firestore-0.7.4\android\src\main\java\io\flutter\plugins\firebase\cloudfirestore\CloudFirestorePlugin.java:269: error: cannot find symbol
                    public Void apply(@NonNull Transaction transaction)
                                       ^
  symbol: class NonNull
C:\Users\rober\OneDrive\Documents\flutter\.pub-cache\hosted\pub.dartlang.org\cloud_firestore-0.7.4\android\src\main\java\io\flutter\plugins\firebase\cloudfirestore\CloudFirestorePlugin.java:267: error: cannot find symbol
                    @Nullable
                     ^
  symbol: class Nullable
C:\Users\rober\OneDrive\Documents\flutter\.pub-cache\hosted\pub.dartlang.org\cloud_firestore-0.7.4\android\src\main\java\io\flutter\plugins\firebase\cloudfirestore\CloudFirestorePlugin.java:495: error: cannot find symbol
                    public void onFailure(@NonNull Exception e) {
                                           ^
  symbol: class NonNull
C:\Users\rober\OneDrive\Documents\flutter\.pub-cache\hosted\pub.dartlang.org\cloud_firestore-0.7.4\android\src\main\java\io\flutter\plugins\firebase\cloudfirestore\CloudFirestorePlugin.java:548: error: cannot find symbol
                    public void onFailure(@NonNull Exception e) {
                                           ^
  symbol: class NonNull
Note: C:\Users\rober\OneDrive\Documents\flutter\.pub-cache\hosted\pub.dartlang.org\cloud_firestore-0.7.4\android\src\main\java\io\flutter\plugins\firebase\cloudfirestore\CloudFirestorePlugin.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
7 errors

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':cloud_firestore:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.

* 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 3s
The built failed likely due to AndroidX incompatibilities in a plugin. The tool is about to try using Jetfier to solve the incompatibility.
Building plugin cloud_firestore...
Running Gradle task 'assembleAarRelease'...
Finished with error: The plugin cloud_firestore could not be built due to the issue above.

------------------------

Author:robert00,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/59700026/build-failed-trying-to-follow-firebase-for-flutter-tutorial-android-studio
yy