调试应用程序运行时 flutter apk 崩溃

flutter apk crashes while debug app works

我构建了一个应用程序,其中包含练习列表和 link YouTube 视频。该应用程序在调试版本中按预期工作,但每当我单击包含视频 link 的按钮时,我构建的 apk 总是崩溃。 我正在使用 flutter_youtube 小部件。 由于调试模式按预期工作可能会导致 APK 崩溃。 我使用 flutter build apk 而不是 flutter install 构建了 apk 这有关系吗?我也没有签

导入'package:flutter/material.dart';

导入'package:flutter_youtube/flutter_youtube.dart';

        body: ListView.builder(
          itemCount: exercise.length,
          itemBuilder: (context, index){
            return Card(
              child: ListTile(
                title: Text(keys[index]),
                trailing: RaisedButton(
                  child: const Text('Watch Video'),
                  color: Colors.blue,
                  onPressed: () {
                                FlutterYoutube.playYoutubeVideoByUrl(
                                  apiKey:"API KEY",
                                  videoUrl: exercise[index],
                                  autoPlay: true, //default false
                                );
                              },),),
       ```


根据 Google 文档

Important: When you prepare to release your app to your users, follow these steps again and create a new OAuth 2.0 client ID for your production app. For production apps, use your own private key to sign the production app's .apk file. For more information, see Signing your applications.

基于此,我意识到除非我有 Auth 2.0 API 密钥,否则该应用程序将无法运行,因为 Youtube 不会响应我一直在使用的调试 API。