VitalElement / CefGlue.Core

Port of CefGlue to .net Core
87 stars 23 forks source link

libcef is missed #9

Open Sergey-Terekhin opened 6 years ago

Sergey-Terekhin commented 6 years ago

Hi! I try to create Avalonia app with CefGlue and get following error in runtime:

Unable to load DLL 'libcef': Не найден указанный модуль. (Exception from HRESULT: 0x8007007E)

I've added packages as in the readme and in the sample project:

    <PackageReference Include="VitalElement.CefGlue.Core" Version="0.9.0-build20-alpha" />
    <PackageReference Include="VitalElement.CefGlue.Core.Avalonia" Version="0.9.0-build20-alpha" />

StackTrace:

   at Xilium.CefGlue.Interop.cef_browser_host_t.create_browser(cef_window_info_t* windowInfo, cef_client_t* client, cef_string_t* url, cef_browser_settings_t* settings, cef_request_context_t* request_context)
   at Xilium.CefGlue.CefBrowserHost.CreateBrowser(CefWindowInfo windowInfo, CefClient client, CefBrowserSettings settings, String url, CefRequestContext requestContext)
   at CefGlue.Avalonia.AvaloniaCefBrowser.ArrangeOverride(Size arrangeBounds)
   at Avalonia.Layout.Layoutable.ArrangeCore(Rect finalRect)
   at Avalonia.Layout.Layoutable.Arrange(Rect rect)
   at Avalonia.Controls.Presenters.ContentPresenter.ArrangeOverrideImpl(Size finalSize, Vector offset)
   at Avalonia.Controls.Presenters.ContentPresenter.ArrangeOverride(Size finalSize)
   at Avalonia.Layout.Layoutable.ArrangeCore(Rect finalRect)
   at Avalonia.Layout.Layoutable.Arrange(Rect rect)
   at Avalonia.Layout.Layoutable.ArrangeOverride(Size finalSize)
   at Avalonia.Layout.Layoutable.ArrangeCore(Rect finalRect)
   at Avalonia.Layout.Layoutable.Arrange(Rect rect)
   at Avalonia.Controls.Presenters.ContentPresenter.ArrangeOverrideImpl(Size finalSize, Vector offset)
   at Avalonia.Controls.Presenters.ContentPresenter.ArrangeOverride(Size finalSize)
   at Avalonia.Layout.Layoutable.ArrangeCore(Rect finalRect)
   at Avalonia.Layout.Layoutable.Arrange(Rect rect)
   at Avalonia.Layout.Layoutable.ArrangeOverride(Size finalSize)
   at Avalonia.Layout.Layoutable.ArrangeCore(Rect finalRect)
   at Avalonia.Layout.Layoutable.Arrange(Rect rect)
   at Avalonia.Controls.Presenters.ItemsPresenterBase.ArrangeOverride(Size finalSize)
   at Avalonia.Layout.Layoutable.ArrangeCore(Rect finalRect)
   at Avalonia.Layout.Layoutable.Arrange(Rect rect)
   at Avalonia.Controls.Border.ArrangeOverride(Size finalSize)
   at Avalonia.Layout.Layoutable.ArrangeCore(Rect finalRect)
   at Avalonia.Layout.Layoutable.Arrange(Rect rect)
   at Avalonia.Layout.Layoutable.ArrangeOverride(Size finalSize)
   at Avalonia.Layout.Layoutable.ArrangeCore(Rect finalRect)
   at Avalonia.Layout.Layoutable.Arrange(Rect rect)
   at Avalonia.Controls.DockPanel.ArrangeOverride(Size arrangeSize)
   at Avalonia.Layout.Layoutable.ArrangeCore(Rect finalRect)
   at Avalonia.Layout.Layoutable.Arrange(Rect rect)
   at Avalonia.Controls.Border.ArrangeOverride(Size finalSize)
   at Avalonia.Layout.Layoutable.ArrangeCore(Rect finalRect)
   at Avalonia.Layout.Layoutable.Arrange(Rect rect)
   at Avalonia.Layout.Layoutable.ArrangeOverride(Size finalSize)
   at Avalonia.Layout.Layoutable.ArrangeCore(Rect finalRect)
   at Avalonia.Layout.Layoutable.Arrange(Rect rect)
   at Avalonia.Controls.Presenters.ContentPresenter.ArrangeOverrideImpl(Size finalSize, Vector offset)
   at Avalonia.Controls.Presenters.ContentPresenter.ArrangeOverride(Size finalSize)
   at Avalonia.Layout.Layoutable.ArrangeCore(Rect finalRect)
   at Avalonia.Layout.Layoutable.Arrange(Rect rect)
   at Avalonia.Controls.Decorator.ArrangeOverride(Size finalSize)
   at Avalonia.Controls.Primitives.AdornerDecorator.ArrangeOverride(Size finalSize)
   at Avalonia.Layout.Layoutable.ArrangeCore(Rect finalRect)
   at Avalonia.Layout.Layoutable.Arrange(Rect rect)
   at Avalonia.Controls.Border.ArrangeOverride(Size finalSize)
   at Avalonia.Layout.Layoutable.ArrangeCore(Rect finalRect)
   at Avalonia.Layout.Layoutable.Arrange(Rect rect)
   at Avalonia.Layout.Layoutable.ArrangeOverride(Size finalSize)
   at Avalonia.Controls.WindowBase.ArrangeOverride(Size finalSize)
   at Avalonia.Layout.Layoutable.ArrangeCore(Rect finalRect)
   at Avalonia.Layout.Layoutable.Arrange(Rect rect)
   at Avalonia.Layout.LayoutManager.Arrange(ILayoutable control)
   at Avalonia.Layout.LayoutManager.Arrange(ILayoutable control)
   at Avalonia.Layout.LayoutManager.Arrange(ILayoutable control)
   at Avalonia.Layout.LayoutManager.Arrange(ILayoutable control)
   at Avalonia.Layout.LayoutManager.Arrange(ILayoutable control)
   at Avalonia.Layout.LayoutManager.Arrange(ILayoutable control)
   at Avalonia.Layout.LayoutManager.Arrange(ILayoutable control)
   at Avalonia.Layout.LayoutManager.Arrange(ILayoutable control)
   at Avalonia.Layout.LayoutManager.Arrange(ILayoutable control)
   at Avalonia.Layout.LayoutManager.Arrange(ILayoutable control)
   at Avalonia.Layout.LayoutManager.Arrange(ILayoutable control)
   at Avalonia.Layout.LayoutManager.ExecuteArrangePass()
   at Avalonia.Layout.LayoutManager.ExecuteLayoutPass()
   at Avalonia.Threading.JobRunner.RunJobs(Nullable`1 priority)
   at Avalonia.Win32.Win32Platform.WndProc(IntPtr hWnd, UInt32 msg, IntPtr wParam, IntPtr lParam)
   at Avalonia.Win32.Interop.UnmanagedMethods.DispatchMessage(MSG& lpmsg)
   at Avalonia.Win32.Win32Platform.RunLoop(CancellationToken cancellationToken)
   at Avalonia.Threading.Dispatcher.MainLoop(CancellationToken cancellationToken)
   at FAFClient.Program.Main(String[] args) in H:\Projects\FAFClient.Net\FAFClient\Program.cs:line 13
Sergey-Terekhin commented 6 years ago

I've downloaded x64 build from here (official builds): http://opensource.spotify.com/cefbuilds/index.html And got following error Invalid Operation Exception - "Failed to create browser."

   at Xilium.CefGlue.CefBrowserHost.CreateBrowser(CefWindowInfo windowInfo, CefClient client, CefBrowserSettings settings, String url, CefRequestContext requestContext)
   at CefGlue.Avalonia.AvaloniaCefBrowser.ArrangeOverride(Size arrangeBounds)
   at Avalonia.Layout.Layoutable.ArrangeCore(Rect finalRect)
   at Avalonia.Layout.Layoutable.Arrange(Rect rect)
   at Avalonia.Controls.Presenters.ContentPresenter.ArrangeOverrideImpl(Size finalSize, Vector offset)
   at Avalonia.Controls.Presenters.ContentPresenter.ArrangeOverride(Size finalSize)
   at Avalonia.Layout.Layoutable.ArrangeCore(Rect finalRect)
   at Avalonia.Layout.Layoutable.Arrange(Rect rect)
   at Avalonia.Layout.Layoutable.ArrangeOverride(Size finalSize)
   at Avalonia.Layout.Layoutable.ArrangeCore(Rect finalRect)
   at Avalonia.Layout.Layoutable.Arrange(Rect rect)
   at Avalonia.Controls.Presenters.ContentPresenter.ArrangeOverrideImpl(Size finalSize, Vector offset)
   at Avalonia.Controls.Presenters.ContentPresenter.ArrangeOverride(Size finalSize)
   at Avalonia.Layout.Layoutable.ArrangeCore(Rect finalRect)
   at Avalonia.Layout.Layoutable.Arrange(Rect rect)
   at Avalonia.Layout.Layoutable.ArrangeOverride(Size finalSize)
   at Avalonia.Layout.Layoutable.ArrangeCore(Rect finalRect)
   at Avalonia.Layout.Layoutable.Arrange(Rect rect)
   at Avalonia.Controls.Presenters.ItemsPresenterBase.ArrangeOverride(Size finalSize)
   at Avalonia.Layout.Layoutable.ArrangeCore(Rect finalRect)
   at Avalonia.Layout.Layoutable.Arrange(Rect rect)
   at Avalonia.Controls.Border.ArrangeOverride(Size finalSize)
   at Avalonia.Layout.Layoutable.ArrangeCore(Rect finalRect)
   at Avalonia.Layout.Layoutable.Arrange(Rect rect)
   at Avalonia.Layout.Layoutable.ArrangeOverride(Size finalSize)
   at Avalonia.Layout.Layoutable.ArrangeCore(Rect finalRect)
   at Avalonia.Layout.Layoutable.Arrange(Rect rect)
   at Avalonia.Controls.DockPanel.ArrangeOverride(Size arrangeSize)
   at Avalonia.Layout.Layoutable.ArrangeCore(Rect finalRect)
   at Avalonia.Layout.Layoutable.Arrange(Rect rect)
   at Avalonia.Controls.Border.ArrangeOverride(Size finalSize)
   at Avalonia.Layout.Layoutable.ArrangeCore(Rect finalRect)
   at Avalonia.Layout.Layoutable.Arrange(Rect rect)
   at Avalonia.Layout.Layoutable.ArrangeOverride(Size finalSize)
   at Avalonia.Layout.Layoutable.ArrangeCore(Rect finalRect)
   at Avalonia.Layout.Layoutable.Arrange(Rect rect)
   at Avalonia.Controls.Presenters.ContentPresenter.ArrangeOverrideImpl(Size finalSize, Vector offset)
   at Avalonia.Controls.Presenters.ContentPresenter.ArrangeOverride(Size finalSize)
   at Avalonia.Layout.Layoutable.ArrangeCore(Rect finalRect)
   at Avalonia.Layout.Layoutable.Arrange(Rect rect)
   at Avalonia.Controls.Decorator.ArrangeOverride(Size finalSize)
   at Avalonia.Controls.Primitives.AdornerDecorator.ArrangeOverride(Size finalSize)
   at Avalonia.Layout.Layoutable.ArrangeCore(Rect finalRect)
   at Avalonia.Layout.Layoutable.Arrange(Rect rect)
   at Avalonia.Controls.Border.ArrangeOverride(Size finalSize)
   at Avalonia.Layout.Layoutable.ArrangeCore(Rect finalRect)
   at Avalonia.Layout.Layoutable.Arrange(Rect rect)
   at Avalonia.Layout.Layoutable.ArrangeOverride(Size finalSize)
   at Avalonia.Controls.WindowBase.ArrangeOverride(Size finalSize)
   at Avalonia.Layout.Layoutable.ArrangeCore(Rect finalRect)
   at Avalonia.Layout.Layoutable.Arrange(Rect rect)
   at Avalonia.Layout.LayoutManager.Arrange(ILayoutable control)
   at Avalonia.Layout.LayoutManager.Arrange(ILayoutable control)
   at Avalonia.Layout.LayoutManager.Arrange(ILayoutable control)
   at Avalonia.Layout.LayoutManager.Arrange(ILayoutable control)
   at Avalonia.Layout.LayoutManager.Arrange(ILayoutable control)
   at Avalonia.Layout.LayoutManager.Arrange(ILayoutable control)
   at Avalonia.Layout.LayoutManager.Arrange(ILayoutable control)
   at Avalonia.Layout.LayoutManager.Arrange(ILayoutable control)
   at Avalonia.Layout.LayoutManager.Arrange(ILayoutable control)
   at Avalonia.Layout.LayoutManager.Arrange(ILayoutable control)
   at Avalonia.Layout.LayoutManager.Arrange(ILayoutable control)
   at Avalonia.Layout.LayoutManager.ExecuteArrangePass()
   at Avalonia.Layout.LayoutManager.ExecuteLayoutPass()
   at Avalonia.Threading.JobRunner.RunJobs(Nullable`1 priority)
   at Avalonia.Win32.Win32Platform.WndProc(IntPtr hWnd, UInt32 msg, IntPtr wParam, IntPtr lParam)
   at Avalonia.Win32.Interop.UnmanagedMethods.DispatchMessage(MSG& lpmsg)
   at Avalonia.Win32.Win32Platform.RunLoop(CancellationToken cancellationToken)
   at Avalonia.Threading.Dispatcher.MainLoop(CancellationToken cancellationToken)
   at FAFClient.Program.Main(String[] args) in H:\Projects\FAFClient.Net\FAFClient\Program.cs:line 13
