简体   繁体   English

获取 Flutter Cupertino_icons 依赖错误

[英]Getting Flutter Cupertino_icons dependency Error

I am getting this error in my project.我在我的项目中收到此错误。 I even created a new plain flutter project but I am getting the same error for that too.我什至创建了一个新的普通颤振项目,但我也遇到了同样的错误。

I even tried clearing the flutter.pub-cache\\hosted\\pub.dartlang.org\\cupertino_icons -****.我什至尝试清除 flutter.pub-cache\\hosted\\pub.dartlang.org\\cupertino_icons -****。 I even tried giving version name specifically.我什至尝试专门给出版本名称。 But still it dowent workRunning "flutter pub get" in abccdddd... 1.0s Launching lib\\main.dart on SM J600G in debug mode... Running Gradle task 'assembleDebug'...但仍然需要在 abccdddd 中运行“flutter pub get”... 1.0s 在调试模式下在 SM J600G 上启动 lib\\main.dart...运行 Gradle 任务 'assembleDebug'...

Compiler message:
../../flutter/.pub-cache/hosted/pub.dartlang.org/cupertino_icons-0.1.3/lib/placeholder.txt:1:1: Error: Variables must be declared using the keywords 'const', 'final', 'var' or a type name.
Try adding the name of the type of the variable or the keyword 'var'.
We:
^^
../../flutter/.pub-cache/hosted/pub.dartlang.org/cupertino_icons-0.1.3/lib/placeholder.txt:1:1: Error: Expected ';' after this.
We:
^^
../../flutter/.pub-cache/hosted/pub.dartlang.org/cupertino_icons-0.1.3/lib/placeholder.txt:1:3: Error: Expected a declaration, but got ':'.
We:
  ^
../../flutter/.pub-cache/hosted/pub.dartlang.org/cupertino_icons-0.1.3/lib/placeholder.txt:2:1: Error: Expected a declaration, but got '-'.
- commit this file in order for git to create a lib/ directory, and
^
../../flutter/.pub-cache/hosted/pub.dartlang.org/cupertino_icons-0.1.3/lib/placeholder.txt:2:10: Error: Expected an identifier, but got 'this'.
- commit this file in order for git to create a lib/ directory, and
         ^^^^
../../flutter/.pub-cache/hosted/pub.dartlang.org/cupertino_icons-0.1.3/lib/placeholder.txt:2:10: Error: Expected ';' after this.
- commit this file in order for git to create a lib/ directory, and
         ^^^^
../../flutter/.pub-cache/hosted/pub.dartlang.org/cupertino_icons-0.1.3/lib/placeholder.txt:2:15: Error: Variables must be declared using the keywords 'const', 'final', 'var' or a type name.
Try adding the name of the type of the variable or the keyword 'var'.
- commit this file in order for git to create a lib/ directory, and
              ^^^^
../../flutter/.pub-cache/hosted/pub.dartlang.org/cupertino_icons-0.1.3/lib/placeholder.txt:2:15: Error: Expected ';' after this.
- commit this file in order for git to create a lib/ directory, and
              ^^^^
../../flutter/.pub-cache/hosted/pub.dartlang.org/cupertino_icons-0.1.3/lib/placeholder.txt:2:20: Error: Variables must be declared using the keywords 'const', 'final', 'var' or a type name.
Try adding the name of the type of the variable or the keyword 'var'.
- commit this file in order for git to create a lib/ directory, and
                   ^^
../../flutter/.pub-cache/hosted/pub.dartlang.org/cupertino_icons-0.1.3/lib/placeholder.txt:2:20: Error: Expected an identifier, but got 'in'.
- commit this file in order for git to create a lib/ directory, and
                   ^^
../../flutter/.pub-cache/hosted/pub.dartlang.org/cupertino_icons-0.1.3/lib/placeholder.txt:2:20: Error: Expected ';' after this.
- commit this file in order for git to create a lib/ directory, and
                   ^^
../../flutter/.pub-cache/hosted/pub.dartlang.org/cupertino_icons-0.1.3/lib/placeholder.txt:2:23: Error: Variables must be declared using the keywords 'const', 'final', 'var' or a type name.
Try adding the name of the type of the variable or the keyword 'var'.
- commit this file in order for git to create a lib/ directory, and
                      ^^^^^
