Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
Mono organizations on
GitHub to continue tracking issues. Bugzilla will remain
available for reference in read-only mode. We will continue to work
on open Bugzilla bugs, copy them to the new locations
as needed for follow-up, and add the new items under Related
Our sincere thanks to everyone who has contributed on this bug
tracker over the years. Thanks also for your understanding as we
make these adjustments and improvements for the future.
Please create a new report for Bug 61113 on
Developer Community if you have new
information to add and do not yet see a matching new report.
If the latest results still closely match this report, you can use the
After updating to VS 15.5 I'm unable to update NuGet packages in Android projects, both libraries and applications.
I have gotten the error while updating Xamarin.Forms and Xamarin.Android.Support.* packages.
The error message is "This collection is read-only."
Full log from Package Manager
Attempting to gather dependency information for multiple packages with respect to project 'Applications\LexTalk.Android', targeting 'MonoAndroid,Version=v7.1'
Gathering dependency information took 18,9 sec
Attempting to resolve dependencies for multiple packages.
Resolving dependency information took 0 ms
Resolving actions install multiple packages
Retrieving package 'Xamarin.Forms 184.108.40.206934' from 'nuget.org'.
Removed package 'Xamarin.Forms 220.127.116.11779' from 'packages.config'
Successfully uninstalled 'Xamarin.Forms 18.104.22.168779' from LexTalk.Android
Adding package 'Xamarin.Forms.22.214.171.124934' to folder 'U:\Repos\LexTalk\packages'
Added package 'Xamarin.Forms.126.96.36.199934' to folder 'U:\Repos\LexTalk\packages'
Install failed. Rolling back...
Package 'Xamarin.Forms 188.8.131.52934' does not exist in project 'LexTalk.Android'
Package 'Xamarin.Forms 184.108.40.206779' already exists in folder 'U:\Repos\LexTalk\packages'
Added package 'Xamarin.Forms 220.127.116.11779' to 'packages.config'
Removing package 'Xamarin.Forms 18.104.22.168934' from folder 'U:\Repos\LexTalk\packages'
Removed package 'Xamarin.Forms 22.214.171.124934' from folder 'U:\Repos\LexTalk\packages'
Executing nuget actions took 38,21 sec
This collection is read-only.
Time Elapsed: 00:00:57.4296499
========== Finished ==========
And I'm not the only getting this error:
I am getting the same error. I somehow managed to get everything to update except the four Xamarin.GooglePlayServices (Base, Basement, Maps, Tasks). When I attempted to update them I go the error message
Package 'Xamarin.GooglePlayServices.Basement.60.1142.0' already exists in folder
then in started rolling back and showed the error "This collection is read only". I tried to manually install just the Basement - which worked - but then the other three packages (Base, Maps, Tokens) were not longer in my nugget package list for the project. Their reference is still in the project thought
I attempted to install the compatible (60.1142.0) version of the .base nugget package and it failed as follows and ended with the "This collection is read only" error.
Problem still exists in VS 15.5.3 and 15.6.0 Preview 2.0
Time to fix this ???
I got the same error too, when upgrading an android project with the latest xamarin.Forms(126.96.36.199203) I managed to clear the "Collection is read only error" by removing the previous version of xamarin forms and reinstalling it.
Hope it helps anybody
i am now getting the same issue.
I tried to uninstall the previous xamarin.forms version in my android project and install the latest xamarin.forms version 188.8.131.52203 but the issue is still there. Any fixes yet?
This issue is also tracked at https://developercommunity.visualstudio.com/content/problem/169526/nuget-get-error-this-collection-is-read-only-while.html, and i looks like it have been moved to https://github.com/NuGet/Home/issues/6468.
So the error is reported at least three places, so hopefully i will be fixed soon.
I'm also experiencing this trying to update Xamarin.Android.Support.xxx packages, Xamarin.Firebase.xxx packages, and Xamarin.GooglePlayServices.xxx packages, 22 packages in all.
My Visual Studio version is 15.5.4
I was able to resolve my issue. Some of the files in the packages folder were set to read-only. I cleared the read-only flag from all files in the packages folder and then the packages updated successfully
Error is still in VS 15.5.5, and it's starting to become a big problem, I'm unable to do anything usefull regarding updating Xamarin.Forms on Android.
I had this issue recently when I updated all my projects from using XF 2.4 to XF 2.5. I had the same issue for my android project. I deleted obj\ and bin\ folders for my solution and updated nuget packages again only for my android project (Was using solution wide upgrade before). The problem is solved for me
Problem still exists in Visual Studio 2017 15.6. Updating the Xamarin Forms Nuget package or any of the Android Support library packages fails with the error "This collection is read-only".
1. Update every nuget package one by one and select "Ignore Dependencies". This takes forever and sometimes needs multiple tries
2. Open the project in Visual Studio for Mac (15.6) and update the packages. Works like a charm so it's a Windows-only issue.
Just tested it with VS 2017 15.6.1 and the Xamarin.Android.Support... Packages
Still shows "This collection is read-only"
The error occurs if you install multiple updates. You can see in the output window "Installation failed. Roll back ..."
If you restart VS you can install the next (the failed) package, then the next failed ... So if you try again and again and restart VS every time, sometimes all package will be updated. So I think it's an error in updating the package list.
does this bug not belong to xamarin android? dont we need to move it to Github issues?
This bug is also filed in the NuGet repository on GitHub, at https://github.com/NuGet/Home/issues/6468, and it's fixed there.
So we just need to wait to be included in VS ...
I'm having the same issue. I'm on 15.6.4
I was also able to confirm that it does work on Mac as stated in Comment 11.
Any update on this? This is a blocker issue and Microsoft is blaming it on Xamarin.
It renders Xamarin almost unusable. Without jumping through numerous hoops, it's impossible to update Xamarin Forms to the latest version using Visual Studio
I kinda fixed it by updating my pcl to netstandard and changing all projects to the new PackageReference in project.csproj file format.
Remove all nuget references on all projects(will probably need to force remove them)
In VS->Tools->Options->Nuget Package Manager->General "Allow format seletion on first package install" should be turned on.
When installing the packages again, VS should ask if you want to use PackageReference or Package.config.
Add back your Nugets (this should be much quicker now by the way)
So yes, still an issue after so long, had to test reinstalling nuget packages for android because app center cannot find dlls that should be there, possibly an android reference somewhere, but since nuget is unusable for reinstalling still not sure what we should do, ignoring this reveals how much they care :)
Executing nuget actions took 14.51 min
update-package : This collection is read-only.
At line:1 char:1
+ update-package -reinstall
+ CategoryInfo : NotSpecified: (:) [Update-Package], Exception
+ FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerShellCmdlets.UpdatePackageCommand
I have the same issue too. I am trying to update my Xamarin.Forms package from 184.108.40.206203 to 220.127.116.114934 and I am using Visual Studio v15.5.6 so that I can use the latest Xamarin.Forms.Maps package. The update works for the shared .NET standard, iOS and UWP projects, but always fails on the Android one with this "This collection is read-only." message. I have tried some of the suggestions above, but no success so far. Is there a definitive list of workaround steps to follow to get this working whilst we wait for the fix?
If you have a Mac, doing the package update there seems to work.
I had the same problem. I did the following:
I had to install in a specific order:
* Xamarin.Build.Download (latest version)
* Xamarin.GooglePlayServices.Basement (lastest version)
* Xamarin.GooglePlayServices.Tasks (latest version)
* Xamarin.GooglePlayServices.Base (latest version)
* Xamarin.GooglePlayServices.Maps (I was trying to use Xamarin.Forms.Maps, latest version)
* Xamarin.Forms.Maps (same version as your xamarin forms)
Can somebody from the Xamarin Team sort this issue out or tell us what workaround to use.
Its clearly a problem when trying to install Xamarin.Forms.Maps on a project.
We are stuck and I tried all workarounds with no success.
Today VS2017 version 15.7 was released and this issue is still not fixed.
"This collection is read-only" when trying to update the Xamarin Forms nuget package for an Android project.