jcefmaven / jcefmaven

Maven artifacts for JCef

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[BUG] macOS ARM Not Working

zerofancy opened this issue · comments

Describe the bug

Running on MacBook Pro M2, I got an JNI error.

Exception in thread "DefaultDispatcher-worker-1" java.lang.UnsatisfiedLinkError: /private/var/folders/4j/q_6scbxn7vz8dxy71xk_5_tw0000gn/T/jogamp_0000/file_cache/jln6161893602499398686/jln7888684641616373995/natives/macosx-universal/libgluegen_rt.dylib: dlopen(/private/var/folders/4j/q_6scbxn7vz8dxy71xk_5_tw0000gn/T/jogamp_0000/file_cache/jln6161893602499398686/jln7888684641616373995/natives/macosx-universal/libgluegen_rt.dylib, 0x0001): tried: '/private/var/folders/4j/q_6scbxn7vz8dxy71xk_5_tw0000gn/T/jogamp_0000/file_cache/jln6161893602499398686/jln7888684641616373995/natives/macosx-universal/libgluegen_rt.dylib' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64')), '/System/Volumes/Preboot/Cryptexes/OS/private/var/folders/4j/q_6scbxn7vz8dxy71xk_5_tw0000gn/T/jogamp_0000/file_cache/jln6161893602499398686/jln7888684641616373995/natives/macosx-universal/libgluegen_rt.dylib' (no such file), '/private/var/folders/4j/q_6scbxn7vz8dxy71xk_5_tw0000gn/T/jogamp_0000/file_cache/jln6161893602499398686/jln7888684641616373995/natives/macosx-universal/libgluegen_rt.dylib' (ma
at java.base/jdk.internal.loader.NativeLibraries.load(Native Method)
at java.base/jdk.internal.loader.NativeLibraries$NativeLibraryImpl.open(NativeLibraries.java:331)
at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:197)
at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:139)
at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2418)
at java.base/java.lang.Runtime.load0(Runtime.java:852)
at java.base/java.lang.System.load(System.java:2025)
at com.jogamp.common.jvm.JNILibLoaderBase.loadLibraryInternal(JNILibLoaderBase.java:604)
at com.jogamp.common.jvm.JNILibLoaderBase.access$000(JNILibLoaderBase.java:64)
at com.jogamp.common.jvm.JNILibLoaderBase$DefaultAction.loadLibrary(JNILibLoaderBase.java:107)
at com.jogamp.common.jvm.JNILibLoaderBase.loadLibrary(JNILibLoaderBase.java:488)
at com.jogamp.common.os.DynamicLibraryBundle$GlueJNILibLoader.loadLibrary(DynamicLibraryBundle.java:427)
at com.jogamp.common.os.Platform$1.run(Platform.java:321)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:319)
at com.jogamp.common.os.Platform.(Platform.java:290)
at com.jogamp.opengl.GLProfile.(GLProfile.java:154)
at org.cef.browser.CefBrowserOsr.createGLCanvas(CefBrowserOsr.java:138)
at org.cef.browser.CefBrowserOsr.(CefBrowserOsr.java:96)
at org.cef.browser.CefBrowserOsr.(CefBrowserOsr.java:88)
at org.cef.browser.CefBrowserFactory.create(CefBrowserFactory.java:15)
at org.cef.CefClient.createBrowser(CefClient.java:144)
at org.cef.CefClient.createBrowser(CefClient.java:137)
at com.example.project.EngineMainKt$launchBrowserFrame$1.invokeSuspend(EngineMain.kt:72)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:108)
at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:589)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:806)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:710)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:697)
Suppressed: kotlinx.coroutines.internal.DiagnosticCoroutineContextException: [StandaloneCoroutine{Cancelling}@2510ecec, Dispatchers.Default]

To Reproduce

Expected behavior
Show sample page.

Environment (please complete the following information):

  • OS: macosx
  • Architecture: arm64
  • Version 37f25dc+cef-116.0.19+gc6a20bc+chromium-116.0.5845.141

Additional context
I found that there are no native library for macos-arm.

image

Source code

//Create a new CefAppBuilder instance
CefAppBuilder builder = new CefAppBuilder();

//Configure the builder instance
builder.setInstallDir(new File("jcef-bundle")); //Default
builder.setProgressHandler(new ConsoleProgressHandler()); //Default
builder.addJcefArgs("--disable-gpu"); //Just an example
builder.getCefSettings().windowless_rendering_enabled = true; //Default - select OSR mode

//Set an app handler. Do not use CefApp.addAppHandler(...), it will break your code on MacOSX!
builder.setAppHandler(new MavenCefAppHandlerAdapter(){...});

//Build a CefApp instance using the configuration above
CefApp app = builder.build();

This will most likely not work then and only support on-screen-rendering. Have you tried setting windowless rendering to false and potentially remove the --disable-gpu flag? I know this does not cover all use cases, but I can not provide any jogamp libraries for M2 currently. I should definitely indicate that on the start page so I'll leave this issue open.

This will most likely not work then and only support on-screen-rendering. Have you tried setting windowless rendering to false and potentially remove the --disable-gpu flag? I know this does not cover all use cases, but I can not provide any jogamp libraries for M2 currently. I should definitely indicate that on the start page so I'll leave this issue open.

It works now with "isOffscreenRendered = false", thank you.

Nice, I will close this issue then :)