简体   繁体   English

Flutter 包获取:不工作

[英]Flutter package get: not working

i think it might be a problem with my specific flutter tho im not sure, i will be glad to get help!我认为这可能是我的特定颤振有问题,但我不确定,我很乐意获得帮助! I tried to run a simple firebase_auth: ^0.5.5 on my dependencies: in that order: dependencies: flutter: sdk: flutter firebase_auth: ^0.5.5我试图在我的dependencies:上运行一个简单的firebase_auth: ^0.5.5 dependencies:按照这个顺序: dependencies: flutter: sdk: flutter firebase_auth: ^0.5.5

but i get this string in the Debug Console:但我在调试控制台中得到了这个字符串:

[login_register_3] flutter packages get
fatal: bad config line 1 in file .git/config
Updating flutter tool...

Oops; flutter has exited unexpectedly.
Sending crash report to Google.
Failed to send crash report. Server responded with HTTP status code 400
Unhandled exception:
NoSuchMethodError: The getter 'environment' was called on null.
Receiver: null
Tried calling: environment
#0      Object.noSuchMethod (dart:core-patch/dart:core/object_patch.dart:46)
#1      AndroidWorkflow.validate (package:flutter_tools/src/android/android_workflow.dart:79)
<asynchronous suspension>
#2      Doctor.startValidatorTasks (package:flutter_tools/src/doctor.dart:71)
#3      Doctor.diagnose (package:flutter_tools/src/doctor.dart:128)
<asynchronous suspension>
#4      _doctorText.<anonymous closure> (package:flutter_tools/runner.dart:237)
#5      AppContext._run (package:flutter_tools/src/base/context.dart:76)
<asynchronous suspension>
#6      AppContext.runInZone.<anonymous closure> (package:flutter_tools/src/base/context.dart:66)
#7      _rootRun (dart:async/zone.dart:1126)
#8      _CustomZone.run (dart:async/zone.dart:1023)
#9      runZoned (dart:async/zone.dart:1501)
#10     AppContext.runInZone (package:flutter_tools/src/base/context.dart:65)
#11     _doctorText (package:flutter_tools/runner.dart:237)
<asynchronous suspension>
#12     _createLocalCrashReport (package:flutter_tools/runner.dart:212)
<asynchronous suspension>
#13     _handleToolError (package:flutter_tools/runner.dart:167)
<asynchronous suspension>
#14     run.<anonymous closure> (package:flutter_tools/runner.dart:94)
<asynchronous suspension>
#15     AppContext._run (package:flutter_tools/src/base/context.dart:76)
<asynchronous suspension>
#16     AppContext.runInZone.<anonymous closure> (package:flutter_tools/src/base/context.dart:66)
#17     _rootRun (dart:async/zone.dart:1126)
#18     _CustomZone.run (dart:async/zone.dart:1023)
#19     runZoned (dart:async/zone.dart:1501)
#20     AppContext.runInZone (package:flutter_tools/src/base/context.dart:65)
#21     run (package:flutter_tools/runner.dart:61)
<asynchronous suspension>
#22     main (package:flutter_tools/executable.dart:48)
<asynchronous suspension>
#23     main (file:///c:/flutter/packages/flutter_tools/bin/flutter_tools.dart:16)
#24     _startIsolate.<anonymous closure> (dart:isolate-patch/dart:isolate/isolate_patch.dart:277)
#25     _RawReceivePortImpl._handleMessage (dart:isolate-patch/dart:isolate/isolate_patch.dart:165)
exit code 255

Now, this error accoures each time i try to run a flutter package even $ flutter doctor , so i dont know where to pin the problem at!现在,每次我尝试运行颤振包时都会出现此错误,甚至$ flutter doctor ,所以我不知道将问题固定在哪里! Much apparition in advanced先进的许多幻象

以与其他包相同的对齐方式编写包并使用此代码,以获取包。

flutter packages get

I think the problem about your project or flutter git config.我认为是关于您的项目或 flutter git config 的问题。 You can look this reply for this station.你可以看看这个站的回复。

For those hitting into this issue (I believe it's due to crashing out git mid init?) in windows, if you have a recent backup of the config file from your git repo's .git/ folder you can fix it by replacing the existing with it (any ref's added since the copy will obviously need re-adding) - not at all ideal but better than loosing all the commits.对于那些在 Windows 中遇到此问题的人(我认为这是由于 git mid init 崩溃?),如果您最近从 git repo 的 .git/ 文件夹中备份了配置文件,则可以通过用它替换现有文件来修复它(添加任何引用,因为副本显然需要重新添加) - 一点也不理想,但比丢失所有提交要好。

从颤振终端运行颤振包

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

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