Flutter Flatter无法连接到firebase firestore数据库
版本为0。 W/example.news_ap(18666):访问隐藏方法Lsun/misc/Unsafe;->getLong(Ljava/lang/Object;J)J (灰色列表,核心平台api,链接,允许) W/example.news_ap(18666):访问隐藏方法Lsun/misc/Unsafe;->arrayBaseOffset(Ljava/lang/Class;)I (灰色列表,核心平台api,链接,允许) W/example.news_ap(18666):访问隐藏方法Lsun/misc/Unsafe;->copyMemory(JJJ)V(灰色列表,链接,允许) W/example.news_ap(18666):访问隐藏方法Lsun/misc/Unsafe;->objectFieldOffset(Ljava/lang/reflect/Field;)J (灰色列表,核心平台api,链接,允许) W/example.news_ap(18666):访问隐藏方法Lsun/misc/Unsafe;->getByte(J)B(greylist,核心平台api,链接, 允许的) W/example.news_ap(18666):访问隐藏方法Lsun/misc/Unsafe;->getByte(Ljava/lang/Object;J)B (灰色列表,核心平台api,链接,允许) W/example.news_ap(18666):访问隐藏方法Lsun/misc/Unsafe;->getLong(J)J(greylist,核心平台api,链接, 允许的) W/example.news_ap(18666):访问隐藏方法Lsun/misc/Unsafe;->putByte(JB)V(greylist,核心平台api,链接, 允许的) W/example.news_ap(18666):访问隐藏方法Lsun/misc/Unsafe;->putByte(Ljava/lang/Object;JB)V (灰色列表,核心平台api,链接,允许) W/example.news_ap(18666):访问隐藏方法Lsun/misc/Unsafe;->getLong(Ljava/lang/Object;J)J (greylist,核心平台api,允许反射) W/example.news_ap(18666):访问隐藏方法Lsun/misc/Unsafe;->getLong(Ljava/lang/Object;J)J (greylist,核心平台api,允许反射) W/example.news_ap(18666):访问隐藏字段Ljava/nio/Buffer;->地址:J(灰色列表,反射,允许) 新闻ap(18666):ClassLoaderContext是一个特殊的共享库。 I/chatty(18666):uid=10143(com.example.news_app)异步任务#1相同的1行 新闻ap(18666):ClassLoaderContext是一个特殊的共享库。 V/NativeCrypto(18666):注册com/google/android/gms/org/conscrypt/NativeCrypto的286本机 方法。。。 W/example.news_ap(18666):访问隐藏方法Ljava/security/spec/ECParameterSpec;->getCurveName()Ljava/lang/String; (灰色列表,反射,允许) D/NetworkSecurityConfig(18666):未指定网络安全配置,使用平台默认值 I/ProviderInstaller(18666):安装的默认安全提供程序GmsCore\U OpenSSLFlutter Flatter无法连接到firebase firestore数据库,flutter,flutter-layout,flutter-dependencies,flutter-web,flutter-animation,Flutter,Flutter Layout,Flutter Dependencies,Flutter Web,Flutter Animation,版本为0。 W/example.news_ap(18666):访问隐藏方法Lsun/misc/Unsafe;->getLong(Ljava/lang/Object;J)J (灰色列表,核心平台api,链接,允许) W/example.news_ap(18666):访问隐藏方法Lsun/misc/Unsafe;->arrayBaseOffset(Ljava/lang/Class;)I (灰色列表,核心平台api,链接,允许) W/example.news_ap(18666):访问隐藏方法Lsun/
Launching lib\main.dart on Android SDK built for x86 in debug mode...
Running Gradle task 'assembleDebug'...
Parameter format not correct -
✓ Built build\app\outputs\flutter-apk\app-debug.apk.
Installing build\app\outputs\flutter-apk\app.apk...
Waiting for Android SDK built for x86 to report its views...
Debug service listening on ws://127.0.0.1:50523/i2wsZclk56g=/ws
Syncing files to device Android SDK built for x86...
D/EGL_emulation(18666): eglMakeCurrent: 0xe7f04400: ver 2 0 (tinfo 0xdfef9730)
D/eglCodecCommon(18666): setVertexArrayObject: set vao to 0 (0) 1 0
W/DynamiteModule(18666): Local module descriptor class for providerinstaller not found.
I/DynamiteModule(18666): Considering local module providerinstaller:0 and remote module providerinstaller:0
W/ProviderInstaller(18666): Failed to load providerinstaller module: No acceptable module found. Local version is 0 and remote
如果您使用的是最新的Firebase依赖项,则必须将添加到pubspec.yaml中的依赖项中
════════ Exception caught by widgets library ═══════════════════════════════════════════════════════
The following NoSuchMethodError was thrown building Home(dirty, state: _HomeState#f839b):
The getter 'length' was called on null.
Receiver: null
Tried calling: length
The relevant error-causing widget was:
Home file:///E:/major%20project/newssapp/news_app/lib/main.dart:17:15
When the exception was thrown, this was the stack:
#0 Object.noSuchMethod (dart:core-patch/object_patch.dart:51:5)
#1 _HomeState.build (package:news_app/home.dart:151:44)
#2 StatefulElement.bu``ild (package:flutter/src/widgets/framework.dart:4663:28)
#3 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4546:15)
#4 StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:4719:11)
...
════════════════════════════════════════════════════════════════════════════════════════════════════
集成核心依赖项后,您必须在应用程序中初始化Firebase以访问其功能,如Firestore
firebase_core: "0.5.0"
你似乎刚刚发布了你的错误。请看。在错误周围使用代码块会使它更具可读性。
firebase_core: "0.5.0"
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
final Future<FirebaseApp> _initialization = Firebase.initializeApp();
@override
Widget build(BuildContext context) {
return FutureBuilder(
// Initialize Firebase:
future: _initialization,
builder: (context, snapshot) {
if (snapshot.connectionState == ConnectionState.done) {
return YourApplication();
}
},
);
}
}
flutter pub get