【错误记录】Flutter 构建报错 ( Error: Method not found: ‘CupertinoModalPopupRoute‘. | 下载最新 Flutter SDK 版本 )

简介: 【错误记录】Flutter 构建报错 ( Error: Method not found: ‘CupertinoModalPopupRoute‘. | 下载最新 Flutter SDK 版本 )

文章目录

一、报错信息

二、问题分析

三、解决方案





一、报错信息


参考 【Flutter】Flutter Gallery 官方示例简介 博客 ;


Flutter Galley 开源项目运行时 , 部署到手机时 , 报如下错误 ;


项目地址 : https://github.com/flutter/gallery


This will generate a JSON format file containing all messages that 
need to be translated.
Launching lib\main.dart on Pixel 2 in debug mode...
Running Gradle task 'assembleDebug'...
lib/demos/cupertino/cupertino_alert_demo.dart:240:12: Error: Method not found: 'CupertinoModalPopupRoute'.
    return CupertinoModalPopupRoute<String>(
           ^^^^^^^^^^^^^^^^^^^^^^^^
FAILURE: Build failed with an exception.
* Where:
Script 'Y:\001_DevelopTools\010_Flutter\flutter_windows_2.0.2-stable\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 991
* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> Process 'command 'Y:\001_DevelopTools\010_Flutter\flutter_windows_2.0.2-stable\flutter\bin\flutter.bat'' finished with non-zero exit value 1
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 19s
Exception: Gradle task assembleDebug failed with exit code 1

image.png






二、问题分析


找不到方法 , 怀疑是使用了落后的 Flutter SDK 版本 , 这里更新到最新的测试版本 ;


https://flutter.dev/docs/development/tools/sdk/releases


image.png






三、解决方案


下载 2.1.0-12.2.pre 版本的 Flutter SDK ;


flutter_windows_2.1.0-12.2.pre-beta.zip

image.png



下载后解压上述 SDK 压缩包 flutter_windows_2.1.0-12.2.pre-beta.zip ;

image.png



解压后的 Flutter SDK 路径为 : Y:\001_DevelopTools\010_Flutter\flutter_windows_2.1.0-12.2.pre-beta\flutter ;


在 " File / Settings / Languages & Frameworks / Flutter " 下配置最新版本的 Flutter SDK 路径 ;


Y:\001_DevelopTools\010_Flutter\flutter_windows_2.1.0-12.2.pre-beta\flutter

image.png



在 " File / Settings / Languages & Frameworks / Dart " 下配置最新版本的 Dart SDK 路径 ;


Y:\001_DevelopTools\010_Flutter\flutter_windows_2.1.0-12.2.pre-beta\flutter\bin\cache\dart-sdk

image.png



最终程序运行成功 :


image.png

目录
相关文章
|
4天前
|
JavaScript 前端开发 开发工具
【Azure Developer】使用JavaScript通过SDK进行monitor-query的client认证报错问题
AADSTS90002: Tenant 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' not found. Check to make sure you have the correct tenant ID and are signing into the correct cloud. Check with your subscription administrator, this may happen if there are no active subscriptions for the tenant.
|
15天前
|
Dart UED 索引
flutter鸿蒙版本通过底部导航栏的实现熟悉架构及语法
flutter鸿蒙版本通过底部导航栏的实现熟悉架构及语法
12 2
|
2月前
|
移动开发 Dart Android开发
构建未来:基于Flutter的跨平台移动应用开发
【7月更文挑战第52天】随着移动设备市场的多样化,跨平台移动应用的需求日益增长。传统的Android和iOS原生开发方式虽强大但成本较高,而新兴的跨平台框架如React Native、Xamarin等虽然提供了解决方案,但仍存在性能与体验上的妥协。本文将探讨使用Google推出的UI工具包Flutter进行高效、高性能的跨平台移动应用开发。我们将分析Flutter的核心架构,展示如何利用其丰富的组件库和高效的渲染引擎在Android和iOS之间实现无缝衔接,并讨论其在现代移动开发中的应用前景。
|
2月前
|
Dart 开发工具 Android开发
Android Studio导入Flutter项目提示Dart SDK is not configured
Android Studio导入Flutter项目提示Dart SDK is not configured
207 4
|
2月前
|
开发工具 图形学 Android开发
Unity与安卓丨unity报错:SDK Tools version 0.0 < 26.1.1
Unity与安卓丨unity报错:SDK Tools version 0.0 < 26.1.1
|
2月前
|
开发工具 Android开发
Flutter: Android SDK not found at this location,Android Studio not found at xxx
Flutter: Android SDK not found at this location,Android Studio not found at xxx
140 2
|
2月前
|
开发者 监控 开发工具
如何将JSF应用送上云端?揭秘在Google Cloud Platform上部署JSF应用的神秘步骤
【8月更文挑战第31天】本文详细介绍如何在Google Cloud Platform (GCP) 上部署JavaServer Faces (JSF) 应用。首先,确保已准备好JSF应用并通过Maven构建WAR包。接着,使用Google Cloud SDK登录并配置GCP环境。然后,创建`app.yaml`文件以配置Google App Engine,并使用`gcloud app deploy`命令完成部署。最后,通过`gcloud app browse`访问应用,并利用GCP的监控和日志服务进行管理和故障排查。整个过程简单高效,帮助开发者轻松部署和管理JSF应用。
54 0
|
2月前
|
开发工具 iOS开发 容器
【Azure Blob】关闭Blob 匿名访问,iOS Objective-C SDK连接Storage Account报错
【Azure Blob】关闭Blob 匿名访问,iOS Objective-C SDK连接Storage Account报错
|
2月前
|
API 开发工具 Python
【Azure Developer】使用 Azure Python SDK时,遇见 The resource principal named https://management.azure.com was not found in the tenant China Azure问题的解决办法
【Azure Developer】使用 Azure Python SDK时,遇见 The resource principal named https://management.azure.com was not found in the tenant China Azure问题的解决办法
|
3月前
|
Serverless 语音技术 开发工具
函数计算操作报错合集之怎么何集成nls tts python sdk
在使用函数计算服务(如阿里云函数计算)时,用户可能会遇到多种错误场景。以下是一些常见的操作报错及其可能的原因和解决方法,包括但不限于:1. 函数部署失败、2. 函数执行超时、3. 资源不足错误、4. 权限与访问错误、5. 依赖问题、6. 网络配置错误、7. 触发器配置错误、8. 日志与监控问题。

热门文章

最新文章