danwalmsley commented 5 years ago

You need to add a reference to packages: https://www.nuget.org/packages/VitalElement.CefGlue.Core.Win-x64/0.9.0-build20-alpha

someone also needs to update the build.cake script to generate a nuget with the native parts in for all platforms. I wont have time to do this myself.

build.cake actually shows you how to generate a package per platform.

tttrrryyyyeer commented 5 years ago

I run avalonia app in ubuntu 19.04 and catch

Unhandled Exception: System.NotSupportedException: cef_api_hash call is not supported. ---> System.DllNotFoundException: Unable to load shared library 'libcef' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: liblibcef: cannot open shared object file: No such file or directory
   at Xilium.CefGlue.Interop.libcef.api_hash(Int32 entry)
   at Xilium.CefGlue.CefRuntime.CheckVersionByApiHash()
   --- End of inner exception stack trace ---
   at Xilium.CefGlue.CefRuntime.CheckVersionByApiHash()
   at Xilium.CefGlue.CefRuntime.Load(String path)
   at Xilium.CefGlue.CefRuntime.ExecuteProcess(CefMainArgs args, CefApp application, IntPtr windowsSandboxInfo)
   at CefGlue.Avalonia.CefGlueApplicationExtensions.<>c__DisplayClass0_0`1.<ConfigureCefGlue>b__0(T b)
   at Avalonia.Controls.AppBuilderBase`1.Start(AppMainDelegate main, String[] args)

Runtime: .Net Core 2.2