Сборка не удалась при попытке следовать учебнику Firebase для Flutter (Android Studio) - PullRequest
0 голосов
/ 12 января 2020

Новичок в разработке мобильных приложений. Я пытаюсь следовать этому уроку Firebase for Flutter: https://codelabs.developers.google.com/codelabs/flutter-firebase/#4

Предполагается, что импорт пакета firestore для самой первой строки в main.dart что вызывает следующий результат, когда я пытаюсь запустить его. Я не следую учебнику правильно ?? Мой код выглядит точно так же, как в учебнике. Я скопировал и вставил.

Это с 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.

------------------------
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...