English 中文(简体)
Invalid depfile: 氟化物
原标题:Invalid depfile: Flutter

I am following a tutorial from a udemy course and recently I built a new pc so the hard drive that stored my code is secondary right now. When I compile the code, it gives me the following error. To explain it better, I am posting a picture of one warning in my code but I am pretty sure it is an error flutter is making as it usually does with imports. Error in Code I have tried running a test app by making a default app from cmd and that works fine. So obviously, flutter doctor shows no error. the error is repetitive and long so I am pasting some of it below.

The error-

Invalid depfile: D:WorkSpaceCodeFlutterImage Appimage_app.dart_toolflutter_build8f0d0eee9ef614ed024ca7691a333af8kernel_snapshot.d
Invalid depfile: D:WorkSpaceCodeFlutterImage Appimage_app.dart_toolflutter_build8f0d0eee9ef614ed024ca7691a333af8kernel_snapshot.d

Compiler message:
Error: Could not resolve the package  http  in  package:http/http.dart .
lib/src/app.dart:5:8: Error: Expected  ;  after this.
import  widgets/image_list.dart; 
       ^^^^^^^^^^^^^^^^^^^^^^^^^^
lib/src/app.dart:2:8: Error: Not found:  package:http/http.dart 
import  package:http/http.dart  show get; //Only need get so we only care about one Get fuction
       ^
lib/src/app.dart:5:8: Error: Error when reading  lib/src/widgets/image_list.dart; : The system cannot find the file specified.

import  widgets/image_list.dart; 
       ^
/C:/src/flutter/packages/flutter/lib/src/material/bottom_navigation_bar.dart:9:8: Error: Error when reading  /C:/Users/dluck/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/vector_math-2.0.8/lib/vector_math_64.dart : The system cannot find the path specified.

import  package:vector_math/vector_math_64.dart  show Vector3;
       ^
/C:/src/flutter/packages/flutter/lib/widgets.dart:15:1: Error: Error when reading  /C:/Users/dluck/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/vector_math-2.0.8/lib/vector_math_64.dart : The system cannot find the path specified.

export  package:vector_math/vector_math_64.dart  show Matrix4;
^
/C:/src/flutter/packages/flutter/lib/rendering.dart:31:1: Error: Error when reading  /C:/Users/dluck/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/vector_math-2.0.8/lib/vector_math_64.dart : The system cannot find the path specified.

export  package:vector_math/vector_math_64.dart  show Matrix4;
^
/C:/src/flutter/packages/flutter/lib/src/widgets/implicit_animations.dart:8:8: Error: Error when reading  /C:/Users/dluck/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/vector_math-2.0.8/lib/vector_math_64.dart : The system cannot find the path specified.

import  package:vector_math/vector_math_64.dart ;
       ^
/C:/src/flutter/packages/flutter/lib/src/widgets/transitions.dart:8:8: Error: Error when reading  /C:/Users/dluck/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/vector_math-2.0.8/lib/vector_math_64.dart : The system cannot find the path specified.

import  package:vector_math/vector_math_64.dart  show Matrix4;
       ^
/C:/src/flutter/packages/flutter/lib/src/widgets/widget_inspector.dart:27:8: Error: Error when reading  /C:/Users/dluck/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/vector_math-2.0.8/lib/vector_math_64.dart : The system cannot find the path specified.

import  package:vector_math/vector_math_64.dart ;
       ^
/C:/src/flutter/packages/flutter/lib/foundation.dart:12:1: Error: Error when reading  /C:/Users/dluck/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/meta-1.1.8/lib/meta.dart : The system cannot find the path specified.

C:/src/flutter/packages/flutter/lib/src/foundation/node.dart:90:4: Error: Getter not found:  mustCallSuper .
  @mustCallSuper
   ^^^^^^^^^^^^^
/C:/src/flutter/packages/flutter/lib/src/foundation/node.dart:90:4: Error: This can t be used as metadata; metadata should be a reference to a compile-time constant variable, or a call to a constant constructor.
  @mustCallSuper
   ^
/C:/src/flutter/packages/flutter/lib/src/foundation/node.dart:104:4: Error: Getter not found:  mustCallSuper .
  @mustCallSuper
   ^^^^^^^^^^^^^
/C:/src/flutter/packages/flutter/lib/src/foundation/node.dart:104:4: Error: This can t be used as metadata; metadata should be a reference to a compile-time constant variable, or a call to a constant constructor.
  @mustCallSuper
   ^
