Minimal plugin test failing with "JNA library not available"


I am trying to create a plugin test that uses creates a IdeaProjectTestFixture using IdeaTestFixtureFactory, but trying to call fixture.setUp() from my test’s setUp() triggers java.lang.AssertionError: JNA library. The plugin targets IDEA 203.7717.56, and I’m trying to run the tests on Apple Silicon (M1 Pro).

Here is the entire test file:

package com.example.somepackage

import com.intellij.testFramework.fixtures.IdeaTestFixtureFactory
import org.junit.After
import org.junit.Assert.assertEquals
import org.junit.Before
import org.junit.Test
import org.junit.runner.RunWith
import org.junit.runners.JUnit4

class TempFileTest {
private val fixtureFactory = IdeaTestFixtureFactory.getFixtureFactory()
private val fixtureBuilder = fixtureFactory.createFixtureBuilder("MyProject")
private val fixture = fixtureBuilder.fixture

fun setUp() {

fun tearDown() {

fun nothing() {
assertEquals(4, 2 + 2)

Since the stack trace is very large, I’ve uploaded it to:

Upload id: 2022_11_06_mvtrN3SDiCrwcTquRMCDuu (file: jna_stack_trace_2.txt)

Please let me know if you need any more information. Thanks!

评论操作 固定链接

Please try building against 

Version: 2020.3.4 (Release notes)

Build: 203.8084.24


Are you using the latest Gradle IntelliJ Plugin (1.9.0 currently)?

评论操作 固定链接

Thanks for getting back to me! I tried changing the target IDEA version to 203.8084.24, and I get the same issue: java.lang.AssertionError: JNA library is not available

As for the Gradle plugin, I assume you mean this section of build.gradle:

plugins {
id 'org.jetbrains.intellij' version '1.10.0'

Do you think this might be related to me testing on a Mac with M1 Pro? (Unfortunately, I don’t have an Intel Mac to test on.)

评论操作 固定链接

Could you please try building against newer platform version, e.g. 2022.2?

评论操作 固定链接

I am having a similar issue:

Tests pass as expected on older Intel Macs, but fail on a new M1 MacBook. Also, the tests only fail when run as a Gradle task. Try running the tests using a JUnit run configuration in IntelliJ.