sczerwinski / wavefront-obj-intellij-plugin

IntelliJ platform plugin for Wavefront OBJ format
https://plugins.jetbrains.com/plugin/14843-wavefront-obj
Apache License 2.0
13 stars 1 forks source link

[Apple M1] Unable to load 3D preview: Could not initialize class com.jogamp.opengl.GLProfile #365

Closed oneframemobile closed 1 year ago

oneframemobile commented 1 year ago

Steps

  1. [STEPS NECESSARY TO REPRODUCE THE BUG]

Android Studio Dolphin | 2021.3.1 Patch 1 MacOs : Monterey , M1

Any WaveFront releases, 1.0.0 , 1.0.1, 1.1.0, 1.1.1, 1.1.2, 1.2.0

When we open the object file, we get a preview error.

Unable to load 3D preview: Could not initialize class com.jogamp.opengl.GLProfile java.lang.NoClassDefFoundError: Could not initialize class com.jogamp.opengl.GLProfile at graphics.glimpse.ui.GLCapabilitiesFactory.findGLProfile(GLCapabilitiesFactory.kt:59) at graphics.glimpse.ui.GLCapabilitiesFactory.create(GLCapabilitiesFactory.kt:46) at graphics.glimpse.ui.GlimpsePanel.(GlimpsePanel.kt:31) at graphics.glimpse.ui.GlimpsePanel.(GlimpsePanel.kt:31) at it.czerwinski.intellij.wavefront.editor.ObjPreviewComponent.createGlimpsePanel(ObjPreviewComponent.kt:272) at it.czerwinski.intellij.wavefront.editor.ObjPreviewComponent.initialize(ObjPreviewComponent.kt:236) at it.czerwinski.intellij.wavefront.editor.ObjPreviewEditor.initPreview(ObjPreviewEditor.kt:149) at it.czerwinski.intellij.wavefront.editor.ObjSplitEditor.initializeEditorsVisibilityListener$lambda-0(ObjSplitEditor.kt:62) at it.czerwinski.intellij.common.editor.SplitEditorComponent.notifyEditorsVisibilityChanged(SplitEditorComponent.kt:133) at it.czerwinski.intellij.common.editor.SplitEditorComponent.setShowingPreviewEditor(SplitEditorComponent.kt:68) at it.czerwinski.intellij.common.editor.SplitEditor.setLayout(SplitEditor.kt:48) at it.czerwinski.intellij.common.actions.SplitLayoutAction.actionPerformed(SplitLayoutAction.kt:48) at com.intellij.openapi.actionSystem.impl.ActionButton.actionPerformed(ActionButton.java:178) at com.intellij.openapi.actionSystem.impl.ActionButton.lambda$performAction$0(ActionButton.java:154) at com.intellij.openapi.actionSystem.ex.ActionUtil.performDumbAwareWithCallbacks(ActionUtil.java:260) at com.intellij.openapi.actionSystem.impl.ActionButton.performAction(ActionButton.java:154) at com.intellij.openapi.actionSystem.impl.ActionButton.processMouseEvent(ActionButton.java:449) at java.desktop/java.awt.Component.processEvent(Component.java:6419) at java.desktop/java.awt.Container.processEvent(Container.java:2263) at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:5029) at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2321) at java.desktop/java.awt.Component.dispatchEvent(Component.java:4861) at java.desktop/java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4918) at java.desktop/java.awt.LightweightDispatcher.processMouseEvent(Container.java:4547) at java.desktop/java.awt.LightweightDispatcher.dispatchEvent(Container.java:4488) at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2307) at java.desktop/java.awt.Window.dispatchEventImpl(Window.java:2790) at java.desktop/java.awt.Component.dispatchEvent(Component.java:4861) at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:778) at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:727) at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721) at java.base/java.security.AccessController.doPrivileged(Native Method) at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85) at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:95) at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:751) at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:749) at java.base/java.security.AccessController.doPrivileged(Native Method) at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85) at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:748) at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:891) at com.intellij.ide.IdeEventQueue.dispatchMouseEvent(IdeEventQueue.java:820) at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:757) at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$6(IdeEventQueue.java:447) at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:818) at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$7(IdeEventQueue.java:446) at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:805) at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:498) at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203) at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124) at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113) at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109) at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101) at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)

[COPY FROM "IDE FATAL ERRORS"]

sczerwinski commented 1 year ago

Hi @oneframemobile,

Thank you for your bug report.

Issue testing outcome

I checked if I can reproduce the issue on macOS Ventura 13.0.1, with:

Android Studio Dolphin | 2021.3.1 Patch 1
Build #AI-213.7172.25.2113.9123335, built on September 30, 2022
Runtime version: 11.0.13+0-b1751.21-8125866 x86_64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.

I found no issues with the plugin. I cannot recall any past issues with Monterey either.

What is happening

Based on the stack trace, the plugin cannot find class com.jogamp.opengl.GLProfile, which comes from Jogamp, bundled with the plugin itself, and can be downloaded here.

