小编Sun*_*suk的帖子

为 flutter 添加 image_picker 依赖项时出错(iOS)

我需要在我的应用程序中使用 image_picker 。我将 image_picker 依赖项添加到我的 pubspec.yaml 文件中,对于 iOS,我已将 NSCameraUsageDescription\n NSPhotoLibraryUsageDescription\n NSMicrophoneUsageDescription\non 添加到 info.plist 文件中,但在尝试在 iOS 模拟器上运行应用程序时出现此错误。

\n\n

这是我尝试运行应用程序时遇到的错误。\n`在 iPhone 11 Pro Max 上以调试模式启动 lib/main.dart...\n/Users/sirapol/Desktop/FirstCareFrontEnd/care_now_frontend_v1/ios/Runner/ Info.plist:属性列表错误:在第 27 行\n 处发现非键/JSON 错误:JSON 文本未以数组或对象开头,并且允许未设置片段的选项。\n运行 Xcode 构建...

\n\n

Xcode 构建完成。2.4s\n无法构建 iOS 应用程序\nXcode 构建的错误输出:\n\xe2\x86\xb3\n ** 构建失败 **

\n\n

Xcode 的输出:\n\xe2\x86\xb3\n /Users/sirapol/Desktop/FirstCareFrontEnd/care_now_frontend_v1/build/ios/Debug-iphonesimulator/flutter_plugin_android_lifecycl\ne/flutter_plugin_android_lifecycle.framework:资源分支、Finder 信息,或不允许类似的碎屑\n 命令 CodeSign 失败,退出代码为非零\n 注意:使用新的构建系统\n 注意:规划构建\n 注意:构建构建描述\n 警告:将架构 armv7 映射到 i386。确保针对 iOS 模拟器平台正确配置此目标的架构和有效架构构建设置。(在项目“Pods”的目标“image_picker”中)\n 警告:将架构 arm64 映射到 x86_64。确保针对 iOS 模拟器平台正确配置此目标的架构和有效架构构建设置。(在项目“Pods”的目标“image_picker”中)\n 警告:签名功能和功能可能无法正常运行,因为其权利使用占位符团队\n ID。要解决此问题,请在 Runner 编辑器中选择一个开发团队。(在项目“Runner”的目标“Runner”中)`

\n\n

这是我的 pubspec.yaml 文件的一部分

\n\n
dependencies:\n  flutter:\n    sdk: flutter\n\n  # The following …
Run Code Online (Sandbox Code Playgroud)

flutter flutter-dependencies

3
推荐指数
1
解决办法
4839
查看次数

在 null 上调用了 getter 'text'

我正在尝试从弹出的 alertDialog 中获取用户密码。用户在将 passController 作为 TextEditingController 的文本字段中键入他们的密码,并且通过调用 passController.text 收集文本,但是发生了错误。

  void showDialog1(String msg, String jsonString) {

    TextEditingController passController;

    // flutter defined function
    showDialog(
      context: context,
      builder: (BuildContext context) {
        // return object of type Dialog
        return AlertDialog(
          title: new Text("Please Enter Password"),
          content: TextField(
              decoration: const InputDecoration(
                labelText: 'Password *',
              ),
              obscureText: true,
              controller: passController),
          actions: <Widget>[
            // usually buttons at the bottom of the dialog
            new FlatButton(
              child: new Text("OK"),
              onPressed: () {
                Navigator.of(context).pop();
                submit(jsonString, passController.text);
              },
            ),
          ],
        ); …
Run Code Online (Sandbox Code Playgroud)

flutter flutter-layout

1
推荐指数
1
解决办法
4359
查看次数