title: Cannot load native library libLiteCore.dylib on M1
body: <p>I'm trying to build a JVM application (mostly Kotlin) on my M1 MacBook that uses CouchbaseLite.
  I have this in my build.gradle file:</p>
  <p><code>implementation &quot;com.couchbase.lite:couchbase-lite-java:3.0.0-beta02&quot;</code>
  (also tried it with a non-beta version 2.8.4)</p>
  <p>Gradle sync + build is fine but everytime I run the up and try to create a database</p>
  <p><code>db = Database(LOCAL_DB_NAME, config)</code>
  I get the following error:</p>
  <pre><code>java.lang.IllegalStateException: Cannot load native library libLiteCore.dylib @/Users/ale/Projects/server/CouchbaseLiteTemp/5e3b1711cace9de693b3e1e0bea0f2f8/libLiteCore.dylib for Mac OS X/aarch64
      at com.couchbase.lite.internal.NativeLibrary.load(NativeLibrary.java:113)
      at com.couchbase.lite.internal.CouchbaseLiteInternal.init(CouchbaseLiteInternal.java:80)
      at com.couchbase.lite.CouchbaseLite.init(CouchbaseLite.java:54)
      at com.couchbase.lite.CouchbaseLite.init(CouchbaseLite.java:42)
      at com.couchbase.lite.CouchbaseLite.init(CouchbaseLite.java:33)
      at de.ihaus.Main.Database.CouchbaseManager.initContext(CouchbaseManager.kt:34)
      at de.ihaus.Main.Dingo$main$1.invoke(Dingo.kt:15)
      at de.ihaus.Main.Dingo$main$1.invoke(Dingo.kt:14)
      at de.ihaus.Main.Login.LoginManager.onLoginSuccess(LoginManager.kt:64)
      at de.ihaus.Main.Login.LoginManager$LoginWorker.run(LoginManager.kt:53)
      at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
      at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
      at java.base/java.lang.Thread.run(Thread.java:829)
  Caused by: java.lang.UnsatisfiedLinkError: /Users/ale/Projects/server/CouchbaseLiteTemp/5e3b1711cace9de693b3e1e0bea0f2f8/libLiteCore.dylib: dlopen(/Users/ale/Projects/server/CouchbaseLiteTemp/5e3b1711cace9de693b3e1e0bea0f2f8/libLiteCore.dylib, 0x0001): tried: '/Users/ale/Projects/server/CouchbaseLiteTemp/5e3b1711cace9de693b3e1e0bea0f2f8/libLiteCore.dylib' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e')), '/usr/lib/libLiteCore.dylib' (no such file)
      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)
  </code></pre>
  <p>I've looked around but CouchbaseLite is supposed to work on an M1.
  What am I doing wrong?</p>