/C:/src/flutter/packages/flutter/lib/src/foundation/node.dart:118:4: Error: Getter not found:  protected .
  @protected
   ^^^^^^^^^
/C:/src/flutter/packages/flutter/lib/src/foundation/node.dart:118:4: Error: This can t be used as metadata; metadata should be a reference to a compile-time constant variable, or a call to a constant constructor.
  @protected
   ^
/C:/src/flutter/packages/flutter/lib/src/foundation/node.dart:119:4: Error: Getter not found:  mustCallSuper .
  @mustCallSuper
   ^^^^^^^^^^^^^
/C:/src/flutter/packages/flutter/lib/src/foundation/node.dart:119:4: Error: This can t be used as metadata; metadata should be a reference to a compile-time constant variable, or a call to a constant constructor.
  @mustCallSuper
   ^
/C:/src/flutter/packages/flutter/lib/src/foundation/node.dart:139:4: Error: Getter not found:  protected .
  @protected
   ^^^^^^^^^

C:/src/flutter/packages/flutter/lib/src/semantics/semantics.dart:3970:4: Error: This can t be used as metadata; metadata should be a reference to a compile-time constant variable, or a call to a constant constructor.
  @required TextDirection thisTextDirection,
   ^
/C:/src/flutter/packages/flutter/lib/src/semantics/semantics.dart:3971:4: Error: Getter not found:  required .
  @required TextDirection otherTextDirection,
   ^^^^^^^^
/C:/src/flutter/packages/flutter/lib/src/semantics/semantics.dart:3971:4: Error: This can t be used as metadata; metadata should be a reference to a compile-time constant variable, or a call to a constant constructor.
  @required TextDirection otherTextDirection,
   ^
U
nhandled exception:
FileSystemException(uri=org-dartlang-untranslatable-uri:
package%3Ahttp%2Fhttp.dart; message=StandardFileSystem only supports file:* and data:* URIs)
#0      StandardFi
leSystem.entityForUri (package:front_end/src/api_prototype/standard_file_system.dart:33:7)
#1      asFileU
ri (package:vm/kernel_front_end.dart:604:37)
#
2      writeDepfile (package:vm/kernel_front
_end.dart:799:21)
<asynchronous suspension>
#
3      FrontendCompiler.compile (package:fron
tend_server/frontend_server.dart:472:15)
<asynchronous 
suspension>
#4      _FlutterFrontendCompiler.comp
ile (package:flutter_frontend_server/server.dar
t:38:22)
#5      starter (package:flutter_fronte
nd_server/server.dart:149:27)
#6      main (f
ile:///C:/b/s/w/ir/cache/builder/src/flutter/fl
utter_frontend_server/bin/starter.dart:8:30)
#7    
  _startIsolate.<anonymous closure> (dart:isol
ate-patch/isolate_patch.dart:305:32)
#8      _RawRec
eivePortImpl._handleMessage (dart:isolate-patch
/isolate_patch.dart:174:12)

Target kernel_snapshot failed: Exception: Errors during snapshot creation: null
build failed.

FAILURE: Build failed with an exception.

* Where:
Script  C:srcflutterpackagesflutter_toolsgradleflutter.gradle  line: 780

* What went wrong:
Execution failed for task  :app:compileFlutterBuildDebug .
> Process  command  C:srcflutterinflutter.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

BUILD FAILED in 6s
Gradle task assembleDebug failed with exit code 1
Exited (sigterm)
最佳回答

Okay so I found out since I changed the PC, I needed to change permissions of a file. Follow here https://github.com/simolus3/moor/issues/224

问题回答

Sometimes it happens to me too. I either deleted the converted code or converted it command For example here I entered:

import  dart:html ;

, 我的错误在删除后被固定下来,或者将其变为评论。

// import  dart:html ;

I got the same error and I am following a udemy course as well.
I tried flutter pub get and it worked.

i also faced the same problem and i sort out by running "flutter clean" command. https://github.com/flutter/flutter/issues/21053

you need clean the project run "flutter Clean" in the project and later run the project normal

Invalid depfile: D:...f5.dart_toolflutter_build8e234dd4da26339b660f6097cc2a271akernel_snapshot.d

删除kernel_snapshot.dkernel_snapshot.stamp/code>,该地点档案:

your flutter project.dart_toolflutter_build8e234dd4da26339b660f6097cc2a271a

I face similar problem I solved it by deleting import dart:html ; from top of the dart file. i.e remove import dart:html ;

我有同样的ug,我停职。 当我重新启用时,我只是打字。

