切换到分支“稳定”颤振通道后
以下是构建问题。
错误:指定的语言版本太高。支持的最高语言版本是 2.8。
output: ../../third_party/dart/third_party/pkg/collection/lib/src/utils.dart:1:1: Error: The specified language version is too high. The highest supported language version is 2.8.
// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
^
../../third_party/dart/third_party/pkg/collection/lib/src/wrappers.dart:1:1: Error: The specified language version is too high. The highest supported language version is 2.8.
// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
^
../../third_party/dart/third_party/pkg/collection/lib/src/functions.dart:1:1: Error: The specified language version is too high. The highest supported language version is …
Run Code Online (Sandbox Code Playgroud) 我在我的颤振应用程序中使用本机 android 方法使用说明使用的文档
MethodChannel(flutterView, CHANNEL).setMethodCallHandler...
Run Code Online (Sandbox Code Playgroud)
但是在升级 flutter 之后,该MethodChannel
功能不需要了flutterView
,也没有flutterView
了。
can not resolve method getFlutterView()
Run Code Online (Sandbox Code Playgroud)
我认为应该有一个创建频道的新教程
相反,它需要一些BinaryMessenger
我不知道该给什么的。
这是不再工作的旧代码:
import io.flutter.app.FlutterActivity;
import io.flutter.plugin.common.MethodCall;
import io.flutter.plugin.common.MethodChannel;
import io.flutter.plugin.common.MethodChannel.MethodCallHandler;
import io.flutter.plugin.common.MethodChannel.Result;
public class MainActivity extends FlutterActivity {
private static final String CHANNEL = "samples.flutter.dev/battery";
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
GeneratedPluginRegistrant.registerWith(this);
new MethodChannel(getFlutterView(), CHANNEL).setMethodCallHandler(
new MethodCallHandler() {
@Override
public void onMethodCall(MethodCall call, Result result) {
// Note: this method is invoked on the main thread.
// …
Run Code Online (Sandbox Code Playgroud) 背景
\n我刚刚为 Windows 机器开发了第一个 Flutter 桌面应用程序。该应用程序在开发/调试时工作正常,但我正在尝试将其作为发布模式下的应用程序进行测试。
\n\xe2\x80\x99s 做了什么
\n实际问题
\n当我在其他系统上安装应用程序时(甚至在我调试应用程序的实际系统上)。我可以成功安装 msix 安装程序,我可以看到应用程序中列出了我的应用程序,但是当我尝试打开它时,它卡在空白/白色屏幕上。没有呈现 UI。如果我尝试最大化窗口,它会进入应用程序无响应状态。\n任何帮助将非常感激。\n提前致谢。
\n更新/新发现
\n在浏览了Yehuda Kremer提供的链接并揪着我的头发几天后,我在这条推文中找到了答案\n https://twitter.com/FilledStacks/status/1436280577439715338?s=20
\n所以主要问题是应用程序使用了一些在其他机器上不起作用的绝对路径(发布后)
\n1- 我的应用程序正在使用数据库,因此我确保该数据库路径是相对于应用程序文档目录的。\n2- 现在构建还引用了一些依赖项,并且它们的路径也是绝对的。我注意到CMAKE_INSTALL_LOCAL_ONLY
其中有一个标志cmake_install.cmake
,但该标志没有在任何地方设置。
flutter build windows -v
这是\n https://pastebin.com/LAeshUMY的日志
-- 现在我正在寻找一种正确的方法将所有路径转换为相对路径,以便构建可以安装在不同的计算机上,而不仅仅是本地安装。
\n我们已经在 TDD 方法中启动了一个关于 Flutter 的新项目。我正在使用状态管理提供程序。在尝试编写小部件测试时,我们面临着测试提供程序的问题。你能否用一个例子来建议为提供者和小部件注入提供者的单元测试。
我遇到以下问题
??? EXCEPTION CAUGHT BY FLUTTER TEST FRAMEWORK ?????????????????????????????????????
The following ProviderNotFoundException was thrown running a test:
Error: Could not find the correct Provider above this SplashScreen Widget
To fix, please:
Ensure the Provider is an ancestor to this SplashScreen Widget
Provide types to Provider
Provide types to Consumer
Provide types to Provider.of()
Always use package imports. Ex: `import 'package:my_app/my_code.dart';
Ensure the correct context is being used.
Run Code Online (Sandbox Code Playgroud)
???启动画面代码??????????????????????????????????????????
??? EXCEPTION CAUGHT BY FLUTTER TEST FRAMEWORK …
Run Code Online (Sandbox Code Playgroud) flutter flutter-test flutter-dependencies flutter-channel flutter-plugin
我正在使用 Android Studio 开发 Flutter 应用程序。当我在模拟器中运行应用程序时,我能够热重载,但在使用物理设备时,热重载、颤振热重启、时间轴视图和颤振检查器按钮被禁用。有没有什么办法解决这一问题?
目前我正在尝试使用颤振网络,为此我需要在颤振主频道上工作。但是,然后我需要处理我的其他项目。在他们身上,我正在研究颤振稳定通道。
但是,每次我使用“flutter channel stable”或“flutter channel master”命令切换我的flutter频道时,它每次都会重新下载sdk和其他工具。
目前,我已经下载了稳定的 flutter sdk 和稳定的 dart sdk。
我已将它们移动到“FlutterSDK”文件夹中,其中还有另外两个文件夹“stable”和“master”。这两个文件夹都包含稳定的 flutter & dart sdk。
但是,它会不断重新下载资源。我究竟做错了什么 ?
有人能帮忙吗?
谢谢。
我只是添加了fvm包来将flutter通道从stable切换到master,而无需每次切换flutter通道时都下载sdk组件。
我按照readme.md中写的步骤切换频道。
我在环境变量中设置了以下路径。
D:\Program_Files\FlutterSDK\SDK\flutter\bin;
D:\Program_Files\FlutterSDK\SDK\dart-sdk\bin;
C:\Users\User\AppData\Roaming\Pub\Cache\bin;
Run Code Online (Sandbox Code Playgroud)
现在,我已经打开了我的第一个项目,我想在其中使用“flutter SDK的主通道”。但是,每当我尝试使用命令“fvm use master”时。它不起作用。
它给我一个错误,例如 “fvm”不被识别为内部或外部命令,
那么,有人可以提出解决方案吗?
谢谢。
我的颤振在稳定通道上运行良好,但是当切换到另一个通道时,它以 find: invalid mode '+100'
每次我运行这个命令时:
> flutter channel master
> flutter doctor
Run Code Online (Sandbox Code Playgroud)
总是最终下载一个 git 和消息错误:
find: invalid mode ‘+100’
Run Code Online (Sandbox Code Playgroud)
我跑了 :
git clean -xfd
git pull
flutter doctor
Run Code Online (Sandbox Code Playgroud)
但总是以相同的错误消息结束,这是屏幕截图:
知道我的颤振有什么问题吗?
我在终端命令中 flutter build appbundle 时遇到问题
编译器消息:
../../flutter/packages/flutter/lib/src/widgets/basic.dart:5149:9: Error: Type 'ui.TextHeightBehavior' not found.
final ui.TextHeightBehavior textHeightBehavior;
^^^^^^^^^^^^^^^^^^^^^
../../flutter/packages/flutter/lib/src/widgets/text.dart:149:9: Error: Type 'ui.TextHeightBehavior' not found.
final ui.TextHeightBehavior textHeightBehavior;
^^^^^^^^^^^^^^^^^^^^^
../../flutter/packages/flutter/lib/src/widgets/text.dart:432:9: Error: Type 'ui.TextHeightBehavior' not found.
final ui.TextHeightBehavior textHeightBehavior;
^^^^^^^^^^^^^^^^^^^^^
../../flutter/packages/flutter/lib/src/rendering/paragraph.dart:78:5: Error: Type 'ui.TextHeightBehavior' not found.
ui.TextHeightBehavior textHeightBehavior,
^^^^^^^^^^^^^^^^^^^^^
../../flutter/packages/flutter/lib/src/rendering/paragraph.dart:281:3: Error: Type 'ui.TextHeightBehavior' not found.
ui.TextHeightBehavior get textHeightBehavior => _textPainter.textHeightBehavior;
^^^^^^^^^^^^^^^^^^^^^
../../flutter/packages/flutter/lib/src/rendering/paragraph.dart:282:26: Error: Type 'ui.TextHeightBehavior' not found.
set textHeightBehavior(ui.TextHeightBehavior value) {
^^^^^^^^^^^^^^^^^^^^^
../../flutter/packages/flutter/lib/src/painting/text_painter.dart:145:5: Error: Type 'ui.TextHeightBehavior' not found.
ui.TextHeightBehavior textHeightBehavior,
^^^^^^^^^^^^^^^^^^^^^
../../flutter/packages/flutter/lib/src/painting/text_painter.dart:346:3: Error: Type …
Run Code Online (Sandbox Code Playgroud) dart flutter android-app-bundle flutter-channel flutter-build
flutter ×10
flutter-channel ×10
dart ×4
android ×2
flutter-web ×2
flutter-test ×1
git ×1
git-pull ×1
screensaver ×1
version ×1