I renamed the solution file through TFS and tried checking the code in. I keep getting this error. My best guess is that the build does not recognize that the name of the solution changed, and keeps looking for the old name.
Exception Message: The file (oldName).sln could not be found. (type FileNotFoundException)
Exception Stack Trace: at System.Activities.Statements.Throw.Execute(CodeActivityContext context)
at System.Activities.CodeActivity.InternalExecute(ActivityInstance instance, ActivityExecutor executor, BookmarkManager bookmarkManager)
at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation)
How do I get the build to accept the new sln file? Any assistance in the resolution of this issue would be greatly appreciated.
Edit the build definition, go to the process tab, and in the solutions to build property update the name of your solution.
Related
I am trying to build my Xamarin.Android project. Initially I had set Linking to Sdk and User Assemblies. This configuration was not giving any errors, but it removed some commands from my app, so following this answer I switched the setting to Sdk assemblies only.
Unfortunately, this causes the following error:
Mono.Linker.MarkException: Error processing method: 'System.Void Plugin.FirebaseAnalytics.FirebaseAnalytics::SetMinimumSessionDuration(System.Int64)' in assembly: 'Plugin.FirebaseAnalytics.dll' ---> Mono.Cecil.ResolutionException: Failed to resolve System.Void Firebase.Analytics.FirebaseAnalytics::SetMinimumSessionDuration(System.Int64)
at Mono.Linker.Steps.MarkStep.HandleUnresolvedMethod(MethodReference reference)
at Mono.Linker.Steps.MarkStep.MarkMethod(MethodReference reference)
at Mono.Linker.Steps.MarkStep.MarkInstruction(Instruction instruction)
at Mono.Linker.Steps.MarkStep.MarkMethodBody(MethodBody body)
at Mono.Linker.Steps.MarkStep.ProcessMethod(MethodDefinition method)
at Mono.Linker.Steps.MarkStep.ProcessQueue()
--- End of inner exception stack trace ---
at Mono.Linker.Steps.MarkStep.ProcessQueue()
at Mono.Linker.Steps.MarkStep.ProcessPrimaryQueue()
at Mono.Linker.Steps.MarkStep.Process()
at Mono.Linker.Steps.MarkStep.Process(LinkContext context)
at MonoDroid.Tuner.MonoDroidMarkStep.Process(LinkContext context)
at Mono.Linker.Pipeline.ProcessStep(LinkContext context, IStep step)
at Mono.Linker.Pipeline.Process(LinkContext context)
at MonoDroid.Tuner.Linker.Process(LinkerOptions options, ILogger logger, LinkContext& context)
at Xamarin.Android.Tasks.LinkAssemblies.Execute(DirectoryAssemblyResolver res)
at Xamarin.Android.Tasks.LinkAssemblies.RunTask()
at Microsoft.Android.Build.Tasks.AndroidTask.Execute() in /Users/builder/azdo/_work/1/s/xamarin-android/external/xamarin-android-tools/src/Microsoft.Android.Build.BaseTasks/AndroidTask.cs:line 17
Since choosing Sdk and Users Assemblies probably is not an option, any idea how can I prevent the error that appears with Sdk assemblies only?
You will see this exception at runtime when code has been stripped from the executable usually by the linker or R8/Proguard. You can provide a custom link configuration file to both tools allowing you to keep code the linker or R8/Proguard you are not using. These tools are not able to properly detect code you use at runtime (e.g. via reflection) .
For this problem, you can drive the linking process with an XML file that describes what you want from the linker.
To do this, you define an XML file with the top-level element which contains assembly nodes which in turn contain type nodes, which in turn contain method and field nodes.
Once you have this linker description file, add it to your project and:
For Android : set the Build Action to LinkDescription
For iOS : set the Build Action to LinkDescription
For more, you can check document: https://learn.microsoft.com/en-us/xamarin/cross-platform/deploy-test/linker
I have a problem, with no real explanation.
I create the startup project, inside my github repository.
When I build the project, I get this error:
Severity Code Description Project File Line Suppression State
Error System.IO.DirectoryNotFoundException: Could not find a part of the path 'C:\Users\jonas\Desktop\myCode\1. Skola\Webbutveckling .NET\Kurser\11, LIA - Lärande i Arbete 2\Projekt\schoolmeals-mobile\SchoolMeals-Mobile\SchoolMeals-Mobile\SchoolMeals-Mobile.Android\obj\Debug\90\lp\12\jl\res\drawable-hdpi-v4\notification_bg_low_normal.9.png'.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.File.InternalDelete(String path, Boolean checkHost)
at System.IO.File.Delete(String path)
at Xamarin.Android.Tools.Files.CopyIfStreamChanged(Stream stream, String destination)
at Xamarin.Android.Tools.Files.ExtractAll(ZipArchive zip, String destination, Action`2 progressCallback, Func`2 modifyCallback, Func`2 deleteCallback, Func`2 skipCallback)
at Xamarin.Android.Tasks.ResolveLibraryProjectImports.Extract(IDictionary`2 jars, ICollection`1 resolvedResourceDirectories, ICollection`1 resolvedAssetDirectories, ICollection`1 resolvedEnvironments)
at Xamarin.Android.Tasks.ResolveLibraryProjectImports.RunTask()
at Xamarin.Android.Tasks.AndroidTask.Execute() SchoolMeals-Mobile.Android
It doesnt make any sense to me at all.
Since this is a startup project, it shouldnt give errors and warnings, first thing it does.
I have also tried creating it outside of the github repo, but it also wont work.
Anyone with similar problems? Someone who may know a solution to this weird problem?
Thanks everyone for your input! The problem was too long path.
I want to release my android app. When I try to build it, it gives me the following error:
Severity Code Description Project File Line Suppression State
Error The "LinkAssemblies" task failed unexpectedly.
Java.Interop.Tools.Diagnostics.XamarinAndroidException: error XA2006: Reference to metadata item 'Mono.Security.Interface.MonoTlsProviderFactoryDelegate' (defined in 'Xamarin.iOS, Version=0.0.0.0, Culture=neutral, PublicKeyToken=84e04ff9cfb79065') from 'Xamarin.iOS, Version=0.0.0.0, Culture=neutral, PublicKeyToken=84e04ff9cfb79065' could not be resolved. ---> Mono.Cecil.ResolutionException: Failed to resolve Mono.Security.Interface.MonoTlsProviderFactoryDelegate
at Mono.Linker.Steps.MarkStep.MarkType(TypeReference reference)
at MonoDroid.Tuner.MonoDroidMarkStep.MarkType(TypeReference reference)
at Mono.Linker.Steps.MarkStep.MarkField(FieldReference reference)
at Mono.Linker.Steps.MarkStep.InitializeFields(TypeDefinition type)
at Mono.Linker.Steps.MarkStep.InitializeType(TypeDefinition type)
at Mono.Linker.Steps.MarkStep.InitializeAssembly(AssemblyDefinition assembly)
at Mono.Linker.Steps.MarkStep.Initialize()
at Mono.Linker.Steps.MarkStep.Process(LinkContext context)
at Mono.Linker.Pipeline.Process(LinkContext context)
at MonoDroid.Tuner.Linker.Process(LinkerOptions options, LinkContext& context)
at Xamarin.Android.Tasks.LinkAssemblies.Execute()
--- End of inner exception stack trace ---
at Java.Interop.Tools.Diagnostics.Diagnostic.Error(Int32 code, Exception innerException, String message, Object[] args)
at Xamarin.Android.Tasks.LinkAssemblies.Execute()
at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext() TOPAPP.Droid
I have deleted the xamarin.ios reference in the app.droid but that didn't work. Any suggestions? I also tried setting the android versions to what ever I found on the internet. I also tried updating PCL version but still nothing. Am I missing something?
EDIT:
In my project I also have a portable library linked to the android project with ios code in it.
I'm not sure why you might have Xamarin.iOS referenced in your Xamarin.Android project. But the issue is that you have some type of reference there when it shouldn't be. Your PCL should not have any Native code inside it.
The Linker does not do any work when it's a Debug configuration. When you change to Release it will try to find assemblies that you do not use and strip them out. For some reason you have an iOS assembly in your Android project.
Check that your Xamarin.Android and PCL project do not reference Xamarin.iOS in anyway. The native projects should only be referencing the PCL(Which contains no Native Code inside)
i have problem with TFS build, all time its failed with different type of errors, i resolved mostly, but still there are errors, i am not sure why these are and how these will resolve. i am sorry i can not explain more in detail.
error 1
C:\Builds\1\SmallBiz\SmallBiz-Web\Sources\SmallBiz.Web\SmallBiz.Web.csproj
(9921): 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 ..\.nuget\NuGet.targets.
error 2
Exception Message: MSBuild error 1 has ended this build. You can find
more specific information about the cause of this error in above
messages. (type BuildProcessTerminateException) Exception Stack Trace:
at System.Activities.Statements.Throw.Execute(CodeActivityContext
context) at
System.Activities.CodeActivity.InternalExecute(ActivityInstance
instance, ActivityExecutor executor, BookmarkManager bookmarkManager)
at
System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor
executor, BookmarkManager bookmarkManager, Location resultLocation)
errors image
please help me or guide me, where i am wrong, what i am missing in configuration. i appreciate your valuable time and effort, thanks in advance.
finally i resolved my problem to remove the following tags or lines in .csproj file
right click on project unload it
right click on project to edit project file and remove the below code
1. <RestorePackages>true</RestorePackages>
2. <Import Project="$(SolutionDir)\.nuget\nuget.targets" />
3. <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>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 {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('$(SolutionDir)\.nuget\NuGet.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\.nuget\NuGet.targets'))" />
</Target>
under the solution Delete .nuget files from source control
reload project and build it
check in changes
Could any one solve this problem?
I have the same error, running Build Definition "Gated Check-in" in Visual Studio 2013.
I created a Build Definition, selected the Gated Ckeck-In trigger. I have disabled almost everything, Automated tests, Clean Workspace, and I keep seeing the following error message:
Other Errors and Warnings
1 error(s), 0 warning(s)
Exception Message: MSBuild error 1 has ended this build. You can find more specific information about the cause of this error in above messages. (type BuildProcessTerminateException)
Exception Stack Trace: at System.Activities.Statements.Throw.Execute(CodeActivityContext context)
at System.Activities.CodeActivity.InternalExecute(ActivityInstance instance, ActivityExecutor executor, BookmarkManager bookmarkManager)
at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation)
Has anyone already solved it?
Cheers!
I found what it is, at least in my case.
When I make my build fail intentionally (missing a ; for instance) it throws this first error (missing ; at line #) and the general error: MSBuild error 1 has ended this build. You can find more specific information about the cause of this error in above messages.
I didn't put much attention in that message. So if an error is found in my build, automatically it throws that MSBuild error, otherwise it succeed perfectly well.