unknown MSBuild failure on osx - xamarin

I have been working on a xamarin ios application with MVVMlight framework.
It was working without any problem but suddenly I am getting the following error
Unknown MSBuild failure.Please try the building the project again
Herewith I have attached the screenshot of build log
When I click the error it leads to the .csproj file
I have verified the the xml is syntactically right no presence of any special character that can cause any xml problem
So far I have tried clean & build,removing the obj and bin manually,restarting the xamarin.But nothing works so far.
The problem is not seen in Visual studio though
Any suggestions to solve the problem is welcome

There was a space in one of the directory name in the path.
I replaced the space with %20 for directory name on Finder and it started working.

Related

Error generating .ipa: "remove ... directory not empty"

I'm trying to generate an .ipa file from xcode, version 10.
Certainly I am using the option "Archive" under "Product" menu option, towards a Generic iOS Device.
The problem comes when it starts building it. The following error appears:
I have tried cleaning the build folder, removing the folder mentioned in the error (it gets regenerated after I press Archive), I also tried deleting DerivedData folder, changing it's destination...
What am I doing wrong? How would I go to generate an .ipa file?
I have read a lot of questions here in SO about this but none of them worked for me.
Thank you.
I ended up being able to generate the .ipa with the legacy build system.

Edit build definition - path over 259 characters

