Closed Odirb closed 5 years ago
I believe this is a duplicate of https://github.com/mono/SkiaSharp/issues/736
You can add
<MigrateToNewXMIdentifier>true</MigrateToNewXMIdentifier>
in your project.
Thanks for you response Matthew, But when I add MigrateToNewXMIdentifier to my project it cannot be loaded by Visual Studio (I'm using the latest VS for Mac 2019 - version 8.1.5 build 9).
I have extracted the exception from ~/Library/Logs/VisualStudio/8.0/Ide.2019-07-22__09-01-53.log file :
> 2019-07-22 09:55:10.238 VisualStudio[1779:67299] View <NSStackView: 0x7fa2b2206f50> has 1 views pointing at it that can't be found.
ERROR [2019-07-22 09:55:10Z]: Error while trying to load the project /Users/christophe/Projects/TestSkia/FullMicMac/FullMicMac.csproj
System.ArgumentException: Project does not support framework 'Xamarin.Mac.NET,Version=v4.7.2'
at MonoDevelop.Projects.DotNetProject.set_TargetFramework (MonoDevelop.Core.Assemblies.TargetFramework value) [0x0008a] in /Users/vsts/agent/2.153.2/work/1/s/monodevelop/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/DotNetProject.cs:419
at MonoDevelop.Projects.DotNetProject.OnReadProjectHeader (MonoDevelop.Core.ProgressMonitor monitor, MonoDevelop.Projects.MSBuild.MSBuildProject msproject) [0x00106] in /Users/vsts/agent/2.153.2/work/1/s/monodevelop/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/DotNetProject.cs:1972
at MonoDevelop.Projects.Project+DefaultMSBuildProjectExtension.OnReadProjectHeader (MonoDevelop.Core.ProgressMonitor monitor, MonoDevelop.Projects.MSBuild.MSBuildProject msproject) [0x00000] in /Users/vsts/agent/2.153.2/work/1/s/monodevelop/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/Project.cs:4836
at MonoDevelop.Projects.ProjectExtension.OnReadProjectHeader (MonoDevelop.Core.ProgressMonitor monitor, MonoDevelop.Projects.MSBuild.MSBuildProject msproject) [0x00000] in /Users/vsts/agent/2.153.2/work/1/s/monodevelop/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectExtension.cs:141
at MonoDevelop.Projects.ProjectExtension.OnReadProjectHeader (MonoDevelop.Core.ProgressMonitor monitor, MonoDevelop.Projects.MSBuild.MSBuildProject msproject) [0x00000] in /Users/vsts/agent/2.153.2/work/1/s/monodevelop/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectExtension.cs:141
at MonoDevelop.Projects.ProjectExtension.OnReadProjectHeader (MonoDevelop.Core.ProgressMonitor monitor, MonoDevelop.Projects.MSBuild.MSBuildProject msproject) [0x00000] in /Users/vsts/agent/2.153.2/work/1/s/monodevelop/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectExtension.cs:141
at MonoDevelop.Projects.ProjectExtension.OnReadProjectHeader (MonoDevelop.Core.ProgressMonitor monitor, MonoDevelop.Projects.MSBuild.MSBuildProject msproject) [0x00000] in /Users/vsts/agent/2.153.2/work/1/s/monodevelop/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectExtension.cs:141
at MonoDevelop.Projects.ProjectExtension.OnReadProjectHeader (MonoDevelop.Core.ProgressMonitor monitor, MonoDevelop.Projects.MSBuild.MSBuildProject msproject) [0x00000] in /Users/vsts/agent/2.153.2/work/1/s/monodevelop/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectExtension.cs:141
at MonoDevelop.Projects.ProjectExtension.OnReadProjectHeader (MonoDevelop.Core.ProgressMonitor monitor, MonoDevelop.Projects.MSBuild.MSBuildProject msproject) [0x00000] in /Users/vsts/agent/2.153.2/work/1/s/monodevelop/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectExtension.cs:141
at MonoDevelop.Projects.ProjectExtension.OnReadProjectHeader (MonoDevelop.Core.ProgressMonitor monitor, MonoDevelop.Projects.MSBuild.MSBuildProject msproject) [0x00000] in /Users/vsts/agent/2.153.2/work/1/s/monodevelop/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectExtension.cs:141
at MonoDevelop.Projects.ProjectExtension.OnReadProjectHeader (MonoDevelop.Core.ProgressMonitor monitor, MonoDevelop.Projects.MSBuild.MSBuildProject msproject) [0x00000] in /Users/vsts/agent/2.153.2/work/1/s/monodevelop/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectExtension.cs:141
at MonoDevelop.Projects.ProjectExtension.OnReadProjectHeader (MonoDevelop.Core.ProgressMonitor monitor, MonoDevelop.Projects.MSBuild.MSBuildProject msproject) [0x00000] in /Users/vsts/agent/2.153.2/work/1/s/monodevelop/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectExtension.cs:141
at MonoDevelop.Projects.ProjectExtension.OnReadProjectHeader (MonoDevelop.Core.ProgressMonitor monitor, MonoDevelop.Projects.MSBuild.MSBuildProject msproject) [0x00000] in /Users/vsts/agent/2.153.2/work/1/s/monodevelop/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectExtension.cs:141
at MonoDevelop.MonoMac.XamMac2ProjectFlavor.OnReadProjectHeader (MonoDevelop.Core.ProgressMonitor monitor, MonoDevelop.Projects.MSBuild.MSBuildProject msproject) [0x00000] in /Users/vsts/agent/2.150.3/work/1/s/MonoDevelop.MonoMac/MonoDevelop.MonoMac/Project/XamMac2Project.cs:309
at MonoDevelop.Projects.ProjectExtension.OnReadProjectHeader (MonoDevelop.Core.ProgressMonitor monitor, MonoDevelop.Projects.MSBuild.MSBuildProject msproject) [0x00000] in /Users/vsts/agent/2.153.2/work/1/s/monodevelop/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectExtension.cs:141
at MonoDevelop.Projects.ProjectExtension.OnReadProjectHeader (MonoDevelop.Core.ProgressMonitor monitor, MonoDevelop.Projects.MSBuild.MSBuildProject msproject) [0x00000] in /Users/vsts/agent/2.153.2/work/1/s/monodevelop/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectExtension.cs:141
at MonoDevelop.Projects.ProjectExtension.OnReadProjectHeader (MonoDevelop.Core.ProgressMonitor monitor, MonoDevelop.Projects.MSBuild.MSBuildProject msproject) [0x00000] in /Users/vsts/agent/2.153.2/work/1/s/monodevelop/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectExtension.cs:141
at MonoDevelop.Projects.ProjectExtension.OnReadProjectHeader (MonoDevelop.Core.ProgressMonitor monitor, MonoDevelop.Projects.MSBuild.MSBuildProject msproject) [0x00000] in /Users/vsts/agent/2.153.2/work/1/s/monodevelop/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectExtension.cs:141
at MonoDevelop.Projects.ProjectExtension.OnReadProjectHeader (MonoDevelop.Core.ProgressMonitor monitor, MonoDevelop.Projects.MSBuild.MSBuildProject msproject) [0x00000] in /Users/vsts/agent/2.153.2/work/1/s/monodevelop/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectExtension.cs:141
at MonoDevelop.Projects.Project.ReadProject (MonoDevelop.Core.ProgressMonitor monitor, MonoDevelop.Projects.MSBuild.MSBuildProject msproject) [0x0004d] in /Users/vsts/agent/2.153.2/work/1/s/monodevelop/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/Project.cs:2593
at MonoDevelop.Projects.Project.LoadAsync (MonoDevelop.Core.ProgressMonitor monitor) [0x000ed] in /Users/vsts/agent/2.153.2/work/1/s/monodevelop/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/Project.cs:437
at MonoDevelop.Projects.Project+<>c__DisplayClass68_0.<OnLoad>b__0 () [0x00028] in /Users/vsts/agent/2.153.2/work/1/s/monodevelop/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/Project.cs:418
at MonoDevelop.Projects.MSBuild.MSBuildProjectService.LoadItem (MonoDevelop.Core.ProgressMonitor monitor, System.String fileName, MonoDevelop.Projects.MSBuild.MSBuildFileFormat expectedFormat, System.String typeGuid, System.String itemGuid, MonoDevelop.Projects.SolutionLoadContext ctx) [0x001f0] in /Users/vsts/agent/2.153.2/work/1/s/monodevelop/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildProjectService.cs:405
at MonoDevelop.Projects.ProjectService+<>c__DisplayClass25_0.<ReadSolutionItem>b__0 () [0x00101] in /Users/vsts/agent/2.153.2/work/1/s/monodevelop/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectService.cs:126
at MonoDevelop.Core.Runtime+<>c__44`1[T].<RunInMainThread>b__44_0 (System.Object state) [0x00046] in /Users/vsts/agent/2.153.2/work/1/s/monodevelop/main/src/core/MonoDevelop.Core/MonoDevelop.Core/Runtime.cs:389
Since VS for Mac is not ready to target Xamarin.Mac.NET yet, I will use this ugly workaround for now: add the libSkiaSharp.dylib in my main project as "Content". The library will be copy in bundle after compilation in the correct folder to be loaded by SkiaSharp.dll
It is a tad bit disappointing. But the workaround to add the .dylib should do it for the time being. I'll have a look at the targets file - I may be able to tweak a few lines to copy this in if it detects the full framework.
Just a link to the info about the support: https://github.com/NuGet/NuGet.Client/pull/2572#issuecomment-514103636
Description
Application crash on SKBitmap creation with a DllNotFoundException in inner exception :
System.TypeInitializationException: The type initializer for 'SkiaSharp.SKImageInfo' threw an exception. ---> System.DllNotFoundException: libSkiaSharp at at (wrapper managed-to-native) SkiaSharp.SkiaApi.sk_colortype_get_default_8888() at SkiaSharp.SKImageInfo..cctor () [0x00000] in:0
--- End of inner exception stack trace ---
at at (wrapper managed-to-native) System.Object.__icall_wrapper_mono_generic_class_init(intptr)
at SkiaSharp.SKBitmap..ctor (System.Int32 width, System.Int32 height, System.Boolean isOpaque) [0x00000] in :0
at TestSkia.MainClass.Main (System.String[] args) [0x00001] in /Users/christophe/Projects/TestSkia/TestSkia/Main.cs:10
Code `namespace TestSkia { static class MainClass { static void Main(string[] args) { new SKBitmap(10, 10);
} `
Expected Behavior
Output directory should contains libSkiaSharp.dylib (native Skia library for OSX)
Actual Behavior
Output directory contains x86/libSkiaSharp.dll and x64/libSkiaSharp.dll, which are native library for Windows and not OSX
Basic Information