Im trying to start a project on play in IntelliJ IDEA Ultimate MacBook Pro on M1, I get the following error in the console:
[error] java.lang.UnsatisfiedLinkError: /Users/username/Library/Caches/JNA/temp/jna2878211531869408345.tmp: dlopen(/Users/username/Library/Caches/JNA/temp/jna2878211531869408345.tmp, 0x0001): tried: '/Users/username/Library/Caches/JNA/temp/jna2878211531869408345.tmp' (fat file, but missing compatible architecture (have 'i386,x86_64', need 'arm64e')), '/usr/lib/jna2878211531869408345.tmp' (no such file)
I tried to reinstall the JDK on the arm architecture after deleting all the JDKs, it did not help
What needs to be tricked to fix this?
Full StackTrace:
[error] java.lang.UnsatisfiedLinkError: /Users/romangoltsov/Library/Caches/JNA/temp/jna2878211531869408345.tmp: dlopen(/Users/romangoltsov/Library/Caches/JNA/temp/jna2878211531869408345.tmp, 0x0001): tried: '/Users/romangoltsov/Library/Caches/JNA/temp/jna2878211531869408345.tmp' (fat file, but missing compatible architecture (have 'i386,x86_64', need 'arm64e')), '/usr/lib/jna2878211531869408345.tmp' (no such file)
[error] at java.base/java.lang.ClassLoader$NativeLibrary.load0(Native Method)
[error] at java.base/java.lang.ClassLoader$NativeLibrary.load(ClassLoader.java:2442)
[error] at java.base/java.lang.ClassLoader$NativeLibrary.loadLibrary(ClassLoader.java:2498)
[error] at java.base/java.lang.ClassLoader.loadLibrary0(ClassLoader.java:2694)
[error] at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2627)
[error] at java.base/java.lang.Runtime.load0(Runtime.java:768)
[error] at java.base/java.lang.System.load(System.java:1837)
[error] at com.sun.jna.Native.loadNativeDispatchLibraryFromClasspath(Native.java:1018)
[error] at com.sun.jna.Native.loadNativeDispatchLibrary(Native.java:988)
[error] at com.sun.jna.Native.<clinit>(Native.java:195)
[error] at io.methvin.watchservice.jna.CarbonAPI.<clinit>(CarbonAPI.java:19)
[error] at io.methvin.watchservice.jna.CFStringRef.toCFString(CFStringRef.java:23)
[error] at io.methvin.watchservice.MacOSXListeningWatchService.register(MacOSXListeningWatchService.java:101)
[error] at io.methvin.watchservice.WatchablePath.register(WatchablePath.java:50)
[error] at io.methvin.watcher.DirectoryWatcher.register(DirectoryWatcher.java:352)
[error] at io.methvin.watcher.DirectoryWatcher.registerAll(DirectoryWatcher.java:317)
[error] at io.methvin.watcher.DirectoryWatcher.<init>(DirectoryWatcher.java:167)
[error] at io.methvin.watcher.DirectoryWatcher$Builder.build(DirectoryWatcher.java:118)
[error] at play.dev.filewatch.DefaultFileWatchService.watch(DefaultFileWatchService.scala:38)
[error] at play.dev.filewatch.FileWatchService$$anon$1.watch(FileWatchService.scala:87)
[error] at play.runsupport.Reloader.<init>(Reloader.scala:414)
[error] at play.runsupport.Reloader$.reloader$lzycompute$1(Reloader.scala:259)
[error] at play.runsupport.Reloader$.play$runsupport$Reloader$$reloader$1(Reloader.scala:251)
[error] at play.runsupport.Reloader$.startDevMode(Reloader.scala:271)
[error] at play.sbt.run.PlayRun$.devModeServer$lzycompute$1(PlayRun.scala:99)
[error] at play.sbt.run.PlayRun$.devModeServer$1(PlayRun.scala:83)
[error] at play.sbt.run.PlayRun$.$anonfun$playRunTask$3(PlayRun.scala:106)
[error] at play.sbt.run.PlayRun$.$anonfun$playRunTask$3$adapted(PlayRun.scala:68)
[error] at scala.Function1.$anonfun$compose$1(Function1.scala:49)
[error] stack trace is suppressed; run 'last Compile / run' for the full output
[error] (Compile / run) java.lang.UnsatisfiedLinkError: /Users/romangoltsov/Library/Caches/JNA/temp/jna2878211531869408345.tmp: dlopen(/Users/romangoltsov/Library/Caches/JNA/temp/jna2878211531869408345.tmp, 0x0001): tried: '/Users/romangoltsov/Library/Caches/JNA/temp/jna2878211531869408345.tmp' (fat file, but missing compatible architecture (have 'i386,x86_64', need 'arm64e')), '/usr/lib/jna2878211531869408345.tmp' (no such file)
CodePudding user response:
Found a solution: Inside sbt 1.4.6 there is a JNA library version 5.5.0, which apparently does not have the necessary files for the arm64 architecture processor Raising the sbt version to 1.6.2 helped
CodePudding user response:
Usually when I get an error in intellij that deals with caches, my first step is to invalidate and reload. Please try the following and see if it fixes your issue.
File -> Invalidate Caches -> Invalidate and Restart
(Make sure you have the top 3 options selected as in the second screenshot)