../../flutter/.pub-cache/hosted/pub.dartlang.org/cupertino_icons-0.1.3/lib/placeholder.txt:2:23: Error: Expected ';' after this.
- commit this file in order for git to create a lib/ directory, and
                      ^^^^^
../../flutter/.pub-cache/hosted/pub.dartlang.org/cupertino_icons-0.1.3/lib/placeholder.txt:2:29: Error: Variables must be declared using the keywords 'const', 'final', 'var' or a type name.
Try adding the name of the type of the variable or the keyword 'var'.
- commit this file in order for git to create a lib/ directory, and
                            ^^^
../../flutter/.pub-cache/hosted/pub.dartlang.org/cupertino_icons-0.1.3/lib/placeholder.txt:2:29: Error: Expected an identifier, but got 'for'.
- commit this file in order for git to create a lib/ directory, and
                            ^^^
../../flutter/.pub-cache/hosted/pub.dartlang.org/cupertino_icons-0.1.3/lib/placeholder.txt:2:29: Error: Expected ';' after this.
- commit this file in order for git to create a lib/ directory, and
                            ^^^
../../flutter/.pub-cache/hosted/pub.dartlang.org/cupertino_icons-0.1.3/lib/placeholder.txt:2:37: Error: Expected ';' after this.
- commit this file in order for git to create a lib/ directory, and
                                    ^^
../../flutter/.pub-cache/hosted/pub.dartlang.org/cupertino_icons-0.1.3/lib/placeholder.txt:2:47: Error: Expected ';' after this.
- commit this file in order for git to create a lib/ directory, and
                                              ^
../../flutter/.pub-cache/hosted/pub.dartlang.org/cupertino_icons-0.1.3/lib/placeholder.txt:2:49: Error: Variables must be declared using the keywords 'const', 'final', 'var' or a type name.
Try adding the name of the type of the variable or the keyword 'var'.
- commit this file in order for git to create a lib/ directory, and
                                                ^^^
../../flutter/.pub-cache/hosted/pub.dartlang.org/cupertino_icons-0.1.3/lib/placeholder.txt:2:49: Error: Expected ';' after this.
- commit this file in order for git to create a lib/ directory, and
                                                ^^^
../../flutter/.pub-cache/hosted/pub.dartlang.org/cupertino_icons-0.1.3/lib/placeholder.txt:2:52: Error: Expected a declaration, but got '/'.
- commit this file in order for git to create a lib/ directory, and
                                                   ^
../../flutter/.pub-cache/hosted/pub.dartlang.org/cupertino_icons-0.1.3/lib/placeholder.txt:2:54: Error: Variables must be declared using the keywords 'const', 'final', 'var' or a type name.
Try adding the name of the type of the variable or the keyword 'var'.
- commit this file in order for git to create a lib/ directory, and
                                                     ^^^^^^^^^
../../flutter/.pub-cache/hosted/pub.dartlang.org/cupertino_icons-0.1.3/lib/placeholder.txt:2:65: Error: Expected ';' after this.
- commit this file in order for git to create a lib/ directory, and
                                                                ^^^
../../flutter/.pub-cache/hosted/pub.dartlang.org/cupertino_icons-0.1.3/lib/placeholder.txt:3:1: Error: Expected a declaration, but got '-'.
- want a lib/ directory so pub will create a well-formed .packages file
^
../../flutter/.pub-cache/hosted/pub.dartlang.org/cupertino_icons-0.1.3/lib/placeholder.txt:3:8: Error: Expected ';' after this.
- want a lib/ directory so pub will create a well-formed .packages file
       ^
../../flutter/.pub-cache/hosted/pub.dartlang.org/cupertino_icons-0.1.3/lib/placeholder.txt:3:8: Error: 'a' is already declared in this scope.
- want a lib/ directory so pub will create a well-formed .packages file
       ^
../../flutter/.pub-cache/hosted/pub.dartlang.org/cupertino_icons-0.1.3/lib/placeholder.txt:2:47: Context: Previous declaration of 'a'.
- commit this file in order for git to create a lib/ directory, and
                                              ^
../../flutter/.pub-cache/hosted/pub.dartlang.org/cupertino_icons-0.1.3/lib/placeholder.txt:3:10: Error: Variables must be declared using the keywords 'const', 'final', 'var' or a type name.
Try adding the name of the type of the variable or the keyword 'var'.
- want a lib/ directory so pub will create a well-formed .packages file
         ^^^
