I have solution/flutter app running on windows fine. Within the .packages file vscode is referencing the package via
analyzer:file:///c:/flutter/.pub-cache/hosted/pub.dartlang.org/analyzer-0.31.2-alpha.2/lib/
args:file:///c:/flutter/.pub-cache/hosted/pub.dartlang.org/args-1.4.3/lib/
async:file:///c:/flutter/.pub-cache/hosted/pub.dartlang.org/async-2.0.7/lib/
...
I have the flutter sdk installed c:\flutter directory on windows.
I copied this solution via dropbox to the mac and when running
"Warning! This package referenced a Flutter repository via the .packages file that is no longer available".
In an effort to isolate/locate the problem, I created a new Flutter project on the mac and found that the .packages file referenced packages via
analyzer:file:///flutter/.pub-cache/hosted/pub.dartlang.org/analyzer-0.31.2-alpha.2/lib/
args:file:///flutter/.pub-cache/hosted/pub.dartlang.org/args-1.4.3/lib/
async:file:///flutter/.pub-cache/hosted/pub.dartlang.org/async-2.0.7/lib/
...
Notice the different paths used on both systems.
I suspect I can search/replace the references file:///c:/flutter to file:///flutter and it should work but I would like to avoid always manually swapping out locations. Is there an easier approach when sharing solutions across mac and windows?
thx
If you see this error there are several solutions: 1) Instead of right clicking on the file to extract it, left click on the file to enter the zip directly. Then look for long folder names and make them shorter. Then close the zip file and extract it again.
Workaround 1: Reduce the character count Rename the file so that it has a shorter name. Rename one or more folders that contain the file so that they have shorter names. Move the file to a folder that has a shorter path name.
To fix a broken project reference by correcting the reference path. In Solution Explorer, right-click your project node, and then select Properties. The Project Designer appears. If you're using Visual Basic, select the References page, and then click the Reference Paths button.
Don't copy .packages
over from one machine to another. (It should be in .gitignore
if using git.)
Instead, run flutter packages get
on the mac, and it will recreate .packages
.
(Don't copy .flutter-plugins
either.)
Just remove .packages
file. It will do the trick. Or you can clear the .packages
file.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With