小编Par*_*iya的帖子

如何修复“在 <manifest> 中发现的意外元素 <queries>”错误?

突然间,我在我的 Android 项目中遇到了这个构建错误:

unexpected element <queries> found in <manifest>
Run Code Online (Sandbox Code Playgroud)

我如何解决它?

android manifest android-manifest android-gradle-plugin flutter

142
推荐指数
6
解决办法
8万
查看次数

不正确使用父数据小部件。扩展小部件必须放置在 flex 小部件内

我收到以下错误:

即,抛出了另一个异常:ParentDataWidget 的错误使用。在手机屏幕上显示错误。

 @override
  Widget build(BuildContext context) {

    return MaterialApp(
      title: widget.title,
      theme: ThemeData.light().copyWith(
        platform: _platform ?? Theme.of(context).platform,
      ),
      home: DefaultTabController(
        length: categoryNames.length,
        child: Scaffold(
        appBar: AppBar(
          title: Text(widget.title),
                 ),
        body: SafeArea(
            child: Column(
              children: <Widget>[
                Chewie(
                  controller: _chewieController,
                ),
                TabBar(
                  labelColor:Colors.black,
                  tabs: categoryNames,
                ),
                Expanded(
                  child: TabBarView(
                    children: [
                      ImageList()
                    ],
                  ),
                )
                /*TabBarView(
                  children: [
                    Icon(Icons.directions_car),
                    Icon(Icons.directions_transit),
                    Icon(Icons.directions_bike),
                  ],
                )*/
              ],
            )
        ),
      ),
      ),
    );
  }
Run Code Online (Sandbox Code Playgroud)

这是我的代码,请检查并让我知道问题。

widget dart flutter flutter-layout flutter-widget

116
推荐指数
8
解决办法
13万
查看次数

更新到 iOS 14 和 Xcode 12 后应用程序启动时间变慢

我注意到自从将我的设备更新到 iOS 14 并使用 Xcode 12 以来,我的应用程序的启动时间显着增加(现在需要整整一分钟,而之前需要几秒钟)。我尝试了几个 Xcode 12 beta 并在模拟器中运行了该应用程序而没有问题,但是公开发布似乎带来了这个问题。

我测试了我的几个应用程序,它们都面临这个问题。再次运行应用程序(没有 Xcode)是即时的,即使在重新启动设备之后也是如此。

需要明确的是,我不是在这里谈论构建时间,这是在启动画面出现并且 Xcode 的状态为“在 iPhone 上运行”后应用程序启动所需的时间

有没有其他人遇到过这个问题,或者它可能与我的机器有关吗?

xcode ios ios14 xcode12

76
推荐指数
5
解决办法
1万
查看次数

CocoaPods 找不到 pod“Firebase/CoreOnly”的兼容版本

我已经将我的 flutter 包更新到最新版本,现在 IOS 不再工作了。

当我尝试更新 Pod 时,它显示此错误:

    [!] CocoaPods could not find compatible versions for pod "Firebase/CoreOnly":
    In Podfile:
    cloud_firestore (from `.symlinks/plugins/cloud_firestore/ios`) was resolved to 0.0.1, which depends on
    Firebase/Firestore (~> 6.0) was resolved to 6.0.0, which depends on
    Firebase/CoreOnly (= 6.0.0)

    cloud_functions (from `.symlinks/plugins/cloud_functions/ios`) was resolved to 0.0.1, which depends on
    Firebase/Functions (~> 5.18) was resolved to 5.18.0, which depends on
    Firebase/CoreOnly (= 5.18.0)
Run Code Online (Sandbox Code Playgroud)

这是我的 pubspec.yaml(与 Firebase 相关):

firebase_core: "^0.4.0"
firebase_auth: "^0.11.0"
firebase_analytics: "^3.0.0"  
cloud_firestore: "^0.11.0+1"
cloud_functions: "^0.3.0" …
Run Code Online (Sandbox Code Playgroud)

ios firebase podspec flutter podfile

69
推荐指数
14
解决办法
4万
查看次数

Flutter:CocoaPods 的规范存储库已经过时,无法满足依赖项

目前,我正在尝试使用最新版本在我的 flutter 项目中添加firebase_core: ^0.5.0+1firebase_crashlytics: ^0.2.1+1打包,它在 Android 中没有任何问题,但在 iOS 中,它无法正常工作并出现错误。那么现在如何使用 iOS Flutter 项目中的最新包来运行我的项目呢?

我也试过了,pod repo update但是还是不行

我收到此错误 flutter run

CocoaPods' output:
?
      Preparing

    Analyzing dependencies

    Inspecting targets to integrate
      Using `ARCHS` setting to build architectures of target `Pods-Runner`: (``)

    Finding Podfile changes
      A firebase_crashlytics
      - Flutter
      - contact_picker
      - device_info
      - file_picker
      - firebase_auth
      - firebase_core
      - firebase_messaging
      - flutter_keyboard_visibility
      - flutter_local_notifications
      - flutter_webview_plugin
      - image_picker
      - path_provider
      - phone_number
      - share
      - shared_preferences
      - …
Run Code Online (Sandbox Code Playgroud)