../../flutter/.pub-cache/hosted/pub.dartlang.org/cupertino_icons-0.1.3/lib/placeholder.txt:3:10: Error: Expected ';' after this.
- want a lib/ directory so pub will create a well-formed .packages file
         ^^^
../../flutter/.pub-cache/hosted/pub.dartlang.org/cupertino_icons-0.1.3/lib/placeholder.txt:3:10: Error: 'lib' is already declared in this scope.
- want a lib/ directory so pub will create a well-formed .packages file
         ^^^
../../flutter/.pub-cache/hosted/pub.dartlang.org/cupertino_icons-0.1.3/lib/placeholder.txt:2:49: Context: Previous declaration of 'lib'.
- commit this file in order for git to create a lib/ directory, and
                                                ^^^
../../flutter/.pub-cache/hosted/pub.dartlang.org/cupertino_icons-0.1.3/lib/placeholder.txt:3:13: Error: Expected a declaration, but got '/'.
- want a lib/ directory so pub will create a well-formed .packages file
            ^
../../flutter/.pub-cache/hosted/pub.dartlang.org/cupertino_icons-0.1.3/lib/placeholder.txt:3:25: Error: Expected ';' after this.
- want a lib/ directory so pub will create a well-formed .packages file
                        ^^
../../flutter/.pub-cache/hosted/pub.dartlang.org/cupertino_icons-0.1.3/lib/placeholder.txt:3:32: Error: Expected ';' after this.
- want a lib/ directory so pub will create a well-formed .packages file
                               ^^^^
../../flutter/.pub-cache/hosted/pub.dartlang.org/cupertino_icons-0.1.3/lib/placeholder.txt:3:44: Error: Expected ';' after this.
- want a lib/ directory so pub will create a well-formed .packages file
                                           ^
../../flutter/.pub-cache/hosted/pub.dartlang.org/cupertino_icons-0.1.3/lib/placeholder.txt:3:44: Error: 'a' is already declared in this scope.
- want a lib/ directory so pub will create a well-formed .packages file
                                           ^
../../flutter/.pub-cache/hosted/pub.dartlang.org/cupertino_icons-0.1.3/lib/placeholder.txt:3:8: Context: Previous declaration of 'a'.
- want a lib/ directory so pub will create a well-formed .packages file
       ^
../../flutter/.pub-cache/hosted/pub.dartlang.org/cupertino_icons-0.1.3/lib/placeholder.txt:3:46: Error: Variables must be declared using the keywords 'const', 'final', 'var' or a type name.
Try adding the name of the type of the variable or the keyword 'var'.
- want a lib/ directory so pub will create a well-formed .packages file
                                             ^^^^
../../flutter/.pub-cache/hosted/pub.dartlang.org/cupertino_icons-0.1.3/lib/placeholder.txt:3:46: Error: Expected ';' after this.
- want a lib/ directory so pub will create a well-formed .packages file
                                             ^^^^
../../flutter/.pub-cache/hosted/pub.dartlang.org/cupertino_icons-0.1.3/lib/placeholder.txt:3:50: Error: Expected a declaration, but got '-'.
- want a lib/ directory so pub will create a well-formed .packages file
                                                 ^
../../flutter/.pub-cache/hosted/pub.dartlang.org/cupertino_icons-0.1.3/lib/placeholder.txt:3:68: Error: Expected ';' after this.
- want a lib/ directory so pub will create a well-formed .packages file
                                                                   ^^^^
../../flutter/.pub-cache/hosted/pub.dartlang.org/cupertino_icons-0.1.3/lib/placeholder.txt:3:68: Error: 'file' is already declared in this scope.
- want a lib/ directory so pub will create a well-formed .packages file
                                                                   ^^^^
../../flutter/.pub-cache/hosted/pub.dartlang.org/cupertino_icons-0.1.3/lib/placeholder.txt:2:15: Context: Previous declaration of 'file'.
- commit this file in order for git to create a lib/ directory, and
              ^^^^
../../flutter/.pub-cache/hosted/pub.dartlang.org/cupertino_icons-0.1.3/lib/placeholder.txt:2:3: Error: Type 'commit' not found.
- commit this file in order for git to create a lib/ directory, and
  ^^^^^^
../../flutter/.pub-cache/hosted/pub.dartlang.org/cupertino_icons-0.1.3/lib/placeholder.txt:2:33: Error: Type 'git' not found.
- commit this file in order for git to create a lib/ directory, and
                                ^^^