flutter clean

flutter pub get 

flutter run

一切工作已经开始。

同样,你可以采取两个步骤解决这一问题。

1. flutter clean
2. flutter pub get

在管理这些指挥之后,它应当确定你的问题。

和你们许多人一样,我尝试了这里所提到的几乎所有事情和其他几个StackOverflow员额。 但我没有任何工作。

我发现的建筑错误是:

Launching lib/main.dart on iPhone 12 Pro Max in debug mode...
Running Xcode build...
Xcode build done.                                           17.6s
Failed to build iOS app
Error output from Xcode build:
↳
    ** BUILD FAILED **


Xcode s output:
↳
    Invalid depfile: /Users/MY_APP_NAME/PACKAGE_NAME/app/.dart_tool/flutter_build/9a159911376355ed7b90130da2eaf0aa/kernel_snapshot.d
    Invalid depfile: /Users/MY_APP_NAME/PACKAGE_NAME/app/.dart_tool/flutter_build/9a159911376355ed7b90130da2eaf0aa/kernel_snapshot.d
    Invalid depfile: /Users/MY_APP_NAME/PACKAGE_NAME/app/.dart_tool/flutter_build/9a159911376355ed7b90130da2eaf0aa/kernel_snapshot.d
    Invalid depfile: /Users/MY_APP_NAME/PACKAGE_NAME/app/.dart_tool/flutter_build/9a159911376355ed7b90130da2eaf0aa/kernel_snapshot.d
    Error: Couldn t resolve the package  shared_preferences  in  package:shared_preferences/shared_preferences.dart .
    ../lib/ui/home/home_screen.dart:29:8: Error: Not found:  package:shared_preferences/shared_preferences.dart 
    import  package:shared_preferences/shared_preferences.dart ;
           ^
    ../lib/ui/home/home_screen.dart:871:37: Error: The getter  SharedPreferences  isn t defined for the class  _HomeScreenState .
     -  _HomeScreenState  is from  package:PACKAGE_NAME/ui/home/home_screen.dart  ( ../lib/ui/home/home_screen.dart ).
    Try correcting the name to the name of an existing getter, or defining a getter or field named  SharedPreferences .
        final sharedPreferences = await SharedPreferences.getInstance();
                                        ^^^^^^^^^^^^^^^^^
    ../lib/ui/home/home_screen.dart:893:37: Error: The getter  SharedPreferences  isn t defined for the class  _HomeScreenState .
     -  _HomeScreenState  is from  package:PACKAGE_NAME/ui/home/home_screen.dart  ( ../lib/ui/home/home_screen.dart ).
    Try correcting the name to the name of an existing getter, or defining a getter or field named  SharedPreferences .
        final sharedPreferences = await SharedPreferences.getInstance();
                                        ^^^^^^^^^^^^^^^^^
    Unhandled exception:
    FileSystemException(uri=org-dartlang-untranslatable-uri:package%3Ashared_preferences%2Fshared_preferences.dart; message=StandardFileSystem only supports file:* and data:* URIs)
    #0      StandardFileSystem.entityForUri (package:front_end/src/api_prototype/standard_file_system.dart:34:7)
    #1      asFileUri (package:vm/kernel_front_end.dart:614:37)
    #2      writeDepfile (package:vm/kernel_front_end.dart:754:21)
    <asynchronous suspension>
    #3      FrontendCompiler.compile (package:frontend_server/frontend_server.dart:570:9)
    <asynchronous suspension>
    #4      starter (package:flutter_frontend_server/server.dart:85:12)
    <asynchronous suspension>
    #5      main (file:///opt/s/w/ir/cache/builder/src/flutter/flutter_frontend_server/bin/starter.dart:13:24)
    <asynchronous suspension>
    Failed to package /Users/MY_APP_NAME/PACKAGE_NAME/app.
    Command PhaseScriptExecution failed with a nonzero exit code
    note: Using new build system
    note: Building targets in parallel
    note: Planning build
    note: Analyzing workspace
    note: Constructing build description
    note: Build preparation complete
    /Users/MY_APP_NAME/PACKAGE_NAME/app/ios/Pods/Pods.xcodeproj: warning: The iOS Simulator deployment target  IPHONEOS_DEPLOYMENT_TARGET  is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.5.99. (in target  AppAuth  from project  Pods )
    /Users/MY_APP_NAME/PACKAGE_NAME/app/ios/Pods/Pods.xcodeproj: warning: The iOS Simulator deployment target  IPHONEOS_DEPLOYMENT_TARGET  is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.5.99. (in target  GoogleSignIn  from project  Pods )

Could not build the application for the simulator.
Error launching application on iPhone 12 Pro Max.

寻找有希望的解决办法之一,是删除两个文件:kernel_snapshot.dkernel_snapshot.stamp。 然而,这也给我工作了。 但我走到了这两个档案居住的道路。 您可在以下屏幕上查看文件夹和档案结构:

The folders and files I deleted

因此,我实际上删除了在以下屏幕上挑选的这些档案,然后试图像通常那样操作模拟器。 而且,它发挥了作用。

虽然你撰写了该守则,但该图书馆本身也在进口。 (进口dart:html) 造成一些问题。 您可将其从法典中删除。

I experienced this. At first you have to check if you added the related dependencies on the pubspec.yaml file like below:

网址:socket case=>

(《政府公报》)

dependencies: web_socket_channel: ^1.1.0
flutter: sdk:flutter

如果你重读VS代码“try flutter Clean,则flutterpr

我的错误完全相同,后来发现,我只从网上进口了我国的共和国档案。

在我的案件中。

firebase: ^5.0.0

这只供网络使用。

I figured that out the issue was caused by import package:firebase/firebase.dart ; in my project to Fix it delete that import

就我而言,我有同样的问题和解决办法:

flutter clean . 
 
flutter create .

这是我总是试图解决几乎任何问题的一种解决办法,如果我看不到这个问题的话。

更仔细地看你是否增加了这种进口?

    import  package:firebase/firebase.dart ;

如果是的话,那是网上的。 如果你书写移动申请,那么最好使用这种进口:

    import  package:firebase_auth/firebase_auth.dart ;

This could be a potential error.

检查任何与<<>载荷或>有关的任何进口,如果您的目标平台是流动的,你可能不需要浏览器进口,你可以去除。

In my case, I have removed this.

import  package:dart_web3/browser.dart ;

有些人找到了办法,删除了从中弹片到头盔。

Well, I did but error not gone. What i did else is to check other errors and other errors was coming from Stripe Package. So i commented like this #flutter_stripe ^2.1.1 on pubspec.yaml and also, do Pub get: Note : Any error you see after commented or removed sdk package on pubs make sure you remove those errors else, after that, clean build folder on xcode and run pod install. The error gone. For you and anyone else, check other errors below the red or yellow highlight on Xcode. You may see other error which may not shown on Buldtime Nav. also make sure you use the latest Xcode Version.

它很容易。 周围的路是看上主页或主页,评论或删除进口dart.html,并节省费用,然后流出。 你们应当善待。

Before running flutter pub get

亲爱,例如,或你指的......

C:UsersAdministratorAppDataLocalPubCachehostedpub.dev

寻找存在错失的依赖,然后删除。

之后,pub开始重新卸下。

flutter pub get

Fixing problems in "Dart Analysis" tab solved the problem enter image description here

我补充说,它将执行这项法典。

import  package:flutter/material.dart  show BuildContext, Colors, Column, Expanded, Key, MainAxisAlignment, MaterialApp, Row, Scaffold, Size, SizedBox, StatelessWidget, Text, TextButton, Widget, runApp;




相关问题
Oracle: how to disable table compression on dmp file import

I have dmp file that was created by EXP utility. The source database has table compression enabled. How can I disable compression while importing dmp file. The destination database does not have ...

import feedparser works via SSH, but fails when in browser

I installed feedparser via SSH, using $ python setup.py install --home=~/httpdocs/python-libraries/feedparser-4.1/ I did that because I don t seem to have permission to properly run python setup.py ...

How to import existing ROR project?

I m new to Ruby on Rails (PHP developer here) and I need to edit an existing ROR project. I ve been using Aptana Studio for my PHP projects (switched to Zend after Aptana 2.0) but I ve kept Aptana ...

Circular #import/@class problem in ObjectiveC

I m going to use an example to properly illustrate my confusion. I can t quite wrap my head around this. In Cocoa touch, we have UIViewController and its subclass, UINavigationController. Now, UIVC ...

C# GemBox Excel Import Error

I am trying to import an excel file into a data table using GemBox and I keep getting this error: Invalid data value when extracting to DataTable at SourceRowIndex: 1, and SourceColumnIndex: 1. As ...

Importing from excel "applications" using SSIS

I am looking for any tips or resources on importing from excel into a SQL database, but specifically when the information is NOT in column and row format. I am currently doing some pre-development ...