ios cocoapods firebase flutter podfile

68
推荐指数
6
解决办法
3万
查看次数

在 dart 中在列表的开头插入元素

我只是在 Flutter 中创建一个简单的 ToDo 应用程序。我正在管理列表中的所有待办事项。我想在列表的开头添加任何新的待办事项。我能够使用这种解决方法来实现这一目标。有没有更好的方法来做到这一点?

void _addTodoInList(BuildContext context){
    String val = _textFieldController.text;

    final newTodo = {
      "title": val,
      "id": Uuid().v4(),
      "done": false
    };

    final copiedTodos = List.from(_todos);

    _todos.removeRange(0, _todos.length);
    setState(() {
      _todos.addAll([newTodo, ...copiedTodos]);
    });

    Navigator.pop(context);
  }
Run Code Online (Sandbox Code Playgroud)

list insert dart flutter

66
推荐指数
5
解决办法
3万
查看次数

错误:在 iOS 上运行 Flutter 时找不到“Flutter/Flutter.h”文件

我不知道为什么,但我无法在我的新 Macbook 中构建或运行该应用程序,我在另一台 Mac 或我的 Windows 计算机上运行相同的文件夹并完美运行。在这里,当我运行 flutter clean 时,我必须运行 pub get 来解决问题,这正常吗?

如果我新建一个项目,我可以正常运行flutter run,所以我想可能那里我认为可能与插件有关。

你知道我该如何解决这个问题吗?谢谢

Flutter Doctor
[?] Flutter (Channel master, 1.24.0-8.0.pre.343, on macOS 11.0.1 20B29 darwin-x64, locale es-419)
    • Flutter version 1.24.0-8.0.pre.343 at /Users/leo/tools/flutter
    • Framework revision cf6c33e58a (2 days ago), 2020-11-21 14:04:01 -0800
    • Engine revision 23a8e027db
    • Dart version 2.12.0 (build 2.12.0-62.0.dev)

[?] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
    • Android SDK at /Users/leo/Library/Android/sdk
    • Platform android-30, build-tools 30.0.2
    • Java …
Run Code Online (Sandbox Code Playgroud)

ios cocoapods flutter flutter-ios flutter-ios-build

60
推荐指数
16
解决办法
5万
查看次数

查找停用的小部件的祖先是不安全的

我是 Flutter 的新手,我正在尝试使用 Dialog 接收数据。当单击 textField 时,会出现 image2 的错误...

布局的图像 错误的图像

show(BuildContext context){

    var dialog = Dialog(
      child: Container(
        margin: EdgeInsets.all(8.0),
        child: Form(
          child: Column(
            mainAxisSize: MainAxisSize.min,
            children: <Widget>[
              TextFormField(
                decoration: InputDecoration(
                    labelText: "Insira o número de telefone",
                    border: OutlineInputBorder(
                        borderRadius: BorderRadius.all(Radius.circular(2.0)))),
              ),
              Row(
                mainAxisAlignment: MainAxisAlignment.end,
                children: <Widget>[
                  FlatButton(
                      onPressed: () {
                        Navigator.of(context).pop();
                      },
                      child: Text("Cancelar")),
                  FlatButton(
                      onPressed: () {
                        Navigator.of(context).pop();
                      },
                      child: Text("Aceitar"))
                ],
              )
            ],
          ),
        ),
      ),
    );

    showDialog(context: context,builder: (context){
      return dialog;
    });
  }
Run Code Online (Sandbox Code Playgroud)

这是我的代码。

I/flutter (31032): Looking …
Run Code Online (Sandbox Code Playgroud)

dialog dart flutter flutter-widget

54
推荐指数
6
解决办法
8万
查看次数

Flutter:“RenderFlex 子项具有非零 flex,但传入的高度约束是无界的”

ListView当我FutureBuilder用 a包装时,我想在另一个小部件内部有一个小部件Column,以便有一个简单的Row. 我收到此错误:

The following assertion was thrown during performLayout():
I/flutter (13816): RenderFlex children have non-zero flex but incoming height constraints are unbounded.
I/flutter (13816): When a column is in a parent that does not provide a finite height constraint, for example, if it is
I/flutter (13816): in a vertical scrollable, it will try to shrink-wrap its children along the vertical axis. Setting a
I/flutter (13816): flex on a child (e.g. using Expanded) …
Run Code Online (Sandbox Code Playgroud)

dart flutter flutter-layout

52
推荐指数
3
解决办法
7万
查看次数

如何在 Flutter 中启用 Null-Safety?

我尝试使用空安全,但它给了我这个错误:

这需要启用“不可为空”语言功能。尝试更新 pubspec.yaml 以将最小 SDK 约束设置为 2.10.0 或更高版本,并运行“pub get”。

我将 Dart SDK 约束从 更改2.7.02.10.0,但它仍然显示此错误。

在此处输入图片说明

另外,我升级了我的 Dart 和 Flutter SDK:

dart-sdk v2.10.2 是基于您的来源的最新版本。

颤动(通道稳定,1.22.3,...

dart flutter dart-null-safety

42
推荐指数
5
解决办法
3万
查看次数