I need to edit my solution's build definition to include some new projects. Unfortunately, I can't do that because I keep getting the "path contains more than the allowed 259 characters" error. I've tried to rename the file to make it shorter - the total path character number is now 257. But I keep getting the same error message and the filename in the message is still the old, long one.
I'm really confused now. The file is located within:
C:\Users\USER\AppData\Local\Temp\VSTFSBuild...
Does anyone know why the filename remains unchanged in the error message or knows of any other way to fix the problem?
Surprisingly, I managed to overcome the problem this way:
go to Process and click OK to the error message when it appears
click "Show more details" next to my build process template
click the Refresh button
(I'm using Visual Studio 2012)
For this kind of long path issue, the common workarounds are to shorten the build path on the server.
For example: instead of \xx\Build\Drop\ProjectName, just use \xx\Build\Drop (or \xx\Builds) since the project name is also in the build name.
For the long path issue in TFS, there had been a related uservoice and now completed.
Fix 260 character file name length limitation
We’ve removed the limitation from the BCL for the basic file
manipulation functionality (CRUD). You can find more details here:
https://blogs.msdn.microsoft.com/dotnet/2016/08/02/announcing-net-framework-4-6-2/
Immo Landwerth Program Manager .NET
If you are using XAML build definition, by default the build control specifies a path for the build to access any custom assemblies your custom build process requires. If you don't have custom assemblies, you don't need this value.
Open Team Foundation Administration Console on your Build Server, and click Properties on the build controller. Remove the path and try to edit the build definition again.

Xap packaging failed. Object reference not set to an instance of an object

I'm getting this error message on my PC when I try to build my Windows Phone app:
Xap packaging failed. Object reference not set to an instance of an object
I'm using Dropbox. On my laptop, It works perfectly fine and I can debug etc...On my PC however, I can't.
I tried many things such as:
Delete obj/Debug Folder
Check for files which are missing on the Solution Explorer
So far, nothing has helped.
Any idea how I can fix this?
You should check, in every folder of your project, for missing files or wrong references.
You can get this problem just with a single missing image, if its Build Action property is set to Content or similar...
Check your files and then Rebuild your project!
This can happen if a file is removed from the disk itself, but not from the Solution through Visual Studio. Delete the file through Visual Studio (it should be marked with a little yellow hazard icon) and Rebuild.
Credit to Andreas Hammar via http://blog.jayway.com/2011/06/03/wp7-build-error-xap-packaging-failed/ - his solution worked for me.
I am adding this reply because although the problem with app icons is covered in brief in some of the answers above, I wanted to give exact steps since it just happened to me. I got this error and then found this web page:
Xap Packaging Error
It turned out that my App icon file name was wrong due to a rename. I double-clicked on WMAppManifest.xml, found in the Properties folder, to open the editor for that file. I simply used the button to update the App Icon, re-found the file and selected it, and the error went away after rebuilding the project.
The problem lies in your startup object in your Application. I have met this error to many times.
It usually happens when I change the name of my class/namespace Application class. Or it might even be conflicting with your dropbox locations.
To Fix this.
Right click your main project or Alt+Enter
Go to the silverlight tab and set your startup object
Try the following:
Have Visual Studio closed
Download all your files to your computer
Delete Bin and obj folders completely.
Open the .sln
Rebuild
If if fails expand the References in te Solution explorer and make sure all your dll's are found. If a dll have a yellow exclamation point that means its not found. I'm thinking that one of your references are set to an absolute path on your laptop and that's missing on your PC.
If someone comes across this post and still has the issue I had where XAP packaging failed and that VS2012 can not find the file then check for spaces in the file name.
I had the issue where my tiles were "tilename 99.png" and it keep giving me the XAP packaging failed message. So I finally changed the file name to "tilename_99.png" and it worked.
Hope this helps someone in the same predicament.
In my case, I'd accidentally moved Background.png to a resource folder. Moved it back and it worked!
In my case, this error didn't go away even after trying all the above methods. Actually I had renamed the ApplicationIcon.png to "xyz.png". And reverting this, fixed the issue.
One more possibility is that you have a wrong path to an image in the project/options/Application dialog (icon, bg image, etc).
I had this error message, after some frustration I look in the obj folder, is was no part of the solution(but visual studio need it) but I had some conflicts files with dropbox. I deleted the obj folder rebuild, visual studio recreates the folder and the content of it and problem solved.
Ahh finally found my problem.
I'm using Visual Studio 2012, which doesn't always point out the "missing" file and makes it a little harder to fix.
MY SHORT SOLUTION
Relink the "linked" configuration file in the main project. It is a linked file because the original file remains in a referenced assembly, not in the current assembly. The file wasn't marked YELLOW so it wasn't obvious that it would be the problem, but when I double clicked on it, it failed to open, so I knew this was the problem file.
The silverlight application itself had a "linked" file called "ServiceReferences.ClientConfig" which contains information needed by a referenced project to make a web service call.
So the main project didn't have the web service reference itself, but it referenced a project which did, which is why it linked the "ServiceReferences.ClientConfig" file.
MY LONG SOLUTION
Keep rebuilding the main project file, and commenting out, and excluding project by project, file by file, until you CAN build the main project again. At that point it should be clear(er) which part of the solution is causing the problem.

"application has failed to start ... configuration is incorrect" after upgrading?

I have a project in windows application than was in VS2008. Now I convert it to VS2010. When I want to run my project, I get this message:
"This application has failed to start because the application configuration is incorrect. Review the manifest file for possible error."
How to I can run my application?
Thanks.
I had the same problem where my entire C# solution was created in previous version and it did not work in new VS.Net version giving the same error. Here are a few things that will help you resolve the problem
Expand the References Item and check if any item has a warning symbol attached to it.
If (1) , click on References->Add Reference and try to add the reference which has the warning. Now the warning sign has to go away.
If the references displayed in 'Add reference' dialog box is grayed, you should probably get the reason by hovering next to the reference.
For me it was grayed and it clearly mentioned that the component is not compatible with the current .NET Target runtime. Right click on Project -> 'Properties' and try to change the .NET Runtime and give a shot by compiling the entire solution and try to execute it.
If it still fails , try looking at eventviewer logs by going to Start->Run->Eventvwr
This should be a good way to debug this problem.
Honestly...I deleted the App.config file and Re-build. And started working.
Without understanding what was going on, I was able to fix this issue for a Windows Forms project I had just converted from VS.Net 2008 to 2010.
After conversion the Target Framework was still .Net Framework 2. When I changed it to 4.0, my application could be started and debugged.
In then noticed a new line in app.config:
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup>
So, just for the sake of interest, I changed the Target Framework back to 2.0 and the line changed to:
<startup><supportedRuntime version="v2.0.50727"/></startup>
The application would still run.
Then, I removed the new line altogether and the application would still run!
Finally, I undid all my changes and started the conversion again. Now, the application would run immediately!
So, if you run into this issue, just try these steps and see if it helps you.
Check discussion here:
http://social.msdn.microsoft.com/forums/en-US/vbgeneral/thread/e60dcbf9-c6a0-47a6-bc37-68d4edc45276
In my case the reason for this error was an invalid app.config. R# renamed the root element from <configuration> to something else (probably because there was another variable that I renamed with the same name).
I found this by following Gopalakrishnan SA'S advice to look in the Event Viewer where I found:
Activation context generation failed for "my.exe".Error in manifest or policy file "my.exe.Config" on line 3. The application config file root element must be configuration.
In my case, I forgot just a simple note,
in the requestedPrivileges you should place one requestedExecutionLevel, NOT MORE
I checked the event viewer to find the error "The application config file root element must be configuration".
It turns out it was the namespace referenced in the app.config.
I had opened it in VS 2015 after it being created in VS 2008

Export Visual Studio Template error: "Unable to read an exported file"

When exporting a Visual Studio project to a Template (File/Export Template...) I get the following error upon clicking the Finish button:
Unable to read an exported file for the following
reason: The file cannot be opened with the selected
editor. Please choose another editor.
Screenshot http://img687.yfrog.com/img687/1756/templateerror.png
A Google search for this error has only led to several dead ends. There aren't any unusual file types in this project. Any ideas what could be going on?
By laborious trial and error (start with an empty project, add a folder, try to export template) I was able to narrow this down to a single Javascript file. As it happens, it's one of the language definitions for prettify.js (which is used on this site for code coloring). The file in question is lang-hs.js, and for some reason Windows on my machine treats this file differently from other Javascript files: It opens in Notepad, when I have the .js extension mapped to Visual Studio.
I'm not sure what the underlying explanation is, but I've already wasted enough time on this and I believe I can live without Haskell code coloring (!) so I'm just deleting this file and moving on.
It seems ".cur" files are often a culprit in this error. I have removed them from my project and now the exportation works correctly.
Microsoft staff suggest looking at log files (../windows/system32/compmgmt.msc) but this error does not spawn an entry into the Application EventLog.

Resources