question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Gradle on MAC with M1 chip using Kotlin Native still produces JNA issue

See original GitHub issue

Using the plugin in a Mac with M1 chip we found the same error than in issue 20355

Environment

openjdk version "11.0.15" 2022-04-19 LTS
OpenJDK Runtime Environment Zulu11.56+19-CA (build 11.0.15+10-LTS)
OpenJDK 64-Bit Server VM Zulu11.56+19-CA (build 11.0.15+10-LTS, mixed mode)

arm 64 MacOS 12.4 (21F79)

Dependencies Here is part of the ./gradle buildEnvironment command

classpath
+--- com.google.gms:google-services:4.3.3
|    +--- com.google.android.gms:strict-version-matcher-plugin:1.2.1
|    |    +--- com.google.code.findbugs:jsr305:3.0.2
|    |    +--- com.google.guava:guava:27.0.1-jre -> 30.0-jre
|    |    |    +--- com.google.guava:failureaccess:1.0.1
|    |    |    +--- com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava
|    |    |    +--- com.google.code.findbugs:jsr305:3.0.2
|    |    |    +--- org.checkerframework:checker-qual:3.5.0
|    |    |    +--- com.google.errorprone:error_prone_annotations:2.3.4
|    |    |    \--- com.google.j2objc:j2objc-annotations:1.3
|    |    \--- org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.3.11 -> 1.4.10
|    |         +--- org.jetbrains.kotlin:kotlin-stdlib:1.4.10 -> 1.4.32
|    |         |    +--- org.jetbrains.kotlin:kotlin-stdlib-common:1.4.32
|    |         |    \--- org.jetbrains:annotations:13.0
|    |         \--- org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.4.10
|    |              \--- org.jetbrains.kotlin:kotlin-stdlib:1.4.10 -> 1.4.32 (*)
|    +--- com.google.code.gson:gson:2.8.5
|    \--- com.google.guava:guava:27.0.1-jre -> 30.0-jre (*)
+--- com.github.bjoernq:unmockplugin:0.7.9
|    +--- org.javassist:javassist:3.27.0-GA
|    \--- com.android.tools.build:gradle:3.3.0 -> 3.4.1 (*)
\--- io.github.cdsap:talaiot:1.5.2
     +--- io.github.cdsap.talaiot:talaiot:1.5.2
     |    +--- com.github.oshi:oshi-core:5.5.0
     |    |    +--- net.java.dev.jna:jna:5.7.0
     |    |    +--- net.java.dev.jna:jna-platform:5.7.0
     |    |    |    \--- net.java.dev.jna:jna:5.7.0
     |    |    \--- org.slf4j:slf4j-api:1.7.30
     |    +--- com.gradle:gradle-enterprise-gradle-plugin:3.5.2
     |    |    \--- com.github.spotbugs:spotbugs-annotations:4.1.3
     |    |         \--- com.google.code.findbugs:jsr305:3.0.2
     |    +--- io.github.cdsap.talaiot:talaiot-logger:1.5.2
     |    |    \--- org.jetbrains.kotlin:kotlin-stdlib:1.4.32 (*)
     |    +--- io.github.cdsap.talaiot:talaiot-request:1.5.2
     |    |    +--- io.github.rybalkinsd:kohttp:0.10.0
     |    |    |    +--- com.squareup.okhttp3:okhttp:3.14.2 -> 4.9.0 (*)
     |    |    |    +--- org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.3.40 -> 1.4.10 (*)
     |    |    |    +--- org.jetbrains.kotlin:kotlin-reflect:1.3.40 -> 1.4.21 (*)
     |    |    |    +--- org.jetbrains.kotlinx:kotlinx-coroutines-core:1.2.1
     |    |    |    |    +--- org.jetbrains.kotlin:kotlin-stdlib:1.3.30 -> 1.4.32 (*)
     |    |    |    |    \--- org.jetbrains.kotlin:kotlin-stdlib-common:1.3.30 -> 1.4.32
     |    |    |    +--- com.fasterxml.jackson.core:jackson-databind:2.9.9 -> 2.12.6.1 (*)
     |    |    |    +--- com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.9.9 -> 2.12.6
     |    |    |    |    +--- com.fasterxml.jackson.core:jackson-databind:2.12.6 -> 2.12.6.1 (*)
     |    |    |    |    +--- org.yaml:snakeyaml:1.27
     |    |    |    |    +--- com.fasterxml.jackson.core:jackson-core:2.12.6 (*)
     |    |    |    |    \--- com.fasterxml.jackson:jackson-bom:2.12.6 (*)
     |    |    |    \--- com.fasterxml.jackson.module:jackson-module-kotlin:2.9.9 -> 2.12.6
     |    |    |         +--- com.fasterxml.jackson.core:jackson-databind:2.12.6 -> 2.12.6.1 (*)
     |    |    |         +--- com.fasterxml.jackson.core:jackson-annotations:2.12.6 (*)
     |    |    |         +--- org.jetbrains.kotlin:kotlin-reflect:1.4.21 (*)
     |    |    |         \--- com.fasterxml.jackson:jackson-bom:2.12.6 (*)
     |    |    +--- io.github.cdsap.talaiot:talaiot-logger:1.5.2 (*)
     |    |    \--- org.jetbrains.kotlin:kotlin-stdlib:1.4.32 (*)
     |    \--- org.jetbrains.kotlin:kotlin-stdlib:1.4.32 (*)
     +--- io.github.cdsap.talaiot:base-publisher:1.5.2
     |    +--- com.google.code.gson:gson:2.8.5
     |    +--- io.github.cdsap.talaiot:talaiot:1.5.2 (*)
     |    \--- org.jetbrains.kotlin:kotlin-stdlib:1.4.32 (*)
     +--- io.github.cdsap.talaiot:elastic-search-publisher:1.5.2
     |    +--- io.github.cdsap.talaiot:talaiot:1.5.2 (*)
     |    +--- org.elasticsearch.client:elasticsearch-rest-high-level-client:7.3.0
     |    |    +--- org.elasticsearch:elasticsearch:7.3.0
     |    |    |    +--- org.elasticsearch:elasticsearch-core:7.3.0
     |    |    |    +--- org.elasticsearch:elasticsearch-secure-sm:7.3.0
     |    |    |    +--- org.elasticsearch:elasticsearch-x-content:7.3.0
     |    |    |    |    +--- org.elasticsearch:elasticsearch-core:7.3.0
     |    |    |    |    +--- org.yaml:snakeyaml:1.17 -> 1.27
     |    |    |    |    +--- com.fasterxml.jackson.core:jackson-core:2.8.11 -> 2.12.6 (*)
     |    |    |    |    +--- com.fasterxml.jackson.dataformat:jackson-dataformat-smile:2.8.11 -> 2.12.6
     |    |    |    |    |    +--- com.fasterxml.jackson.core:jackson-databind:2.12.6 -> 2.12.6.1 (*)
     |    |    |    |    |    \--- com.fasterxml.jackson:jackson-bom:2.12.6 (*)
     |    |    |    |    +--- com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.8.11 -> 2.12.6 (*)
     |    |    |    |    \--- com.fasterxml.jackson.dataformat:jackson-dataformat-cbor:2.8.11 -> 2.12.6 (*)
     |    |    |    +--- org.elasticsearch:elasticsearch-geo:7.3.0
     |    |    |    +--- org.apache.lucene:lucene-core:8.1.0
     |    |    |    +--- org.apache.lucene:lucene-analyzers-common:8.1.0
     |    |    |    +--- org.apache.lucene:lucene-backward-codecs:8.1.0
     |    |    |    +--- org.apache.lucene:lucene-grouping:8.1.0
     |    |    |    +--- org.apache.lucene:lucene-highlighter:8.1.0
     |    |    |    +--- org.apache.lucene:lucene-join:8.1.0
     |    |    |    +--- org.apache.lucene:lucene-memory:8.1.0
     |    |    |    +--- org.apache.lucene:lucene-misc:8.1.0
     |    |    |    +--- org.apache.lucene:lucene-queries:8.1.0
     |    |    |    +--- org.apache.lucene:lucene-queryparser:8.1.0
     |    |    |    +--- org.apache.lucene:lucene-sandbox:8.1.0
     |    |    |    +--- org.apache.lucene:lucene-spatial:8.1.0
     |    |    |    +--- org.apache.lucene:lucene-spatial-extras:8.1.0
     |    |    |    +--- org.apache.lucene:lucene-spatial3d:8.1.0
     |    |    |    +--- org.apache.lucene:lucene-suggest:8.1.0
     |    |    |    +--- org.elasticsearch:elasticsearch-cli:7.3.0
     |    |    |    |    +--- net.sf.jopt-simple:jopt-simple:5.0.2
     |    |    |    |    \--- org.elasticsearch:elasticsearch-core:7.3.0
     |    |    |    +--- com.carrotsearch:hppc:0.8.1
     |    |    |    +--- joda-time:joda-time:2.10.2
     |    |    |    +--- com.tdunning:t-digest:3.2
     |    |    |    +--- org.hdrhistogram:HdrHistogram:2.1.9
     |    |    |    +--- org.apache.logging.log4j:log4j-api:2.11.1
     |    |    |    \--- org.elasticsearch:jna:4.5.1
     |    |    +--- org.elasticsearch.client:elasticsearch-rest-client:7.3.0
     |    |    |    +--- org.apache.httpcomponents:httpclient:4.5.8 -> 4.5.13 (*)
     |    |    |    +--- org.apache.httpcomponents:httpcore:4.4.11 -> 4.4.13
     |    |    |    +--- org.apache.httpcomponents:httpasyncclient:4.1.4
     |    |    |    +--- org.apache.httpcomponents:httpcore-nio:4.4.11
     |    |    |    +--- commons-codec:commons-codec:1.11 -> 1.13
     |    |    |    \--- commons-logging:commons-logging:1.1.3 -> 1.2
     |    |    +--- org.elasticsearch.plugin:parent-join-client:7.3.0
     |    |    +--- org.elasticsearch.plugin:aggs-matrix-stats-client:7.3.0
     |    |    +--- org.elasticsearch.plugin:rank-eval-client:7.3.0
     |    |    \--- org.elasticsearch.plugin:lang-mustache-client:7.3.0
     |    |         \--- com.github.spullara.mustache.java:compiler:0.9.3
     |    +--- com.google.code.gson:gson:2.8.5
     |    \--- org.jetbrains.kotlin:kotlin-stdlib:1.4.32 (*)
     +--- io.github.cdsap.talaiot:graph-publisher:1.5.2
     |    +--- io.github.cdsap.talaiot:talaiot:1.5.2 (*)
     |    \--- guru.nidi:graphviz-java:0.8.3
     |         +--- org.webjars.npm:viz.js:2.1.2
     |         +--- org.apache.xmlgraphics:xmlgraphics-commons:2.3
     |         |    \--- commons-io:commons-io:1.3.1 -> 2.8.0
     |         +--- commons-io:commons-io:2.6 -> 2.8.0
     |         +--- guru.nidi.com.kitfox:svgSalamander:1.1.2
     |         +--- net.arnx:nashorn-promise:0.1.1
     |         +--- com.eclipsesource.j2v8:j2v8_macosx_x86_64:4.6.0
     |         +--- com.eclipsesource.j2v8:j2v8_linux_x86_64:4.6.0
     |         +--- com.eclipsesource.j2v8:j2v8_win32_x86_64:4.6.0
     |         +--- com.eclipsesource.j2v8:j2v8_win32_x86:4.6.0
     |         +--- org.apache.commons:commons-exec:1.3
     |         +--- com.google.code.findbugs:jsr305:3.0.2
     |         +--- org.slf4j:jcl-over-slf4j:1.7.25
     |         |    \--- org.slf4j:slf4j-api:1.7.25 -> 1.7.30
     |         +--- org.slf4j:jul-to-slf4j:1.7.25
     |         |    \--- org.slf4j:slf4j-api:1.7.25 -> 1.7.30
     |         \--- org.slf4j:slf4j-api:1.7.25 -> 1.7.30
     +--- io.github.cdsap.talaiot:hybrid-publisher:1.5.2
     |    +--- io.github.cdsap.talaiot:talaiot:1.5.2 (*)
     |    +--- io.github.cdsap.talaiot:base-publisher:1.5.2 (*)
     |    +--- io.github.cdsap.talaiot:elastic-search-publisher:1.5.2 (*)
     |    +--- io.github.cdsap.talaiot:influxdb-publisher:1.5.2
     |    |    +--- io.github.cdsap.talaiot:talaiot:1.5.2 (*)
     |    |    +--- io.github.cdsap.talaiot:influxdb-common:1.5.2
     |    |    |    +--- io.github.cdsap.talaiot:talaiot:1.5.2 (*)
     |    |    |    \--- org.jetbrains.kotlin:kotlin-stdlib:1.4.32 (*)
     |    |    +--- org.influxdb:influxdb-java:2.21
     |    |    |    +--- com.squareup.retrofit2:retrofit:2.9.0
     |    |    |    |    \--- com.squareup.okhttp3:okhttp:3.14.9 -> 4.9.0 (*)
     |    |    |    +--- com.squareup.retrofit2:converter-moshi:2.9.0
     |    |    |    |    +--- com.squareup.retrofit2:retrofit:2.9.0 (*)
     |    |    |    |    \--- com.squareup.moshi:moshi:1.8.0
     |    |    |    +--- org.msgpack:msgpack-core:0.8.21
     |    |    |    +--- com.squareup.okhttp3:okhttp:4.9.0 (*)
     |    |    |    \--- com.squareup.okhttp3:logging-interceptor:4.9.0
     |    |    |         +--- com.squareup.okhttp3:okhttp:4.9.0 (*)
     |    |    |         \--- org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.4.10 (*)
     |    |    \--- org.jetbrains.kotlin:kotlin-stdlib:1.4.32 (*)
     |    +--- io.github.cdsap.talaiot:pushgateway-publisher:1.5.2
     |    |    +--- io.github.cdsap.talaiot:talaiot:1.5.2 (*)
     |    |    +--- io.prometheus:simpleclient_pushgateway:0.15.0
     |    |    |    +--- io.prometheus:simpleclient:0.15.0
     |    |    |    |    +--- io.prometheus:simpleclient_tracer_otel:0.15.0
     |    |    |    |    |    \--- io.prometheus:simpleclient_tracer_common:0.15.0
     |    |    |    |    \--- io.prometheus:simpleclient_tracer_otel_agent:0.15.0
     |    |    |    |         \--- io.prometheus:simpleclient_tracer_common:0.15.0
     |    |    |    \--- io.prometheus:simpleclient_common:0.15.0
     |    |    |         \--- io.prometheus:simpleclient:0.15.0 (*)
     |    |    \--- org.jetbrains.kotlin:kotlin-stdlib:1.4.32 (*)
     |    +--- io.github.cdsap.talaiot:rethinkdb-publisher:1.5.2
     |    |    +--- io.github.cdsap.talaiot:talaiot:1.5.2 (*)
     |    |    +--- com.rethinkdb:rethinkdb-driver:2.3.3
     |    |    |    +--- org.slf4j:slf4j-api:1.7.12 -> 1.7.30
     |    |    |    \--- com.googlecode.json-simple:json-simple:1.1.1 (*)
     |    |    \--- org.jetbrains.kotlin:kotlin-stdlib:1.4.32 (*)
     |    \--- org.jetbrains.kotlin:kotlin-stdlib:1.4.32 (*)
     +--- io.github.cdsap.talaiot:influxdb-publisher:1.5.2 (*)
     +--- io.github.cdsap.talaiot:pushgateway-publisher:1.5.2 (*)
     +--- io.github.cdsap.talaiot:rethinkdb-publisher:1.5.2 (*)
     +--- com.github.oshi:oshi-core:5.5.0 (*)
     +--- com.google.code.gson:gson:2.8.5
     +--- org.elasticsearch.client:elasticsearch-rest-high-level-client:7.3.0 (*)
     \--- com.rethinkdb:rethinkdb-driver:2.3.3 (*)

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:14 (7 by maintainers)