../../flutter/.pub-cache/hosted/pub.dartlang.org/cupertino_icons-0.1.3/lib/placeholder.txt:2:40: Error: Type 'create' not found.
- commit this file in order for git to create a lib/ directory, and
                                       ^^^^^^
../../flutter/.pub-cache/hosted/pub.dartlang.org/cupertino_icons-0.1.3/lib/placeholder.txt:3:3: Error: Type 'want' not found.
- want a lib/ directory so pub will create a well-formed .packages file
  ^^^^
../../flutter/.pub-cache/hosted/pub.dartlang.org/cupertino_icons-0.1.3/lib/placeholder.txt:3:15: Error: 'directory' isn't a type.
- want a lib/ directory so pub will create a well-formed .packages file
              ^^^^^^^^^
../../flutter/.pub-cache/hosted/pub.dartlang.org/cupertino_icons-0.1.3/lib/placeholder.txt:2:54: Context: This isn't a type.
- commit this file in order for git to create a lib/ directory, and
                                                     ^^^^^^^^^
../../flutter/.pub-cache/hosted/pub.dartlang.org/cupertino_icons-0.1.3/lib/placeholder.txt:3:28: Error: Type 'pub' not found.
- want a lib/ directory so pub will create a well-formed .packages file
                           ^^^
../../flutter/.pub-cache/hosted/pub.dartlang.org/cupertino_icons-0.1.3/lib/placeholder.txt:3:37: Error: Type 'create' not found.
- want a lib/ directory so pub will create a well-formed .packages file
                                    ^^^^^^
../../flutter/.pub-cache/hosted/pub.dartlang.org/cupertino_icons-0.1.3/lib/placeholder.txt:3:51: Error: Type 'formed.packages' not found.
- want a lib/ directory so pub will create a well-formed .packages file
                                                  ^^^^^^^^^^^^^^^^
../../flutter/.pub-cache/hosted/pub.dartlang.org/cupertino_icons-0.1.3/lib/placeholder.txt:2:3: Error: 'commit' isn't a type.
- commit this file in order for git to create a lib/ directory, and
  ^^^^^^
../../flutter/.pub-cache/hosted/pub.dartlang.org/cupertino_icons-0.1.3/lib/placeholder.txt:2:33: Error: 'git' isn't a type.
- commit this file in order for git to create a lib/ directory, and
                                ^^^
../../flutter/.pub-cache/hosted/pub.dartlang.org/cupertino_icons-0.1.3/lib/placeholder.txt:2:40: Error: 'create' isn't a type.
- commit this file in order for git to create a lib/ directory, and
                                       ^^^^^^
../../flutter/.pub-cache/hosted/pub.dartlang.org/cupertino_icons-0.1.3/lib/placeholder.txt:3:3: Error: 'want' isn't a type.
- want a lib/ directory so pub will create a well-formed .packages file
  ^^^^
../../flutter/.pub-cache/hosted/pub.dartlang.org/cupertino_icons-0.1.3/lib/placeholder.txt:3:28: Error: 'pub' isn't a type.
- want a lib/ directory so pub will create a well-formed .packages file
                           ^^^
../../flutter/.pub-cache/hosted/pub.dartlang.org/cupertino_icons-0.1.3/lib/placeholder.txt:3:37: Error: 'create' isn't a type.
- want a lib/ directory so pub will create a well-formed .packages file
                                    ^^^^^^
../../flutter/.pub-cache/hosted/pub.dartlang.org/cupertino_icons-0.1.3/lib/placeholder.txt:3:51: Error: 'formed.packages' can't be used as a type because 'formed' isn't defined.
- want a lib/ directory so pub will create a well-formed .packages file
                                                  ^^^^^^^^^^^^^^^^
Target kernel_snapshot failed: Exception: Errors during snapshot creation: null
build failed.

FAILURE: Build failed with an exception.

* Where:
Script 'E:\Flutter Apps\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 780

* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> Process 'command 'E:\Flutter Apps\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

在此处输入图片说明

Any help is really appreciated任何帮助真的很感激

I opened .pub-cache/hosted/pub.dartlang.org/cupertino_icons-0.1.3/lib/placeholder.txt file and cleared it.我打开 .pub-cache/hosted/pub.dartlang.org/cupertino_icons-0.1.3/lib/placeholder.txt 文件并清除它。 And it started working for me.它开始为我工作。 Really odd, but it did.真的很奇怪,但确实如此。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM