简体   繁体   中英

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

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! Much apparition in advanced

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

flutter packages get

I think the problem about your project or 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.

从颤振终端运行颤振包

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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