github_iconTop GitHub Comments

3reactions
cdsapcommented, May 31, 2022

hi @vfongmala-safetyculture @crothert thanks for the report and the example repo. Definitely, there is something wrong there. I was surprised because we are working with M1 Max and I’m not seeing this issue. Thanks to the repo provided by @crothert I was able to reproduce it. One thing it call my attention was the configuration of the plugin in the example repo. I see you’re not using the Talaliot Plugin from the Gradle Plugin Portal. After changing it with the same configuration it works. The git diff is: app/build.gradle

-buildscript {
-    repositories {
-        google()
-        mavenLocal()
-        mavenCentral()
-    }
-    dependencies {
-        classpath "io.github.cdsap:talaiot:1.5.2"
-    }
-}
-

build.gradle:

     id 'com.android.application' version '7.1.2' apply false
     id 'com.android.library' version '7.1.2' apply false
     id 'org.jetbrains.kotlin.android' version '1.6.21' apply false
+    id 'io.github.cdsap.talaiot' version '1.5.2' apply false
 }

Can you test it by defining the plugin in the main build.gradle file and removing the buildScript block from app/build.gradle?
The output of the json after changing the configuration includes the custom metrics:

...
  "osManufacturer": "Apple"
},
"customProperties": {
  "buildProperties": {
    "cpuDetails": "Apple M1 Max",
    "cpuArchitecture": "aarch64",
    "totalSystemMemory": "68719476736"
  },
  "taskProperties": {}
},
...

From my side I will investigate the invocation difference and updating the oshi dependency version. Thanks again

1reaction
cdsapcommented, Jun 7, 2022

thanks @nehgutierrez, closing the issue and will investigate the issue invoking the plugin from the buildscript block

Read more comments on GitHub >

github_iconTop Results From Across the Web

JNA: Gradle on latest MAC M1 with Kotlin Native causes a ...
Docker-java already faced some issues with older versions of JNA on MAC M1 PRO that were fixed in 5.11.0. Gradle also uses the...
Read more >
Support running Kotlin/Native compiler on macOS/arm64 ...
Important: this issue covers only running Kotlin/Native compiler itself on macOS/arm64. For compiling binaries that run on macOS/arm64, see https://youtrack.
Read more >
How can I solve this issue on Mac M1 Caused by: java.lang ...
Navigate to Gradle Project section and click Gradle JDK dropdown option field. Select Liberica-1.8 (if it is not available in dropdown field, ...
Read more >
Java Development on an Apple M1 (ARM64) - rieckpil
The underlying issue is a JNA (Java Native Access) dependency incompatibility with Apple's M1 chip. Testcontainers transitively depends on ...
Read more >
Lint does not work with Apple silicon on 7.0.0 builds ...
yeah, when lint initializes the Kotlin compilation environment to build an AST the Kotlin compiler environment uses intellij-core, which uses JNA. We need...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found