Does the problem occur on one or more machines? I'm wondering if there might be some issue with those jars in your installation of Android Studio – possibly some corrupted files in the AS directories.

Possible fixes

I would like to recommend the following steps for you to follow:

  1. Completely uninstall and then reinstall the plugin (not update, not install over current version, not disable/enable), unless you have already done that.
  2. Completely uninstall and then reinstall Android Studio (if that's not too much hustle for you).
  3. Update macOS to Ventura, unless you have some other reasons not to.
oneframemobile commented 1 year ago

Hi @sczerwinski ,

Thank you for responding.

I tried some of what you said

I have uninstalled and installed different plugin versions many times. I updated android studio after getting preview error and current version is Build #AI-213.7172.25.2113.9123335, built on September 30, 2022.

Finally,

I updated to Venture(13.0.1). but the error persists. I am using M1 processor, could the error be related to that?

java.lang.UnsatisfiedLinkError: /private/var/folders/5k/yssdd0m172s76rtjp_qp5wk00000gp/T/jogamp_0000/file_cache/jln10466923416752589739/jln12634887007143213064/natives/macosx-universal/libgluegen_rt.dylib: dlopen(/private/var/folders/5k/yssdd0m172s76rtjp_qp5wk00000gp/T/jogamp_0000/file_cache/jln10466923416752589739/jln12634887007143213064/natives/macosx-universal/libgluegen_rt.dylib, 0x0001): tried: '/private/var/folders/5k/yssdd0m172s76rtjp_qp5wk00000gp/T/jogamp_0000/file_cache/jln10466923416752589739/jln12634887007143213064/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/5k/yssdd0m172s76rtjp_qp5wk00000gp/T/jogamp_0000/file_cache/jln10466923416752589739/jln12634887007143213064/natives/macosx-universal/libgluegen_rt.dylib' (no such file), '/private/var/folders/5k/yssdd0m172s76rtjp_qp5wk00000gp/T/jogamp_0000/file_cache/jln10466923416752589739/jln12634887007143213064/natives/macosx-universal/libgluegen_rt. at java.base/java.lang.ClassLoader$NativeLibrary.load0(Native Method) at java.base/java.lang.ClassLoader$NativeLibrary.load(ClassLoader.java:2442) at java.base/java.lang.ClassLoader$NativeLibrary.loadLibrary(ClassLoader.java:2498) at java.base/java.lang.ClassLoader.loadLibrary0(ClassLoader.java:2694) at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2627) at java.base/java.lang.Runtime.load0(Runtime.java:768) at java.base/java.lang.System.load(System.java:1837) 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(Native Method) at com.jogamp.common.os.Platform.(Platform.java:290) at com.jogamp.opengl.GLProfile.(GLProfile.java:154) at graphics.glimpse.ui.GLCapabilitiesFactory.findGLProfile(GLCapabilitiesFactory.kt:59) at graphics.glimpse.ui.GLCapabilitiesFactory.create(GLCapabilitiesFactory.kt:46) at graphics.glimpse.ui.GlimpsePanel.(GlimpsePanel.kt:31) at graphics.glimpse.ui.GlimpsePanel.(GlimpsePanel.kt:31) at it.czerwinski.intellij.wavefront.editor.ObjPreviewComponent.createGlimpsePanel(ObjPreviewComponent.kt:253) at it.czerwinski.intellij.wavefront.editor.ObjPreviewComponent.initialize(ObjPreviewComponent.kt:217) at it.czerwinski.intellij.wavefront.editor.ObjPreviewEditor.initPreview(ObjPreviewEditor.kt:149) at it.czerwinski.intellij.wavefront.editor.ObjSplitEditor.initializeEditorsVisibilityListener$lambda-0(ObjSplitEditor.kt:62) a

sczerwinski commented 1 year ago

I'm afraid, you might be right, @oneframemobile. I could only test it on Intel processor.

I've found some libraries that someone claims should work for both x86_64 and arm64. I'll investigate the possibility of including those in the plugin and come back with the news.

sczerwinski commented 1 year ago

@oneframemobile,

So far, I haven't been successful with this. I'm afraid, we might need to wait for JOGL 2.4 to be released, or for a new build on Chuck. Unfortunately, they don't seem to be in a hurry.

sczerwinski commented 1 year ago

Hi @oneframemobile,

I have released plugin version 1.3.0-eap.2, with JOGL build 2.4.0-rc-20230123. The plugin is available here.

Unfortunately, with other changes that I've made to this version of the plugin, it now requires Android Studio Flamingo | 2022.2.1 Beta.

According to Sven Gothel, who leads JogAmp team, this version should work with M1 processors. More information can be found here:

Could you let me know if the new version works for you, please? If everything works as expected, I will close this issue.

jesse-savary commented 1 year ago

Resolves the issue for me on my M1 Mac Mini @sczerwinski, thank you 👍

sczerwinski commented 1 year ago

Thanks @jesse-savary.

Closing the issue. JogAmp v2.4.0 will be included in plugin v1.3.0.