Xamarin not installing packages, error XA5209 & XA5207 - c#

I have a problem with Xamarin in Visual Studio.
I am working with Xamarin.Forms and Xamarin.Android. My problem is that that android component of the project do not install themselves. The zip folder is empty and the component folders are empty.
Solutions I tried:
Delete the the ./AppData/Local/Xamarin (in windows) folder which is supposed to force the IDE to download the appropriate packages (does not work)
Downloaded the m2repository_r29, put it in zip folders and give it his hash name (does not work)
Install manually each library : download, unzip and put in right folder (works, but is super long for each library from this source https://learn.microsoft.com/en-us/xamarin/android/troubleshooting/resolving-library-installation-errors#Manually_Downloading_m2repository)
This is a sample of the error message I get:
Severity Code Description Project File Line Suppression State
Error An error occurred trying to install required android components on Project 'Project.AndroidClient'.
Project 'Project.AndroidClient' requires the following components installed on your machine:
Xamarin.Android.Support.Animated.Vector.Drawable
JavaLibraryReference: https://dl-ssl.google.com/android/repository/android_m2repository_r29.zip-m2repository/com/android/support/animated-vector-drawable/23.3.0/animated-vector-drawable-23.3.0.aar-23.3.0.0
AndroidResources: https://dl-ssl.google.com/android/repository/android_m2repository_r29.zip-m2repository/com/android/support/animated-vector-drawable/23.3.0/animated-vector-drawable-23.3.0.aar-23.3.0.0
...
Please double-click here to install it.
Intallation Errors: XA5209 Unzipping failed. Please download 'https://dl-ssl.google.com/android/repository/android_m2repository_r29.zip:m2repository/com/android/support/animated-vector-drawable/23.3.0/animated-vector-drawable-23.3.0.aar' and extract it to the 'C:\Users\...\AppData\Local\Xamarin\Xamarin.Android.Support.Animated.Vector.Drawable\23.3.0.0\embedded' directory
XA5209 Reason: ...
Please help, I am new to all this and I don't know what to do.

Use nugets instead, xamarin is migrating fully from components to nugets on May, 5th

Related

How do I remove "multiple publish output files with the same relative path" in a dotnet core WinUI3 application?

First time poster, so please let me know if I forgot anything.
I've got a dotnet project I've been working on using WinUI3 in Visual Studio 2022. More or less it grabs some reports from Azure using Microsoft Graph.
When trying to package the application, for use on a different machine, I get the following error:
error NETSDK1152: Found multiple publish output files with the same
relative path:
C:\Users\McTwitch\source\repos\Heimdall\obj\x64\Release\net6.0-windows10.0.19041.0\win10-x64\MsixContent\Microsoft.Web.WebView2.Core.dll,
obj\x64\Release\net6.0-windows10.0.19041.0\win10-x64\R2R\Microsoft.Web.WebView2.Core.dll.
I've added
<PropertyGroup>
<ErrorOnDuplicatePublishOutputFiles>false</ErrorOnDuplicatePublishOutputFiles>
</PropertyGroup>
to my .csproj file, and that gives me a different error:
Severity Code Description Project Path File Line Source Suppression State
Error APPX1101 Payload contains two or more files with the same destination path 'Microsoft.Web.WebView2.Core.dll'. Source files:
C:\Users\McTwitch\source\repos\Heimdall\obj\x64\Release\net6.0-windows10.0.19041.0\win10-x64\MsixContent\Microsoft.Web.WebView2.Core.dll
C:\Users\McTwitch\source\repos\Heimdall\obj\x64\Release\net6.0-windows10.0.19041.0\win10-x64\R2R\Microsoft.Web.WebView2.Core.dll SIEMGUI C:\Users\McTwitch\.nuget\packages\microsoft.windowsappsdk\1.2.221109.1\buildTransitive C:\Users\McTwitch\.nuget\packages\microsoft.windowsappsdk\1.2.221109.1\buildTransitive\Microsoft.Build.Msix.Packaging.targets 1504 Build
I've also checked Tools>NuGet Package Manager > Manage NuGet Packages for this Solution, but there aren't any entries under "Consolidate".
There was one post (Publish error: Found multiple publish output files with the same relative path) that mentioned adding some lines to the common.props file, but I haven't been able to locate the file, which is a tad frustrating.
Any and all help is appreciated, and I'll try to reply as quickly as I can to any additional questions or requests for information.

Xamarin studio "Error XA5209: Unzipping failed. Please download"

I created a new project by selecting the default theme as Appcompat.Light, then when I run the app, I'm getting this error:
"Error XA5209: Unzipping failed. Please download dl-ssl.google.com/android/… and extract it to the /Users/username/.local/share/Xamarin/Xamarin.Android.Support.Vector.Drawable/23.3.0.0/content directory. (XA5209)."
I haven't done anything else other than create a new project, Why am i getting this error?
The process of downloading the Android.Support.V7 or other nuget could take some time.
If in the middle of the process for some reason you quit the Xamarin Studio/Visual Studio or your internet goes down the packages being download as .zip will be corrupt.
After you try to open it again you will see that message "Error XA5209: Unzipping failed. Please download dl-ssl.google.com/android/… and extract it to the /Users/username/.local/share/Xamarin/Xamarin.Android.Support.Vector.Drawable/23.3.0.0/content directory. (XA5209)."
The solution that I follow most of the times this happens is to delete the root folder of the package where the error come from (/Users/username/.local/share/Xamarin.Android.Support.Vector.Drawable) and all the .zips inside the folder /Users/username/.local/share/zips.
Click here for more Resolving Library Installation Errors
The accepted answer did not work for me, so here is what I did to make it work. Basically the solution recommended here: https://learn.microsoft.com/en-us/xamarin/android/troubleshooting/resolving-library-installation-errors.
I am developing on Windows 10, with Visual Studio 2017 Community. The Packages are located in ..user/AppData/Local/Xamarin/....
I got errors for every package I needed, meaning Xamarin.Android.Support.Animated.Vector.Drawable, Xamarin.Android.Support.v4, Xamarin.Android.Support.Vector.Drawable and about 4 more... So I did the following (solution applies to every package), I illustrate it here for the Xamarin.Android.Support.v4 and version 23.3.0.0:
Create the 23.3.0.0 directory in Xamarin.Android.Support.v4
Create the directories embedded and content (embedded is very important)
Extract the zip (m2repository) in the content folder
From the m2repository, copy the contents of Xamarin.Android.Support.v4\23.3.0.0\content\m2repository\com\android\support\support-v4\23.3.0 to the Xamarin.Android.Support.v4\23.3.0.0\embedded directory, rename the file ending in .aar (in my case support-v4-23.3.0.aar) to support-v4-23.3.0.aar.zip, then extracting all the contents in the same folder (embedded). Note that this is package dependent, meaning for Xamarin.Android.Support.Design you will have to copy the contents of the \content\m2repository\com\android\support\design\23.3.0 folder.
Now repeat step 1 through 4 for every package that causes VisualStudio to throw an error.

Xamarin Forms Project builds with errors

I'm using VS2015 and the latest version of Xamarin. I'm trying to build a blank Xamarin Forms project, but when I go to just build the project, I get this error:
Download failed. Please download
https://dl-ssl.google.com/android/repository/android_m2repository_r22.zip
and put it to the
C:\Users\warrenbr\AppData\Local\Xamarin\Android.Support.Design\23.0.1.3
directory.
XamarinForms.Droid
So I've downloaded the zip and extracted it into the directory, tried to rebuild the project, but no dice. Is there a certain way I have to extract it, or certain folders I have to pull out of the zip?
OK, so I had to unzip the contents of the zip into a content folder for each package:
C:\Users\%username%\AppData\Local\Xamarin\Android.Support.Design\23.0.1.3\content
C:\Users\%username%\AppData\Local\Xamarin\Android.Support.Design.v4\23.0.1.3\content
etc...
Then I ended up restarting Windows, and that seemed to do the trick. Rebuilding the solution didn't seem to fix it before this.
You need to delete all from the path: C:\Users\USERNAME\AppData\Local\Xamarin Folders and Zip files. And then rebuild your project.

Xamarin.Forms: Android project Build Error - Missing Files inside AppData\Local\Xamarin Folders

I'm trying the Xamarin.Forms.
I created a Solution named "App2". The Visual Studio automatically created the following projects:
App2 (Portable)
App2.Droid
App2.iOS
When I try to compile the Android Project (App2.Droid), I get the following errors:
Download failed. Please download
https://dl-ssl.google.com/android/repository/android_m2repository_r22.zip
and put it to the
C:\Users\pedro.costa\AppData\Local\Xamarin\Android.Support.Design\23.0.1.3
directory. App2.Droid Reason: One or more errors. App2.Droid
Please install package: 'Xamarin.Android.Support.Design' available in
SDK installer. Java library file
C:\Users\pedro.costa\AppData\Local\Xamarin\Android.Support.Design\23.0.1.3\embedded\classes.jar
doesn't exist. App2.Droid Download failed. Please download
https://dl-ssl.google.com/android/repository/android_m2repository_r22.zip
and put it to the
C:\Users\pedro.costa\AppData\Local\Xamarin\Android.Support.Design\23.0.1.3
directory. App2.Droid Reason: One or more errors. App2.Droid
Please install package: 'Xamarin.Android.Support.Design' available in
SDK installer. Android resource directory
C:\Users\pedro.costa\AppData\Local\Xamarin\Android.Support.Design\23.0.1.3\embedded./
doesn't exist. App2.Droid
I've already tried to:
Download the android_m2repository_r22.zip file and put it on the C:\Users\pedro.costa\AppData\Local\Xamarin\Android.Support.Design\23.0.1.3 folder
Download the file and extract it to the folder
Delete the C:\Users\pedro.costa\AppData\Local\Xamarin\Android.Support.Design\23.0.1.3 folder and recompile project
Delete the C:\Users\pedro.costa\AppData\Local\Xamarin\zips folder and recompile the project.
Update the Xamarin.Android.Support.* nuget packages, but when I try it, I also get those build errors.
I've done a lot of research and it seems that the Android.Support.* folders should have files inside it, and that those files should be downloaded when the android solution is built, but it is not happening for me.
Try this work around :
Navigate to C:\Users\[user-name]\AppData\Local\Xamarin\zips folder.
Remove all zip files.
Remove /bin and /objfrom your project.
Clean and build your project.
It may take a while to build and debug project.
1.download
https://dl-ssl.google.com/android/repository/android_m2repository_r29.zip
2.rename to 2A3A8A6D6826EF6CC653030E7D695C41.zip
3.copy to C:\Users\User\AppData\Local\Xamarin\zip
4.rebuild
I saw in other answers to this problem, that by just deleting all the content from the Android.Support.Design folder, Visual Studio would download it again once the project was rebuild.
The problem in my case, was a proxy issue. When I set my environment to access the internet without the proxy, Visual Studio download the necessary files and folders on the rebuild.
Don't extract the zip to \23.0.1.3folder or just put it there, that won't work don't mind the error message.
You must put the zip in the \zip folder, after you delete the already existing zip, you may need to rename the zip you downloaded to something like: 2A3A8A6D6826EF6CC653030E7D695C41.zip
But if you don't want to manually download the support repository you can just delete everything in the %USER%\AppData\Local\Xamarin\ folder and rebuild and wait.
there is a zips name folder over this address C:\Users\[user-name]\AppData\Local\Xamarin\zips
first u have to check it the file is in extract condition there we can see an error it is an currupt format then u can replace those two files
1)2A3A8A6D6826EF6CC653030E7D695C41.zip replace by this link rename with 2A3A8A6D6826EF6CC653030E7D695C41
2)96659D653BDE0FAEDB818170891F2BB0.zip replace by this link rename with 96659D653BDE0FAEDB818170891F2BB0
then rebuild the project

Visual studio linked files with TFS - automated build does not work

I have two Visual Studio solutions, one for WebApi and one for WP7 development, I am linking some dto files from WP7 solution to WebApi solution, this works great.
I just added the solutions to Team Foundation Service preview, and tried to get it to build. Since the linked files doesnt get added to source control, I cant build the project, because it cant find the linked files.
I tried adding the WP7 solution to the same directory in TFS, but no luck.
Edit- More information:
I get: CSC: Source file '....\TennisTracker.Client.Ui\TennisTracker.Client.Core\Models\GameDto.cs' could not be found
Then I add the client solution under "Edit build definition - Process - 1. Required - Items to build. I get this: C:\a\src\TennisTracker.Client\TennisTracker.Client.Ui\TennisTracker.Client.Ui.csproj (140): The imported project "C:\Program Files (x86)\MSBuild\Microsoft\Silverlight for Phone\v4.0\Microsoft.Silverlight.WindowsPhone71.Overrides.targets" was not found. Confirm that the path in the declaration is correct, and that the file exists on disk.
In the error console, in visual studio, it gives me this error: Error: API restriction: The assembly 'file:///C:\Users\markka\AppData\Local\Temp\VSTFSBuild\ae65cc1a-850e-4112-8c34-96674d8c79f3\2052550994\nunit.core.interfaces.dll' has already loaded from a different location. It cannot be loaded from a new location within the same appdomain.
The workspace is set to the entire directory, containing both solutions
Under the build definition you can define the workspaces which you can point / setup paths to the other project.
Best thing to do is post up the build error output and I can then hopefully let you know the exact path you need to setup

Categories