Pub does not download dependencies on Windows 7 after the update to lib v2 (SDK 0.3.1_r17328) - dart

After the update to the version 0.3.1_r17328 of Dart SDK and Dart Editor I have some trouble to import some library particulary Args library. I have the same problem both directly importing Args or importing Web_ui where Args is one of the dependencies.
Here is my pubspec.yaml:
name: notes
description: A sample application
dependencies:
web_ui: 0.3.0+1
or:
name: notes
description: A sample application
dependencies:
args: 0.3.1+1
Here is the error generate from build.dart
Unable to open file: C:/Users/Fabio/Dropbox/progetti/note/packages/args/args.dart'package:web_ui/component_build.dart': Error: line 25 pos 1: library handler failed
import 'package:args/args.dart';
'file:///C:/Users/Fabio/Dropbox/progetti/note/build.dart': Error: line 1 pos 1: library handler failed
import 'package:web_ui/component_build.dart';

I solved the problem. It seems that the Cache folder (Pub) has been corrupted.
I have deleted the folder Cache: C:\Users\<UserName>\AppData\Roaming\Pub
Then i run pub install from command line and it works.

Unfortunately, I was getting the same error with my windows XP machine.
In the end, I logged into my windows 7 machine and was able to
download the packages, zipped them up and pasted the libraries into my
windows XP dart editor. Success!
I had no reason to believe I had the exact proxy issue #shindokaku had as I am using my home computer.
I tried all the suggestions on deleting the .cache files, pub.lock files and the packages folder and retrying. I uninstalled dart editor and tried again. I also tried using the git resources to download web-ui and running commands through the command line to no avail
Including suggestions in this similar questions:
cannot-find-referenced-source-packages
is-there-a-workaround-for-pub-dependency-resolution-through-proxies

