Unable to restore nuget packages with "WARNING: Invalid parameter" error - jenkins

I'm trying to build a Xamarin Android project at my build server (Mac OS X) but I'm unable to restore some of nuget packages (3 or 22). These three packages can be downloaded but for some reason couldn't be copied to the workspace.
I cleaned the workspace, removed nuget cache - same result.
Restoring NuGet package Xamarin.GooglePlayServices.Gcm.29.0.0.1.
Restoring NuGet package modernhttpclient.2.4.2. Restoring NuGet
package Xamarin.GooglePlayServices.Analytics.29.0.0.1. Adding package
'Xamarin.GooglePlayServices.Analytics.29.0.0.1' to folder
'/Volumes/Storage/Jenkins/jobs/Build1/workspace/packages'
Adding package 'Xamarin.GooglePlayServices.Gcm.29.0.0.1' to folder
'/Volumes/Storage/Jenkins/jobs/Build1/workspace/packages'
Adding package 'modernhttpclient.2.4.2' to folder
'/Volumes/Storage/Jenkins/jobs/Build1/workspace/packages'
WARNING: Invalid parameter WARNING: Invalid parameter WARNING: Invalid
parameter

After a restart and packages folder cleanup it started to work fine. Just use -Verbosity detailed command to get more insights on an issue:
https://docs.nuget.org/consume/command-line-reference
Take into account that the install, update and restore commands has different way to define verbose level of output.

Related

Receiving error while creating project with Razor page template

Immediately I click on create and the project loads. I always receive the below error. I cannot do anything without correcting this.
This is the error:
Severity Code Description Project File Line Suppression State
Error NETSDK1004 Assets file 'C:\Users\HARBIORLAR PC\Desktop\VB Web Projects\BookList\BookList\BookList\obj\project.assets.json' not found. Run a NuGet package restore to generate this file. BookList C:\Program Files\dotnet\sdk\3.1.300\Sdks\Microsoft.NET.Sdk\targets\Microsoft.PackageDependencyResolution.targets 234
Screen shot of the error:
This is what i did and it works,I Enable automatic package restore by choosing Tools > Options > NuGet Package Manager, and then selecting Automatically check for missing packages during build in Visual Studio under Package Restore.
Then I build the project with internet connection on and the missing file was downloaded.
This the Screen shot After successful

Unable to build fsharp projects using FAKE. Getting "Cannot open assembly'.paket/paket.bootstrapper.exe': No such file or directory." Error

Created a new fsharp project from Visual Studio Code (Version 1.12.2) while trying to build it with FAKE it is showing this error
"Cannot open assembly '.paket/paket.bootstrapper.exe': No such file or directory."
I checked the .paket folder of my project the paket.bootstrapper.exe is missing in there.
I using ionide 2.25.14, ionide-fake 1.2.3 and ionide-Paket 1.6.3.
I tried building the project with msbuild and it is building without any errors.
EDIT
This is how the build target is defined in the build.fsx.
Target "Build" (fun _ ->
// compile all projects below src/app/
MSBuildDebug buildDir "Build"
appReferences |> Log "AppBuild-Output: "
)
Downloading paket.bootstrapper.exe from github and adding in to the .packet folder resolved the issue.
The simplest, and maybe the best thing to do is to download paket.bootstrapper.exe if it didn't get generated along with your project.
Your build script is trying to run paket.bootstrapper.exe, but can't find it, likely because your project was generated without one. If you already have a folder named .paket, then your project was likely generated with a paket.exe, instead.
The only thing paket.bootstrapper.exe does is download the latest version of paket.exe. Your build script is just trying to automate keeping your package manager up to date.

Nuget package restore error in build definition

I'm getting this error when building a project​ using Visual Studio online service build:
Error:
This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is ....\Attempt17\.nuget\NuGet.targets.
It is giving that nuget.target file is missing but it is already present in .nuget folder.
Any help?
You should add a "Nuget Package Restore" task to your build before you run your compilation. You no longer need a ".nuget" folder.
I had a different cause, in VSTS/Azure DevOps using "Use Nuget" first then "NuGet restore" second, on Hosted agent...the restore was throwing this error. Error began showing sometime around Feb 1, 2019.
I had to change this...
Path to solution, packages.config, or project.json: **/*.sln
to this...
Path to solution, packages.config, or project.json: **\{YOUR_SOLUTION_NAME}.sln
And the error went away.
Hope this helps!

Realm doesn't load libwrappers.so

I try to use Realm database(version 0.74.1) in Xamarin.Android project. When I do build all is ok, but when I try to run project i get error
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets: Error: Error executing task BuildApk: /{SolutionPath} /packages/Realm.0.74.1/lib/MonoAndroid44/arm64-v8a/libwrappers.so.
what I can do in this situation?
The APK is not built during the default build phase so you only get verification that libraries are in the right place when you run the debugger, or explicitly build an APK.
Can you check if the libwrappers.so file is actually in that location in the packages directory? It should have been put there by NuGet.
Also, is there just one Android target in the solution or have you created a PCL and Android target. The NuGet needs installing into both.

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

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.

Resources