I am working on an MonoDevelop Addin (using MonoDevelop.AddinMaker) within Tamarin Studio and MonoDevelop and everything was fine, till I needed to access the GTK# Toolbox to fix some existing GUI panels (originally from the CSharpBinding GUIs).
The GTK# Widget that is referenced in those panels are in MonoDevelop.Ide.dll, so I added that to the GTK# ToolBox and the widgets show up. But the build generates invalid partial classes due to missing widget reference (MonoDevelop.Ide) and that reference is not available via the AddinMaker's Addin References system so I added a manual assembly reference to MonoDevelop.Ide.dll.
Now the debugging of the Addin fails with:
ERROR [2015-11-22 11:47:39Z]: Add-in error (MonoDevelop.Ide,5.10): Add-in could not be loaded: The required addin 'MonoDevelop.Core,5.10' is disabled.
Mono.Addins.MissingDependencyException: The required addin 'MonoDevelop.Core,5.10' is disabled.
at Mono.Addins.AddinEngine.ResolveLoadDependencies (System.Collections.ArrayList addins, System.Collections.Stack depCheck, System.String id, Boolean optional) in /Users/builder/data/lanes/2103/7c46a0b7/source/monodevelop/main/external/mono-addins/Mono.Addins/Mono.Addins/AddinEngine.cs:line 597
at Mono.Addins.AddinEngine.ResolveLoadDependencies (System.Collections.ArrayList addins, System.Collections.Stack depCheck, System.String id, Boolean optional) in /Users/builder/data/lanes/2103/7c46a0b7/source/monodevelop/main/external/mono-addins/Mono.Addins/Mono.Addins/AddinEngine.cs:line 612
ERROR [2015-11-22 11:47:39Z]: Add-in error (MonoDevelop.Core,5.10): Disabled add-ins can't be loaded.
Loaded assembly: /Applications/Xamarin Studio.app/Contents/Resources/lib/monodevelop/bin/Mono.Addins.CecilReflector.dll [External]
Thread started: #3
Unloaded assembly: /Applications/Xamarin Studio.app/Contents/Resources/lib/monodevelop/bin/Mono.Addins.CecilReflector.dll
Thread finished: #3
System.InvalidOperationException: Extension node not found in path: /MonoDevelop/Core/WebCredentialProviders
at Mono.Addins.ExtensionContext.GetExtensionObjects[T] (System.String path, Boolean reuseCachedInstance) in /Users/builder/data/lanes/2103/7c46a0b7/source/monodevelop/main/external/mono-addins/Mono.Addins/Mono.Addins/ExtensionContext.cs:line 636
at Mono.Addins.ExtensionContext.GetExtensionObjects[T] (System.String path) in /Users/builder/data/lanes/2103/7c46a0b7/source/monodevelop/main/external/mono-addins/Mono.Addins/Mono.Addins/ExtensionContext.cs:line 607
at Mono.Addins.AddinManager.GetExtensionObjects[T] (System.String path) in /Users/builder/data/lanes/2103/7c46a0b7/source/monodevelop/main/external/mono-addins/Mono.Addins/Mono.Addins/AddinManager.cs:line 630
at MonoDevelop.Core.WebRequestHelper.Initialize () in /Users/builder/data/lanes/2103/7c46a0b7/source/monodevelop/main/src/core/MonoDevelop.Core/MonoDevelop.Core/WebRequestHelper.cs:line 49
at MonoDevelop.Core.Runtime.Initialize (Boolean updateAddinRegistry) in /Users/builder/data/lanes/2103/7c46a0b7/source/monodevelop/main/src/core/MonoDevelop.Core/MonoDevelop.Core/Runtime.cs:line 118
Starting Xamarin Studio
FATAL ERROR [2015-11-22 11:47:42Z]: Xamarin Studio failed to start. Some of the assemblies required to run Xamarin Studio (for example gtk-sharp)may not be properly installed in the GAC.
System.InvalidOperationException: Extension node not found in path: /MonoDevelop/Core/PlatformService
at Mono.Addins.ExtensionContext.GetExtensionObjects (System.String path, System.Type arrayElementType, Boolean reuseCachedInstance) in /Users/builder/data/lanes/2103/7c46a0b7/source/monodevelop/main/external/mono-addins/Mono.Addins/Mono.Addins/ExtensionContext.cs:line 669
at Mono.Addins.ExtensionContext.GetExtensionObjects (System.String path) in /Users/builder/data/lanes/2103/7c46a0b7/source/monodevelop/main/external/mono-addins/Mono.Addins/Mono.Addins/ExtensionContext.cs:line 534
at Mono.Addins.AddinManager.GetExtensionObjects (System.String path) in /Users/builder/data/lanes/2103/7c46a0b7/source/monodevelop/main/external/mono-addins/Mono.Addins/Mono.Addins/AddinManager.cs:line 554
at MonoDevelop.Ide.DesktopService.Initialize () in /Users/builder/data/lanes/2103/7c46a0b7/source/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/DesktopService.cs:line 56
at MonoDevelop.Ide.IdeStartup.Run (MonoDevelop.Ide.MonoDevelopOptions options) in /Users/builder/data/lanes/2103/7c46a0b7/source/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/IdeStartup.cs:line 175
at MonoDevelop.Ide.IdeStartup.Main (System.String[] args, MonoDevelop.Ide.Extensions.IdeCustomizer customizer) in /Users/builder/data/lanes/2103/7c46a0b7/source/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/IdeStartup.cs:line 652
I removed the assembly reference, removed the GTK Toolbox MonoDevelop components/widget, etc.. but the problem persists.
MonoDevelop and Xamarin Studio run fine by themselves, so how do I re-enable(?) the MonoDevelop.Core addin in the AddinMaker Project?
I would try deleting the addin-db-002 directory (might be called
something different) which is inside the directory of your addin's
bin/Debug directory. – Matt Ward
That was actually the problem, the addin-db-002 does not cleaned up on a Clean All, nor does it get a complete update on a Build All.
So once you have a 'corrupt' list of addin's within the sub-dir of ./addin-data/1 they do not get re-created unless you manually delete the addin-db-002.
Related
I have Xamarin Android project using Azure Hosted VS2017 to build its packages. I have updated the Xamarin packages and tried to generate a build from the pipeline. It's able to build it successfully but when I ran the app, Fatal exception is thrown.
10-02 12:40:53.943 7921-7921/? E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.telstra.lot, PID: 7921
android.runtime.JavaProxyThrowable: System.DllNotFoundException: System.Native
at (wrapper managed-to-native) Interop+Sys.Stat(byte&,Interop/Sys/FileStatus&)
at Interop+Sys.Stat (System.ReadOnlySpan`1[T] path, Interop+Sys+FileStatus& output) [0x00028] in <ff07eae8184a40a08e79049bbcb31a0e>:0
at System.IO.FileSystem.FileExists (System.ReadOnlySpan`1[T] fullPath, System.Int32 fileType, Interop+ErrorInfo& errorInfo) [0x00007] in <ff07eae8184a40a08e79049bbcb31a0e>:0
at System.IO.FileSystem.DirectoryExists (System.ReadOnlySpan`1[T] fullPath, Interop+ErrorInfo& errorInfo) [0x00000] in <ff07eae8184a40a08e79049bbcb31a0e>:0
at System.IO.FileSystem.DirectoryExists (System.ReadOnlySpan`1[T] fullPath) [0x00000] in <ff07eae8184a40a08e79049bbcb31a0e>:0
at System.IO.Directory.Exists (System.String path) [0x0001e] in <ff07eae8184a40a08e79049bbcb31a0e>:0
at FFImageLoading.Cache.SimpleDiskCache..ctor (System.String cachePath, FFImageLoading.Config.Configuration configuration) [0x00069] in <e4a68679a2a44c4694e04140bb609f9a>:0
at FFImageLoading.ImageService.CreatePlatformDiskCacheInstance (FFImageLoading.Config.Configuration configuration) [0x00075] in <e4a68679a2a44c4694e04140bb609f9a>:0
at FFImageLoading.ImageServiceBase`1[TImageContainer].InitializeIfNeeded (FFImageLoading.Config.Configuration userDefinedConfig) [0x00137] in <a159011f32534c8eb0455a9cf0bad5a7>:0
at FFImageLoading.ImageServiceBase`1[TImageContainer].Initialize () [0x00021] in <a159011f32534c8eb0455a9cf0bad5a7>:0
Its working fine with the build generated from VS for mac which has the Xamarin.Android version 9.4x. So I'm wondering the hosted VS2017 pointing an old version of Xamairn.Android sdk.
I can find a version in the build logs from the pipeline
_ResolveXamarinAndroidTools:
Looking for Android NDK...
Found Xamarin.Android 9.1.7.0
Found Xamarin.Android 9.1.7.0
You have here links to all the included software on the agents.
To Azure Hosted VS2017 this is the page and you can see there these versions:
Android SDK Platforms
10 (API 29):
Location: C:\Program Files (x86)\Android\android-sdk\platforms\android-29
9 (API 28):
Location: C:\Program Files (x86)\Android\android-sdk\platforms\android-28
8.1.0 (API 27):
Location: C:\Program Files (x86)\Android\android-sdk\platforms\android-27
8.0.0 (API 26):
Location: C:\Program Files (x86)\Android\android-sdk\platforms\android-26
7.1.1 (API 25):
Location: C:\Program Files (x86)\Android\android-sdk\platforms\android-25
7.0 (API 24):
Location: C:\Program Files (x86)\Android\android-sdk\platforms\android-24
6.0 (API 23):
Location: C:\Program Files (x86)\Android\android-sdk\platforms\android-23
5.1.1 (API 22):
Location: C:\Program Files (x86)\Android\android-sdk\platforms\android-22
5.0.1 (API 21):
Location: C:\Program Files (x86)\Android\android-sdk\platforms\android-21
4.4.2 (API 19):
Location: C:\Program Files (x86)\Android\android-sdk\platforms\android-19
I'm working on a Hololens application using Unity 2018.2.20f1. I'm building the application for UWP from Unity without a problem. However, after opening up the generated solution in the VisualStudio 2017 (Community Edition) and trying to build it, the build process fails with the following errors:
Severity Code Description Project File Line Suppression State
Error MSB3073 The command ""D:\Projects\VSProjects\VirtualPrague\Il2CppOutputProject\\IL2CPP\build\il2cpp.exe" --libil2cpp-static --compile-cpp -architecture=x86 -configuration=Release -platform=winrt -outputpath="D:\Projects\VSProjects\VirtualPrague\\build\bin\Win32\Release\GameAssembly.dll" --data-folder="D:\Projects\VSProjects\VirtualPrague\\build\bin\Win32\Release\\" -cachedirectory="D:\Projects\VSProjects\VirtualPrague\\build\obj\il2cppOutputProject\Win32\Release\\" -generatedcppdir="D:\Projects\VSProjects\VirtualPrague\Il2CppOutputProject\\Source" --additional-defines=WINDOWS_UWP --additional-defines=UNITY_UWP --additional-defines=UNITY_WSA_10_0 --additional-defines=UNITY_WSA --additional-defines=UNITY_WINRT --additional-defines=PLATFORM_WINRT -dotnetprofile=unityjit -verbose --map-file-parser="D:\Projects\VSProjects\VirtualPrague\Il2CppOutputProject\\IL2CPP\MapFileParser\MapFileParser.exe"" exited with code -532462766. Il2CppOutputProject C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.MakeFile.Targets 44
and
Severity Code Description Project File Line Suppression State
Error LNK1181 cannot open input file 'D:\Projects\VSProjects\VirtualPrague\build\bin\Win32\Release\GameAssembly.lib' VirtualPrague D:\Projects\VSProjects\VirtualPrague\VirtualPrague\LINK 1
In the output there are multiple exceptions, similar to this one:
1>il2cpp.exe didn't catch exception: System.IO.IOException: The process cannot access the file 'C:\Users\dev\AppData\Local\Temp\tmpDE97.tmp' because it is being used by another process.
1> at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
1> at System.IO.File.InternalDelete(String path, Boolean checkHost)
1> at Unity.IL2CPP.Shell.Execute(ExecuteArgs executeArgs, IExecuteController controller)
1> at Unity.IL2CPP.Building.CppProgramBuilder.PostprocessObjectFiles(HashSet`1 objectFiles, CppToolChainContext toolChainContext)
1> at Unity.IL2CPP.Building.CppProgramBuilder.Build(IBuildStatistics& statistics)
1> at il2cpp.Program.DoRun(String[] args)
1> at il2cpp.Program.Run(String[] args)
1> at il2cpp.Program.Main(String[] args)
The exceptions are the same but were thrown for different files. I tried to reinstall the Visual Studio and managed to get a build. The next day I turned on the PC and this error was back. I stopped all of the VS instances and processed from the task manager, deleted all of the files from the Temp folder and managed to get a build a couple more times. Then this error came back.
From what I can tell, during the build process, Visual Studio creates some *.tmp files and for some reason thinks that another process is using it.
Any idea why this is happening and how can it be solved?
Thanks a lot!
Edit: So here is what I did so far (this is more of a work around rather then a solution)
Uninstall vs and unity
Clear the registry with ccleaner and Advanced Uninstaller Pro
Install vs and Unity
Every time I want to get a build I,
Close all of vs instances
Clear Temp folder (C:\Users\dev\AppData\Local\Temp)
Delete previous vs solution
Build from Unity
Run vs as Administrator
Build and deploy the solution from vs
And it works for the most the time. Also, changing the solution configuration (from debug to release and vice versa) helps sometimes.
I'm compiling the sources in Visual Studio Community 2017 for Mac and I've got the following error:
Building: ServiceLayer.API (Debug)
Error: Build failed. See the build log for details. (ServiceLayer.API)
---------------------- Done ----------------------
Build failed.
Build: 1 error, 0 warnings
In Ide.log log file, I've the following entry:
ERROR [2017-10-08 20:20:45Z]: Inspector does not support this project type
ERROR [2017-10-08 20:20:45Z]: Build failed.
System.Exception: Did not find MSBuild for runtime Mono 4.0.2 (c99aa0c)
at MonoDevelop.Projects.MSBuild.MSBuildProjectService.GetNewestInstalledToolsVersion (MonoDevelop.Core.Assemblies.TargetRuntime runtime, System.Boolean requiresMicrosoftBuild, System.String& binDir) [0x0006e] in /Users/builder/data/lanes/5144/cab57de4/source/monodevelop/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildProjectService.cs:1087
at MonoDevelop.Projects.MSBuild.MSBuildProjectService+<GetProjectBuilder>d__100.MoveNext () [0x00133] in /Users/builder/data/lanes/5144/cab57de4/source/monodevelop/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildProjectService.cs:1116
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in /Users/builder/data/lanes/4992/mono-mac-sdk/external/bockbuild/builds/mono-x64/mcs/class/referencesource/mscorlib/system/runtime/exceptionservices/exceptionservicescommon.cs:151
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x00037] in /Users/builder/data/lanes/4992/mono-mac-sdk/external/bockbuild/builds/mono-x64/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:187
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in /Users/builder/data/lanes/4992/mono-mac-sdk/external/bockbuild/builds/mono-x64/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:156
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in /Users/builder/data/lanes/4992/mono-mac-sdk/external/bockbuild/builds/mono-x64/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:128
at System.Runtime.CompilerServices.TaskAwaiter`1[TResult].GetResult () [0x00000] in /Users/builder/data/lanes/4992/mono-mac-sdk/external/bockbuild/builds/mono-x64/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:357
at MonoDevelop.Projects.Project+<GetProjectBuilder>d__157.MoveNext () [0x001bb] in /Users/builder/data/lanes/5144/cab57de4/source/monodevelop/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/Project.cs:1418
...
ERROR [2017-10-08 20:21:16Z]: An unhandled exception has occured. Terminating Visual Studio? False
Notes: In total like 381 lines on each attempt to build. 'End of stack trace' line is repeated 52 times.
This pointed me to this line in MonoDevelop (see: MSBuildProjectService.cs):
throw new Exception ("Did not find MSBuild for runtime " + runtime.Id);
I've checked and msbuild command exist in the command-line:
$ which msbuild
/Library/Frameworks/Mono.framework/Versions/Current/Commands/msbuild
$ msbuild --version
Microsoft (R) Build Engine version 15.4.0.0 (master/f296e67b Thu Sep 21 19:38:16 EDT 2017) for Mono
$ stat /Library/Frameworks/Mono.framework/Versions/Current
File: /Library/Frameworks/Mono.framework/Versions/Current -> /Library/Frameworks/Mono.framework/Versions/5.4.0
What I've tried so far:
I've tested both channels (Stable and Beta) in Visual Studio Update without success.
I've tried to Clean All and Rebuild All.
I've tried to remove the cache files in ~/Library/Caches/VisualStudio.
Reinstalling VisualStudio.
I've checked in Visual Studio, Preference..., Projects, .NET Runtimes and I've the latest Mono set as Default (to 5.4.x):
However when debugging, it's trying to open msbuild for 4.0.2 instead, e.g.:
$ sudo fs_usage -f pathname VisualStudio | grep -i msbuild
12:34:38 stat64 /Library/Frameworks/Mono.framework/Versions/4.0.2/lib/mono/msbuild>>>>>>>>>>>>>>>>>>>>>> 0.000007 VisualStudio
12:34:38 lstat64 /Library/Frameworks/Mono.framework/Versions/4.0.2/lib/mono/msbuild>>>>>>>>>>>>>>>>>>>>>> 0.000002 VisualStudio
12:34:38 access /Library/Frameworks/Mono.framework/Versions/4.0.2/lib/mono/msbuild>>>>>>>>>>>>>>>>>>>>>> 0.000002 VisualStudio
which doesn't exist.
How should I add a missing MSBuild to my Solution (project) (as per mentioned error)?
Mono 4.0.2 did not have msbuild, it was included in 4.8.0+ . Check where does /Library/Frameworks/Mono.framework/Versions/Current (symlink) point to. It probably points to some mono 5.x.y . Try changing the .NET runtime that VSMac is set to use in Preferences -> Projects -> .NET Runtimes, to the latest one.
For some reason it is still looking it in 4.0.2. I would try to, at least temporarily, remove that 4.0.2 directory and then check. But otherwise I think your installation is broken and I would try to reinstall the whole thing (VSMac, Mono, ..).
Also, check in your Ide.log file for any references to 4.0.2, before that exception.
If you run into the same issue even with a fresh install, then please file a bug at bugzilla.xamarin.com and we can try to debug it there.
On Visual Studio for Mac 7.1, I am trying to build a project that builds fine on Visual Studio 20176 Update 3.
The first error on a project file is:
Target ResolveKeySource:
/Library/Frameworks/Mono.framework/Versions/5.2.0/lib/mono/msbuild/15.0/bin/Microsoft.Common.CurrentVersion.targets(3103,5): error MSB3322: Unable to get MD5 checksum for the key file "../xxx.pfx". Could not find file "/Users/PATH/xxx.pfx".
Done building target "ResolveKeySource" in project "yyy" -- FAILED.
The pfx actually exists and is readable.
With more logging enabled, it reads:
error MSB4018: The "ResolveKeySource" task failed unexpectedly.
error MSB4018: System.NotSupportedException: Specified method is not supported.
error MSB4018: at System.Runtime.InteropServices.RuntimeEnvironment.GetRuntimeInterfaceAsObject (System.Guid clsid, System.Guid riid) [0x00006] in /private/tmp/source-mono-d15-3/bockbuild-d15-3/profiles/mono-mac-xamarin/build-root/mono-x64/mcs/class/referencesource/mscorlib/system/runtime/interopservices/runtimeenvironment.cs:204
error MSB4018: at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&)
error MSB4018: at System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00032] in /private/tmp/source-mono-d15-3/bockbuild-d15-3/profiles/mono-mac-xamarin/build-root/mono-x64/mcs/class/corlib/System.Reflection/MonoMethod.cs:305
I've been playing around with changing the file format for signing, but would like to have one solution that builds easily on Windows and Mac.
Is there a solution with one file format for signing the assemblies?
I just recompiled some old signing-based Xamarin.Android apps w/ the latest Xamarin versions using msbuild/csc and .pfx just do not work (unless there is some magic I am missing).
But converting the .pfx to a .snk to extract the public key worked fine, use the mono version of "StrongName utility for signing assemblies" (sn) on macOS:
sn -p certificate.pfx certificate.snk
It will prompt you for the password, use the resulting .snk file instead. The .snk file will work fine on Windows also.
I'm using VS2013, Xamarin.Android 4.12.4.20.
Build is successful.
I'm getting error from title whenever I try to deploy in debug mode or package.
It started to happened today it work fine before.
I've restarted VS, device, PC - none helped.
Stack trace:
Xamarin.AndroidTools.AndroidDeploymentException: InternalError ---> System.ArgumentException: An item with the same key has already been added.
at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
at Mono.AndroidTools.Adb.AdbSyncDirectory.Add(AdbSyncItem entry)
at Xamarin.AndroidTools.AndroidDeploySession.InstallAssemblies(String destinationPath, CancellationToken token)
at Xamarin.AndroidTools.AndroidDeploySession.FastDev()
at Xamarin.AndroidTools.AndroidDeploySession.Run(CancellationToken token)
at Xamarin.AndroidTools.AndroidDeploySession.RunLogged(CancellationToken token)
--- End of inner exception stack trace ---
at Xamarin.AndroidTools.AndroidDeploySession.RunLogged(CancellationToken token)
at Xamarin.AndroidTools.AndroidDeploySession.Start(CancellationToken token)
Build output:
3>Build succeeded.
3>Waiting for device..
3>Detecting installed packages
3>Detecting installed packages...
3>
3>Removing previous version of application
3>Removing previous version of application...
3>
3>Installing application on device
3>Copying application to device...
3>
3>Getting installation path...
I've figured it out. Make sure that you don't have different versions of the same dll referenced!!
Let me describe my set up a bit more that will help with explaining why exception happened.
I've got two projects
Domain - library with code shared between all platforms
Android - android specific code
Both have nuget references to the same library. At some point android (only in this project) nuget references have been updated which resulted in two versions of the same library required by the application (Domain project still referenced old nuget).
When I tried to package solution I would get warning like :
Consider app.config remapping of assembly "{Library}" from Version "5.6.0.0" [] to Version "5.6.1.0" [{Path}] to solve conflict and get rid of warning.
Once I've update Domain's nuget everything worked.