firebase API密钥无效,请传递有效的API密钥

8ftvxx2r  于 2022-11-25  发布在  其他
关注(0)|答案(1)|浏览(175)

enter image description here
错误:flutter/运行时/dart_vm_initializer.cc(41)]未处理的异常:如果您有任何问题,请与我们联系。发生内部错误。[ API密钥无效。请传递有效的API密钥。
消防基地

htrmnn0y

htrmnn0y1#

main.dart

// ignore_for_file: prefer_const_constructors

import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'screens/splash_screen.dart';
import 'package:firebase_core/firebase_core.dart';

void main() async {
  WidgetsFlutterBinding.ensureInitialized();
  await Firebase.initializeApp();
  SystemChrome.setPreferredOrientations([
    DeviceOrientation.portraitDown,
    DeviceOrientation.portraitUp,
  ]);
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle(
        statusBarColor: Colors.transparent,
        systemNavigationBarColor: Color.fromARGB(0, 255, 255, 255)));
    return MaterialApp(
      debugShowCheckedModeBanner: false,
      home: SplashScreen(),
    );
  }
}

相关问题