ICode9

精准搜索请尝试: 精确搜索
首页 > 其他分享> 文章详细

flutter使用第三方组件报错

2020-08-21 19:01:18  阅读:83  来源: 互联网

标签:src package -- dart 报错 组件 router flutter


flutter run
Launching lib/main.dart on HMA AL00 in debug mode...
lib/routers/routers.dart:4:1: Error: 'Router' is imported from both 'package:flutter/src/widgets/router.dart' and 'package:fluro/src/router.dart'.
import 'package:fluro/fluro.dart';                                      
^^^^^^                                                                  
lib/main.dart:44:20: Error: 'Router' is imported from both 'package:flutter/src/widgets/router.dart' and 'package:fluro/src/router.dart'.
    final router = Router();                                            
                   ^^^^^^                                               
                                                                        
                                                                        
FAILURE: Build failed with an exception.                                
                                                                        
* Where:                                                                
Script '/Users/mm/flutter/packages/flutter_tools/gradle/flutter.gradle' line: 897
                                                                        
* What went wrong:                                                      
Execution failed for task ':app:compileFlutterBuildDebug'.              
> Process 'command '/Users/mm/flutter/bin/flutter'' 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 13s                                                     
Running Gradle task 'assembleDebug'...                                  
Running Gradle task 'assembleDebug'... Done                        13.7s
Exception: Gradle task assembleDebug failed with exit code 1

报错原因:是因为我升级了最新的flutter版本,导致多处第三方组件报错,以上是我用的flutter中有router和routes2个文件同时存在冲突,在Packages/flutter/src/widgets/文件夹下

 

 

解决方案:去码云下载制定版本的flutter

 

git clone --depth 1 --branch 1.20.0 https://gitee.com/mirrors/Flutter.git

 

标签:src,package,--,dart,报错,组件,router,flutter
来源: https://www.cnblogs.com/lude1994/p/13542871.html

专注分享技术,共同学习,共同进步。侵权联系[admin#icode9.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有