构建尝试遵循Firebase for Flatter教程失败(Android Studio)
对于移动应用程序开发人员来说,我是新手,我正尝试遵循Firebase for Flatter教程: 按照main.dart中的第一行导入firestore包可能是我尝试运行它时导致以下结果的原因。我没有正确地遵循教程吗??我的代码与教程中的代码完全相同。我复制并粘贴 这是Android Studio 3.5.3的一部分构建尝试遵循Firebase for Flatter教程失败(Android Studio),firebase,flutter,dart,google-cloud-firestore,Firebase,Flutter,Dart,Google Cloud Firestore,对于移动应用程序开发人员来说,我是新手,我正尝试遵循Firebase for Flatter教程: 按照main.dart中的第一行导入firestore包可能是我尝试运行它时导致以下结果的原因。我没有正确地遵循教程吗??我的代码与教程中的代码完全相同。我复制并粘贴 这是Android Studio 3.5.3的一部分 Launching lib\main.dart on Android SDK built for x86 in debug mode... Running Gradle tas
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.
------------------------
发布代码的详细信息。由于这是androidx的问题,所以颤振版本、插件版本以及您如何创建项目都决定了您是否支持androidx。谢谢。我现在明白了。错误的是cloud_firestore版本。(与教程不同)我的糟糕!