This problem has been haunting me over and over for a few weeks. I am not using Windows, so this answer is not intended to help the original poster who is using Windows 7.
If you are using Linux here are the steps I use to repair corrupted pub cache.
Go to the top level directory of your app. You should see at least pubspec.lock, pubspec.yaml, a folder named packages, and a folder named web.
Delete your pubspec.lock, and packages folder.
[Make sure you aren't storing your own libraries in the packages folder]
cd ~/dart/myApp/
rm -r packages
rm pubspec.lock
Now once you have removed these files:
pub cache repair
Note 1: if your dart-sdk is not in your systems $PATH, than you will want to use the absolute path to the sdk when using the above command. Comment if you need that explained.
Note 2: This is working solution with Dart 1.5.3. I have not tested this on earlier versions.

Try deleting your pubspec.lock file and packages directory in the root folder of the project. Then run pub install again, when things get wacky thats what I do.

You should try to run pub update. I have sometimes found that this doesn't work as expected from the editor, but generally works quite smoothly when called from the command line.

Related

Can't build on Xcode using 'capacitor js' commands

I'm practicing capacitor js, and was able successfully to package the (html, css & js) files and build them on 'android studio' according to the commands on 'https://capacitorjs.com/docs/android'.
Yet when i powered up macOS version 10.14 on VMware and tried to do the same steps 'https://capacitorjs.com/docs/ios' to build on Xcode, the following warnings and errors occured...
Bugs
I traced the path written in the error and couldn't find neither file nor folder named Pods....
The App folder
I'm using XCode version 11.3 and did install 'Node.js & Xcode command line tools' as mentioned as "capacitor js requirements" on the documentation, also installed CocoaPods.
It's my first time using macOS so I might have missed some additional steps that needed to be done.
Would be very thankful if anyone could guide me through that bug.
Looks like you've openend the .xcodeproj file. Don't do that, use the .xcworkspace exclusively. Also, if you don't have a Pods folder, you probably forgot to run pod install
Thanks to Gereon the step that was missing is to use the command pod install on the 'App' folder that has the 'Podfile.txt', it will extract some extra files including the required Pods folder.
App Folder After Using pod install
If after building you faced the following error...
failed to initiate service connection to simulator
Just clean the build folder and run again.
To clean the build folder you can use the shortcut Command+Option+Shift+K or Menu Bar → Product → Hold Option Key → Clean build Folder.

Error : File `l3backend-pdfmode.def' not found. }

I am trying to compile a .tex document into a pdf in TexStudio (and I have also tried in MikTex) and the following error is outputted File l3backend-pdfmode.def not found. I have tried downloading 13backend package but no luck. Do I need to place the package in a specific folder?
I had the same problem, turned out my miktex library was out-of-date
I opened "miktex console" and updated it.
I incurred into the same issue slightly after an upgrade from Debian 10 to Debian 11. For me, removing all the .texlive* directories from my home folder solved it
mv ~/.texlive* /tmp # If you want to restore them later
rm -r ~/.texlive* # If you are sure about deleting
The ~/.texlive2020 directory was rebuilt after running pdflatex.

How do I fix "No pubspec.yaml file found" in flutter?

I am using Windows 10 with VS Code, although I also tested it on PowerShell, and both produced the same result:
After creating a new flutter program, before editing anything, I tried to run it on my phone, as the Tutorial Says, but I get an error saying "No pubspec.yaml file found". I thought that the issue must be that the default new app setup having an issue, so I used the "flutter_gallery" example. However, this had the exact same issue. I have reinstalled flutter, installed dart 2 on its own, deleted .pub-cache, but nothing works. I tried Googling the issue, but I couldn't find anything.
EDIT: I am running the commands from the root directory of the flutter project, where the pubspec.yaml file is, but I still get an error. The full error message is:
Error: No pubspec.yaml file found.
This command should be run from the root of your Flutter project.
Do not run this command from the root of your git clone of Flutter.
here is the result of running dir from the root of the project:
Mode LastWriteTime Length Name
---- ------------- ------ ----
da---l 2018-04-11 3:45 PM .idea
da---l 2018-04-11 3:45 PM android
da---l 2018-04-11 3:45 PM ios
da---l 2018-04-11 4:19 PM lib
da---l 2018-04-11 3:45 PM test
-a---l 2018-04-11 3:45 PM 120 .gitignore
-a---l 2018-04-11 3:45 PM 292 .metadata
-a---l 2018-04-11 3:45 PM 5425 .packages
-a---l 2018-04-11 3:45 PM 851 hello_world.iml
-a---l 2018-04-11 3:45 PM 1412 hello_world_android.iml
-a---l 2018-04-11 3:59 PM 8882 pubspec.lock
-a---l 2018-04-11 3:59 PM 358 pubspec.yaml
-a---l 2018-04-11 3:45 PM 160 README.md
UPDATE: I still don't know what caused the problem, but when I reinstalled flutter for Beta 3, it finally worked.
Looks like you are running flutter run command from a different directory (maybe parent directory).
Try running flutter run command from the project directory.
To solve this error in the EASIEST WAY follow below steps :-
Go to terminal
Then find local tabs
Then click on a '+' sign and type your command.This should solve
your error
See this screenshot as a guide.
Answer
Just change your directory folder project on terminal VS code.
Example
I save my project on directory D:\Project\Flutter Project\MyFirstApp
and the main.dart on the directory name first_app.
Just typing like this on terminal:
cd first_app
Now we're on D:\Project\Flutter Project\MyFirstApp\first_app.
and then type flutter run.
Hopefully answer your question.
I had the same issue, then I realized by default, I was running flutter clean in my sub folder. Not the project folder. Definitely run as follows in the command terminal.
cd C:\Users*\Desktop*MyProject*my_project_flutter*
then run the following
flutter clean
flutter run
Note: cd stands for Change directory
I hope this helps!
ERROR is simple You are in the wrong directory and trying to run your command in CMD in the wrong directory.
SOLUTION:
First move to the directory in which pubspec.yaml is located. (Like in my case it is C:\Users\A12\AndroidStudioProjects\work1 (A12 is my username and work1 is project
name))
Now try to run your command it will work fine.
#James M, go to command prompt and run
flutter upgrade
and then try to create a new project using the command
flutter create new_project
It would work fine.
Maybe you should check to see if the project directory you opened is correct. I had this problem because the project directory opened to the project's parent directory. You must ensure that the file exists in the project directory you have opened.
You can use flutter clean command and then try
flutter run In your terminal
For me the culprit was OneDrive. I had to reinstall Windows 10 and when I did, it offered to setup OneDrive for me automatically. I thought - great, one less thing... Then later I realized that it had set itself up with the Files On Demand option set to true. Microsoft never ceases to elicit a facepalm from me with the things they think are great ideas. Just to verify that this was the problem, I copied the entire folder to a temporary location on my hard drive that wasn't synced to OneDrive and it ran fine.
If something has been corrupted in the process of trying to build and run without all the files accessible, hopefully you have a recent commit from github (prior to putting the project on OneDrive) that you can clone. This is assuming your problem has the same cause as mine.
Possible that you are running flutter commands from a different directory. Go to project directory and try running flutter commands from there.
It seems you are running command from the flutter sdk installed folder. Instead you should run the command from the project you have created.
Match your steps you have done from below mentioned steps:
Clone flutter or unzip flutter sdk (you have downloaded) and move the flutter folder to C drive.
Now check whether the flutter is installed properly or not by running command(flutter --version) from any folder. Make sure you have set the flutter path inside environment variable.
If it is installed, move to any folder where you want to create your project and type this command "flutter create project_name"
Now move to the folder you have recently created and then run "flutter run" from that folder
I think this will surely help you.
Error: No pubspec.yaml file found.
This command should be run from the root of your Flutter project.
It Simple means that your terminal is currently not in your flutter project
the path of the directory is wrong,
Solve it by navigate to the flutter folder
change directory
Eg : cd portfolio
after changing the terminal directory path
C:\Android Studio Stuff\Flutter Project\portfolio> // your command
You should run it in the project folder. For Example: the project folder is named "first_app" and it is located in Documents, so the first go to Documents(cd Documents) then enter your project folder(cd first_app) and then run the command "flutter run".
MacBook-Pro-5:first_app username$ flutter run
I am constantly getting this error for my sub-folder 'example':
<my project folder>\example: no pubspec.yaml found
Not sure how to get rid of it. However, the error does not affect anything.
I saw this error for invalid pubspec.yaml content, like for example spaces before
name: my_app
like
name: my_app`
step 1 : Add this to your package's pubspec.yaml file:
url_launcher: ^5.0.2
step 2: When You come back to main.dart file you can see the get dependencies. when yo click on that link "flutter packages get" command will run. You can get the URL Launcher package
This error gets thrown when you try to run flutter build apk command (at least, it was in my case) while not being in the project directory. Usually, a flutter app's project directory path (let's say it is in F drive, and inside a folder named apps, is as:
F:\Apps\app_name
I had the same issue, and the culprit in my case was this path: F:\Apps\app_name\android which is without a doubt, NOT a project directory. So, all I had to do was type this command in terminal: cd .. which takes to the parent directory.
So, before running the command, make sure to check out the directory being shown in terminal.
In my case, i was using a VS code in Windows 10 and when i created a new project by Flutter: New Project
it failed to create the following project files & folders under the project location
android
ios
lib
pubspec.lock
pubspec.yaml and few more files.
I tried creating another project and that successfully created with all the necessary files.
Sound dumb but this is what exactly happened to me.
Hope it helps someone.
You should cd to project directory, you probably are not in you opened project's root directory. If you press '+' button (new session) at the top of Flutter terminal window it automatically changes to current project folder.
Try this command: flutter --version
Be sure you are on stable channel. By running flutter channel you will see the current channel and for change it run flutter channel stable and flutter doctor commands.
only make sure you are running terminal in the main project file that has got .yaml in it
In terminal write cd your project name.
Then hit enter and then write flutter run
Got a similar error:
The directory ../ does not contain a pubspec.
This is because I was referring to a folder that did not have a pubspec.yaml file.
Solution:
Change from:
file_picker:
path: ../
To
file_picker:
path: ./
if you are a linux user, the copy this line.
sudo chown -R username home/username/
this should give you permission to every file into home/username/
In Visual Studio Code - > Update the Dart/Flutter Packages when prompted by VSCode.
This will install the pub-get packages required and will resolve the issue.
This solution worked for me :
Open terminal
flutter clean
flutter packages pub get
you can find this pubspex.yaml in flutter in following location
\src\flutter\packages\flutter_tools
open CMD change Directory into above location and now you can run flutter upgrades get and other command.
This one is working complete fine for me. Hope this will work for you
You need to execute the following command:
flutter pub global activate webdev

Xamarin forms Maps

im working on xamarin forms at the moment every time when i start a new xamarin form project i update the xamarin forms from the nuget package every things work fine until i started to work with maps and every time i install the xmarin.forms.maps after the install is finished i try to build my solution keeps throw 8 errors.droid
the problem is in the android platform only
Severity Code Description Project File Line Suppression State
Error Please install package: 'GPS Base' available in SDK installer. Android resource directory C:\Users\IBRAHIM\AppData\Local\Xamarin\Xamarin.GooglePlayServices.Base\8.4.0\content./ doesn't exist. WorkingWithMaps.Android
Error Please install package: 'GPS Maps' available in SDK installer. Java library file C:\Users\IBRAHIM\AppData\Local\Xamarin\Xamarin.GooglePlayServices.Maps\8.4.0\content\classes.jar doesn't exist. WorkingWithMaps.Android
Error Please install package: 'GPS Base' available in SDK installer. Java library file C:\Users\IBRAHIM\AppData\Local\Xamarin\Xamarin.GooglePlayServices.Base\8.4.0\content\classes.jar doesn't exist. WorkingWithMaps.Android
Error Please install package: 'GPS Basement' available in SDK installer. Android resource directory C:\Users\IBRAHIM\AppData\Local\Xamarin\Xamarin.GooglePlayServices.Basement\8.4.0\content./ doesn't exist. WorkingWithMaps.Android
Error Reason: File C:\Users\IBRAHIM\AppData\Local\Xamarin\zips\CAA441D76F04E0D57C4110F8A00CDA7A.zip is not a ZIP archive WorkingWithMaps.Android
Error Please install package: 'GPS Maps' available in SDK installer. Android resource directory C:\Users\IBRAHIM\AppData\Local\Xamarin\Xamarin.GooglePlayServices.Maps\8.4.0\content./ doesn't exist. WorkingWithMaps.Android
Error Please install package: 'GPS Basement' available in SDK installer. Java library file C:\Users\IBRAHIM\AppData\Local\Xamarin\Xamarin.GooglePlayServices.Basement\8.4.0\content\classes.jar doesn't exist. WorkingWithMaps.Android
Error Unzipping failed. Please download https://dl-ssl.google.com/android/repository/google_m2repository_r24.zip and extract it to the C:\Users\IBRAHIM\AppData\Local\Xamarin\Xamarin.GooglePlayServices.Base\8.4.0\content directory. WorkingWithMaps.Android
ive been stuck for 3 days now pleasee HELLPPPP MEEE OUT !!!
google play services base and basement folders are empty what should id
I ended up having to do it by hand... Here are the steps though
Download zip file (https://dl-ssl.google.com/android/repository/google_m2repository_r22.zip)
Extra zip file
Go to folder you need the library for (let's say play-services-base)
Go to version (example: 8.1.0)
Rename file ending in .aar to .jar
Extract .jar file to a folder (I used 7Zip)
Copy all the contents of the folder
Go to "C:\Users{USER}\AppData\Local\Xamarin"
If doesn't exist, create needed folder (for "play-services-base" I created "Xamarin.GooglePlayServices.Base")
Created folder for version (Example: 8.1.0) and then a folder in that called "embedded"
Paste files from before into this folder
Go back to step 3 and keep repeating till all libraries are added
Ya it's a pain.... But it works
This is obviously not related to any SDK.The log clearly states the issue.
Your nuget packages are corrupted , this has happens when you try updating your xamarin forms to the latest version, along with other packages.
First
I would recommend starting a fresh project.
When installing Xamarin forms maps, ensure that all the version of the nuget package match, ensure there is no version mismatch. Do not update to the latest version. Find a mid-level stable version of the package needed and update to this. Now go to each Device specific component and check the references ensure there is no (!) under the referenced package.
Second
Navigate to your appdata directory
close visual studio.
C:\Users\john.doe\AppData\Local\ in this directory find the Xamarin folder.
Delete the "Xamarin" folder.
Open VS ===> Clean solution, and Rebuild the entire solution.
This will take a while, because you will re-download all the packages.
Viola!! Happy coding.
Thank you
i think you must have to update your SDK. then give proper permission for the map related implementation i hope that it will work fine in my case it is working good.

Why is dart pub suddenly trying to install packages in my css folder?

Running pub update ...
Pub update failed, [1] Resolving dependencies...
DirectoryIOException: Directory listing failed, path = <longpath>/web/css/packages (OS Error: No such file or directory, errno = 2)
Why would pub suddenly try to look for packages in my css folder?
The short answer, pub puts symlinks into subdirectories to ensure that you can use package: in any Dart file in any subdirectory of a "deployable" directory.
Because web is deployable in the sense that you'll likely take everything in web and throw it up on a web server, pub wants to make it easy for Dart files to work.
There are no conventions right now, so pub takes the optimistic approach because it can't anticipate where you might put Dart files.
Regardless, you shouldn't get an error, so this might be a bug. I just tried it on a brand new sample app with a web/css and pub install and pub update worked for me.
Can you please submit a bug at http://dartbug.com/new with details of your OS and the output of dart --version ? Many thanks!

Resources