获取“异常:Gradle任务assembleDebug失败,退出代码为1”

时间:2020-08-28 00:42:02

标签: android flutter visual-studio-code

当我尝试开始评论flutter run时,我遇到了问题。

我只有这个

lib/MyCart.dart:2:8: Error: Error when reading '../../../../Developer/flutter/.pub-cache/hosted/pub.dartlang.org/adobe_xd-0.1.4/lib/pinned.dart': No such file or directory
import 'package:adobe_xd/pinned.dart';                                  
       ^                                                                
../../../../Developer/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.17.4/lib/src/picture_stream.dart:88:26: Error: Type 'DiagnosticableMixin' not found.
class PictureStream with DiagnosticableMixin {                          
                         ^^^^^^^^^^^^^^^^^^^                            
../../../../Developer/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.17.4/lib/src/picture_stream.dart:192:44: Error: Type 'DiagnosticableMixin' not found.
abstract class PictureStreamCompleter with DiagnosticableMixin {        
                                           ^^^^^^^^^^^^^^^^^^^          
../../../../Developer/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.17.4/lib/src/picture_stream.dart:88:7: Error: The type 'DiagnosticableMixin' can't be mixed in.
class PictureStream with DiagnosticableMixin {                          
      ^                                                                 
../../../../Developer/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.17.4/lib/src/picture_stream.dart:192:16: Error: The type 'DiagnosticableMixin' can't be mixed in.
abstract class PictureStreamCompleter with DiagnosticableMixin {        
               ^                                                        
lib/MyCart.dart:285:19: Error: The getter 'Pinned' isn't defined for the class 'MyCart'.
 - 'MyCart' is from 'package:jahezly/MyCart.dart' ('lib/MyCart.dart').  
Try correcting the name to the name of an existing getter, or defining a getter or field named 'Pinned'.
                  Pinned.fromSize(                                      
                  ^^^^^^                                                
lib/MyCart.dart:304:19: Error: The getter 'Pinned' isn't defined for the class 'MyCart'.
 - 'MyCart' is from 'package:jahezly/MyCart.dart' ('lib/MyCart.dart').  
Try correcting the name to the name of an existing getter, or defining a getter or field named 'Pinned'.
                  Pinned.fromSize(                                      
                  ^^^^^^                                                
lib/MyCart.dart:321:19: Error: The getter 'Pinned' isn't defined for the class 'MyCart'.
 - 'MyCart' is from 'package:jahezly/MyCart.dart' ('lib/MyCart.dart').  
Try correcting the name to the name of an existing getter, or defining a getter or field named 'Pinned'.
                  Pinned.fromSize(                                      
                  ^^^^^^                                                
lib/MyCart.dart:338:19: Error: The getter 'Pinned' isn't defined for the class 'MyCart'.
 - 'MyCart' is from 'package:jahezly/MyCart.dart' ('lib/MyCart.dart').  
Try correcting the name to the name of an existing getter, or defining a getter or field named 'Pinned'.
                  Pinned.fromSize(                                      
                  ^^^^^^                                                
lib/MyCart.dart:356:19: Error: The getter 'Pinned' isn't defined for the class 'MyCart'.
 - 'MyCart' is from 'package:jahezly/MyCart.dart' ('lib/MyCart.dart').  
Try correcting the name to the name of an existing getter, or defining a getter or field named 'Pinned'.
                  Pinned.fromSize(                                      
                  ^^^^^^                                                
lib/MyCart.dart:373:19: Error: The getter 'Pinned' isn't defined for the class 'MyCart'.
 - 'MyCart' is from 'package:jahezly/MyCart.dart' ('lib/MyCart.dart').  
Try correcting the name to the name of an existing getter, or defining a getter or field named 'Pinned'.
                  Pinned.fromSize(                                      
                  ^^^^^^                                                
lib/MyCart.dart:390:19: Error: The getter 'Pinned' isn't defined for the class 'MyCart'.
 - 'MyCart' is from 'package:jahezly/MyCart.dart' ('lib/MyCart.dart').  
Try correcting the name to the name of an existing getter, or defining a getter or field named 'Pinned'.
                  Pinned.fromSize(                                      
                  ^^^^^^                                                
lib/MyCart.dart:524:21: Error: The getter 'Pinned' isn't defined for the class 'MyCart'.
 - 'MyCart' is from 'package:jahezly/MyCart.dart' ('lib/MyCart.dart').  
Try correcting the name to the name of an existing getter, or defining a getter or field named 'Pinned'.
                    Pinned.fromSize(                                    
                    ^^^^^^                                              
lib/MyCart.dart:545:21: Error: The getter 'Pinned' isn't defined for the class 'MyCart'.
 - 'MyCart' is from 'package:jahezly/MyCart.dart' ('lib/MyCart.dart').  
Try correcting the name to the name of an existing getter, or defining a getter or field named 'Pinned'.
                    Pinned.fromSize(                                    
                    ^^^^^^                                              
../../../../Developer/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.17.4/lib/src/picture_stream.dart:167:11: Error: Superclass has no method named 'debugFillProperties'.
    super.debugFillProperties(properties);                              
          ^^^^^^^^^^^^^^^^^^^                                           
../../../../Developer/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.17.4/lib/src/picture_stream.dart:171:30: Error: The method 'toStringShort' isn't defined for the class 'PictureStreamCompleter'.
 - 'PictureStreamCompleter' is from 'package:flutter_svg/src/picture_stream.dart' ('../../../../Developer/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.17.4/lib/src/picture_stream.dart').
Try correcting the name to the name of an existing method, or defining a method named 'toStringShort'.
      ifPresent: _completer?.toStringShort(),                           
                             ^^^^^^^^^^^^^                              
../../../../Developer/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.17.4/lib/src/picture_stream.dart:266:11: Error: Superclass has no method named 'debugFillProperties'.
    super.debugFillProperties(description);                             
          ^^^^^^^^^^^^^^^^^^^                                           
                                                                        
                                                                        
FAILURE: Build failed with an exception.                                
                                                                        
* Where:                                                                
Script '/Users/mbp/Developer/flutter/packages/flutter_tools/gradle/flutter.gradle' line: 896
                                                                        
* What went wrong:                                                      
Execution failed for task ':app:compileFlutterBuildDebug'.              
> Process 'command '/Users/mbp/Developer/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 9s                                                      
Running Gradle task 'assembleDebug'...                                  
Running Gradle task 'assembleDebug'... Done                        10.9s
Exception: Gradle task assembleDebug failed with exit code 1
Azzam-Almesbahi:jahezly mbp$ flutter run
Launching lib/main.dart on HRY LX1T in debug mode...
lib/MyCart.dart:2:8: Error: Error when reading '../../../../Developer/flutter/.pub-cache/hosted/pub.dartlang.org/adobe_xd-0.1.4/lib/pinned.dart': No such file or directory
import 'package:adobe_xd/pinned.dart';                                  
       ^                                                                
../../../../Developer/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.17.4/lib/src/picture_stream.dart:88:26: Error: Type 'DiagnosticableMixin' not found.
class PictureStream with DiagnosticableMixin {                          
                         ^^^^^^^^^^^^^^^^^^^                            
../../../../Developer/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.17.4/lib/src/picture_stream.dart:192:44: Error: Type 'DiagnosticableMixin' not found.
abstract class PictureStreamCompleter with DiagnosticableMixin {        
                                           ^^^^^^^^^^^^^^^^^^^          
../../../../Developer/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.17.4/lib/src/picture_stream.dart:88:7: Error: The type 'DiagnosticableMixin' can't be mixed in.
class PictureStream with DiagnosticableMixin {                          
      ^                                                                 
../../../../Developer/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.17.4/lib/src/picture_stream.dart:192:16: Error: The type 'DiagnosticableMixin' can't be mixed in.
abstract class PictureStreamCompleter with DiagnosticableMixin {        
               ^                                                        
lib/MyCart.dart:285:19: Error: The getter 'Pinned' isn't defined for the class 'MyCart'.
 - 'MyCart' is from 'package:jahezly/MyCart.dart' ('lib/MyCart.dart').  
Try correcting the name to the name of an existing getter, or defining a getter or field named 'Pinned'.
                  Pinned.fromSize(                                      
                  ^^^^^^                                                
lib/MyCart.dart:304:19: Error: The getter 'Pinned' isn't defined for the class 'MyCart'.
 - 'MyCart' is from 'package:jahezly/MyCart.dart' ('lib/MyCart.dart').  
Try correcting the name to the name of an existing getter, or defining a getter or field named 'Pinned'.
                  Pinned.fromSize(                                      
                  ^^^^^^                                                
lib/MyCart.dart:321:19: Error: The getter 'Pinned' isn't defined for the class 'MyCart'.
 - 'MyCart' is from 'package:jahezly/MyCart.dart' ('lib/MyCart.dart').  
Try correcting the name to the name of an existing getter, or defining a getter or field named 'Pinned'.
                  Pinned.fromSize(                                      
                  ^^^^^^                                                
lib/MyCart.dart:338:19: Error: The getter 'Pinned' isn't defined for the class 'MyCart'.
 - 'MyCart' is from 'package:jahezly/MyCart.dart' ('lib/MyCart.dart').  
Try correcting the name to the name of an existing getter, or defining a getter or field named 'Pinned'.
                  Pinned.fromSize(                                      
                  ^^^^^^                                                
lib/MyCart.dart:356:19: Error: The getter 'Pinned' isn't defined for the class 'MyCart'.
 - 'MyCart' is from 'package:jahezly/MyCart.dart' ('lib/MyCart.dart').  
Try correcting the name to the name of an existing getter, or defining a getter or field named 'Pinned'.
                  Pinned.fromSize(                                      
                  ^^^^^^                                                
lib/MyCart.dart:373:19: Error: The getter 'Pinned' isn't defined for the class 'MyCart'.
 - 'MyCart' is from 'package:jahezly/MyCart.dart' ('lib/MyCart.dart').  
Try correcting the name to the name of an existing getter, or defining a getter or field named 'Pinned'.
                  Pinned.fromSize(                                      
                  ^^^^^^                                                
lib/MyCart.dart:390:19: Error: The getter 'Pinned' isn't defined for the class 'MyCart'.
 - 'MyCart' is from 'package:jahezly/MyCart.dart' ('lib/MyCart.dart').  
Try correcting the name to the name of an existing getter, or defining a getter or field named 'Pinned'.
                  Pinned.fromSize(                                      
                  ^^^^^^                                                
lib/MyCart.dart:524:21: Error: The getter 'Pinned' isn't defined for the class 'MyCart'.
 - 'MyCart' is from 'package:jahezly/MyCart.dart' ('lib/MyCart.dart').  
Try correcting the name to the name of an existing getter, or defining a getter or field named 'Pinned'.
                    Pinned.fromSize(                                    
                    ^^^^^^                                              
lib/MyCart.dart:545:21: Error: The getter 'Pinned' isn't defined for the class 'MyCart'.
 - 'MyCart' is from 'package:jahezly/MyCart.dart' ('lib/MyCart.dart').  
Try correcting the name to the name of an existing getter, or defining a getter or field named 'Pinned'.
                    Pinned.fromSize(                                    
                    ^^^^^^                                              
../../../../Developer/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.17.4/lib/src/picture_stream.dart:167:11: Error: Superclass has no method named 'debugFillProperties'.
    super.debugFillProperties(properties);                              
          ^^^^^^^^^^^^^^^^^^^                                           
../../../../Developer/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.17.4/lib/src/picture_stream.dart:171:30: Error: The method 'toStringShort' isn't defined for the class 'PictureStreamCompleter'.
 - 'PictureStreamCompleter' is from 'package:flutter_svg/src/picture_stream.dart' ('../../../../Developer/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.17.4/lib/src/picture_stream.dart').
Try correcting the name to the name of an existing method, or defining a method named 'toStringShort'.
      ifPresent: _completer?.toStringShort(),                           
                             ^^^^^^^^^^^^^                              
../../../../Developer/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.17.4/lib/src/picture_stream.dart:266:11: Error: Superclass has no method named 'debugFillProperties'.
    super.debugFillProperties(description);                             
          ^^^^^^^^^^^^^^^^^^^                                           
                                                                        
                                                                        
FAILURE: Build failed with an exception.                                
                                                                        
* Where:                                                                
Script '/Users/mbp/Developer/flutter/packages/flutter_tools/gradle/flutter.gradle' line: 896
                                                                        
* What went wrong:                                                      
Execution failed for task ':app:compileFlutterBuildDebug'.              
> Process 'command '/Users/mbp/Developer/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 9s                                                      
Running Gradle task 'assembleDebug'...                                  
Running Gradle task 'assembleDebug'... Done                        11.3s
Exception: Gradle task assembleDebug failed with exit code 1

1 个答案:

答案 0 :(得分:0)

在您的pubspec.yaml中,更新flutter_svg和adobeXD软件包

flutter_svg: ^0.18.0
adobe_xd: ^1.0.0+1

运行flutter cleanflutter pub upgrade

由于发生了错误,原因是在最近的flutter更新中删除了DiagnosticableMixin,这影响了几个使用DiagnosticableMixin的flutter软件包。

该flutter_svg软件包GitHub issue中已指出问题已解决。

Adob​​eXD软件包出现问题是由于您使用了包含Pinned类的较旧版本的软件包

相关问题