nokeedev / gradle-native

The home of anything about Gradle support for natively compiled languages
https://nokee.dev
Apache License 2.0
47 stars 8 forks source link

Apple M1 not support? #599

Open Kseoni4 opened 2 years ago

Kseoni4 commented 2 years ago

Hello, I worked in my MacBook Air M1, macOS Monterey 12.3 and try to build gradle project with JDK 17 aarch64, Nokee version '0.5.0-930919a0' and I was always get this:

java.lang.ExceptionInInitializerError (no error message)
> Unsupported architecture of name 'aarch64'

or with stacktrace:

FAILURE: Build failed with an exception.

* What went wrong:
Could not initialize class dev.nokee.runtime.nativebase.internal.DefaultMachineArchitecture

* Exception is:
java.lang.NoClassDefFoundError: Could not initialize class dev.nokee.runtime.nativebase.internal.DefaultMachineArchitecture
    at dev.nokee.platform.jni.internal.JniLibraryComponentInternal.<init>(JniLibraryComponentInternal.java:69)
    at dev.nokee.platform.jni.internal.plugins.JniLibraryPlugin.lambda$javaNativeInterfaceLibrary$47(JniLibraryPlugin.java:484)
    at dev.nokee.internal.Factories$ComposeFactory.create(Factories.java:104)
    at dev.nokee.internal.Factories$MemoizeFactory.create(Factories.java:76)
    at dev.nokee.internal.Factories$FactoryAsSupplier.get(Factories.java:127)
    at dev.nokee.model.internal.registry.SupplyingModelProjection.get(SupplyingModelProjection.java:26)
    at dev.nokee.model.internal.core.ModelNode$Projections.get(ModelNode.java:254)
    at dev.nokee.model.internal.core.ModelNode.lambda$get$0(ModelNode.java:176)
    at dev.nokee.model.internal.core.ModelNodeContext.execute(ModelNodeContext.java:27)
    at dev.nokee.model.internal.core.ModelNode.get(ModelNode.java:176)
    at dev.nokee.model.internal.core.ModelNode.get(ModelNode.java:165)
    at dev.nokee.platform.nativebase.internal.plugins.NativeComponentBasePlugin.lambda$configureUsingProjection$2(NativeComponentBasePlugin.java:46)
    at dev.nokee.model.internal.core.ModelActions$ExecuteUsingProjectionModelAction.execute(ModelActions.java:54)
    at dev.nokee.model.internal.core.ModelActions$MatchingModelAction.execute(ModelActions.java:158)
    at dev.nokee.model.internal.registry.DefaultModelRegistry$NodeStateListener.notify(DefaultModelRegistry.java:132)
    at dev.nokee.model.internal.registry.DefaultModelRegistry$NodeStateListener.realized(DefaultModelRegistry.java:126)
    at dev.nokee.model.internal.core.ModelNode.realize(ModelNode.java:99)
    at dev.nokee.model.internal.registry.ModelNodeBackedProvider.get(ModelNodeBackedProvider.java:38)
    at dev.nokee.platform.jni.internal.plugins.JniLibraryPlugin.registerExtension(JniLibraryPlugin.java:447)
    at dev.nokee.platform.jni.internal.plugins.JniLibraryPlugin.apply(JniLibraryPlugin.java:154)
    at dev.nokee.platform.jni.internal.plugins.JniLibraryPlugin.apply(JniLibraryPlugin.java:116)

Does nokee dev have support for M1? Or am I doing something wrong?

lacasseio commented 2 years ago

It should support M1, we have some users that builds for M1. You may need to use one of the latest nightly, e.g. 0.4.1571-202202231222.5a38a0dd. The NoClassDefFoundError seems to point to different Nokee versions used. Make sure you align the version using:

   resolutionStrategy {
      eachPlugin {
         if (requested.id.id.startsWith('dev.nokee.')) {
            useModule("${requested.id.id}:${requested.id.id}.gradle.plugin:${nokeeVersion}")
         }
      }
   }

If you can share your project, I can have a quick look to see what may be the issue.

s3r637 commented 1 year ago

Hey guys, I have the same issue.

@Kseoni4, could you fix this issue on your side? Do you have any advice? @lacasseio, is there a way to list the nightly builds? I can't figure out what the latest build is. In the meantime I found this https://services.nokee.dev/versions/all.json. It doesn't work with the latest build either.

I'm using the JNI library and C++ Language plugins. It works on other architectures (x86-64) and operating systems (Ubuntu/MacOS).

Cheers.

lacasseio commented 1 year ago

Do you have a specific mock-up project? I can look into adding a sample for that specific case.

s3r637 commented 1 year ago

Hi, thank you for your quick reply. Unfortunately I don't have a mock-up project. But it looks like our project doesn't support the M1 yet. Just a configuration issue on my end I assume.