Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Start failed with latest Android Studio #1353

Closed
Undin opened this issue Mar 28, 2023 · 2 comments
Closed

Start failed with latest Android Studio #1353

Undin opened this issue Mar 28, 2023 · 2 comments
Labels
Milestone

Comments

@Undin
Copy link
Contributor

Undin commented Mar 28, 2023

Describe the bug
I can't run Android Studio AI-2022.3.1.10 because it shows me Start Failed error message
Screenshot 2023-03-28 at 16 38 36

Some tests fail as well.

I assume it's because of problem during loading dynamic jna library

Stacktrace
[    439]   WARN - #c.i.j.JnaLoader - Unable to load JNA library (os=Mac OS X 12.5.1, jna.boot.library.path=/Users/Arseniy.Pendryak/.gradle/caches/modules-2/files-2.1/com.google.android.studio/android-studio/2022.3.1.10/15b5e33d4e4439ba810fd33343c24de9586f1424/android-studio-2022.3.1.10/Contents/lib/jna/amd64)
java.lang.UnsatisfiedLinkError: Unable to locate JNA native support library
	at com.sun.jna.Native.loadNativeDispatchLibrary(Native.java:1018)
	at com.sun.jna.Native.<clinit>(Native.java:221)
	at com.intellij.jna.JnaLoader.load(JnaLoader.java:19)
	at com.intellij.jna.JnaLoader.isLoaded(JnaLoader.java:35)
	at com.intellij.openapi.util.io.FileSystemUtil.computeMediator(FileSystemUtil.java:58)
	at com.intellij.openapi.util.io.FileSystemUtil.<clinit>(FileSystemUtil.java:53)
	at com.intellij.openapi.vfs.newvfs.persistent.FSRecords.calculateVersion(FSRecords.java:100)
	at com.intellij.openapi.vfs.newvfs.persistent.FSRecords.connect(FSRecords.java:166)
	at com.intellij.openapi.vfs.newvfs.persistent.PersistentFSImpl.doConnect(PersistentFSImpl.java:128)
	at com.intellij.openapi.vfs.newvfs.persistent.PersistentFSImpl.connect(PersistentFSImpl.java:107)
	at com.intellij.openapi.vfs.newvfs.persistent.PersistentFSImpl.<init>(PersistentFSImpl.java:99)
	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77)
	at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499)
	at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:480)
	at com.intellij.serviceContainer.ConstructorInjectionKt.instantiateUsingPicoContainer(constructorInjection.kt:49)
	at com.intellij.serviceContainer.ComponentManagerImpl.instantiateClassWithConstructorInjection(ComponentManagerImpl.kt:996)
	at com.intellij.serviceContainer.ServiceComponentAdapter.createAndInitialize(ServiceComponentAdapter.kt:43)
	at com.intellij.serviceContainer.ServiceComponentAdapter.doCreateInstance(ServiceComponentAdapter.kt:39)
	at com.intellij.serviceContainer.BaseComponentAdapter.doCreateInstance(BaseComponentAdapter.kt:154)
	at com.intellij.serviceContainer.BaseComponentAdapter.createInstance$lambda$1(BaseComponentAdapter.kt:133)
	at com.intellij.openapi.progress.Cancellation.computeInNonCancelableSection(Cancellation.java:99)
	at com.intellij.serviceContainer.BaseComponentAdapter.createInstance(BaseComponentAdapter.kt:132)
	at com.intellij.serviceContainer.BaseComponentAdapter.access$createInstance(BaseComponentAdapter.kt:19)
	at com.intellij.serviceContainer.BaseComponentAdapter$getInstanceAsync$2.invokeSuspend(BaseComponentAdapter.kt:181)
	at com.intellij.serviceContainer.BaseComponentAdapter$getInstanceAsync$2.invoke(BaseComponentAdapter.kt)
	at com.intellij.serviceContainer.BaseComponentAdapter$getInstanceAsync$2.invoke(BaseComponentAdapter.kt)
	at kotlinx.coroutines.intrinsics.UndispatchedKt.startUndispatchedOrReturn(Undispatched.kt:89)
	at kotlinx.coroutines.BuildersKt__Builders_commonKt.withContext(Builders.common.kt:169)
	at kotlinx.coroutines.BuildersKt.withContext(Unknown Source)
	at com.intellij.serviceContainer.BaseComponentAdapter.getInstanceAsync(BaseComponentAdapter.kt:176)
	at com.intellij.serviceContainer.ComponentManagerImpl.getServiceAsyncIfDefined(ComponentManagerImpl.kt:645)
	at com.intellij.serviceContainer.ComponentManagerImpl.getServiceAsync(ComponentManagerImpl.kt:636)
	at com.intellij.idea.ApplicationLoader$preloadCriticalServices$1.invokeSuspend(ApplicationLoader.kt:192)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
	at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:570)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:677)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:664)

To Reproduce
Try to run test in Edu-Android module using https://github.com/JetBrains/educational-plugin/tree/54cf5edaca499a4c6f7748eeb52c76f10a0b4198

Expected behavior
AS launches without error and tests don't fail with java.lang.UnsatisfiedLinkError: Unable to locate JNA native support library error

Environment:

  • OS: macOS 12.5.1
  • Gradle IntelliJ Plugin Version: 1.10.1 and 1.13.2
  • Gradle Version: 7.6

Additional context
Symptoms are the same with #1163

@Undin Undin added the bug label Mar 28, 2023
@hsz
Copy link
Member

hsz commented Mar 28, 2023

With IDE (no matter if it's IntelliJ IDEA or Android Studio) based on 2022.3+, it is required to append proper JVM arguments described in the following file:

/Users/hsz/.gradle/caches/modules-2/files-2.1/com.google.android.studio/android-studio/2022.3.1.10/3d39f250bd41684a4dbe27af370ac5bcce19db72/android-studio-2022.3.1.10/Resources/product-info.json
{
  ...
  "launch": [
    {
      "additionalJvmArguments": [
        ...
        "-Djna.boot.library.path=$APP_PACKAGE/Contents/lib/jna/aarch64",
        "-Djna.nosys=true",
        "-Djna.noclasspath=true",
        ...
      ],
      ...
    }
  ],
  ...
}

Probably you're spinning up the Android Studio IDE not through the Gradle IntelliJ Plugin, but in another custom way — therefore, you should pass everything listed in the additionalJvmArguments brach.

@Undin
Copy link
Contributor Author

Undin commented Mar 29, 2023

Probably you're spinning up the Android Studio IDE not through the Gradle IntelliJ Plugin, but in another custom way

We migrated downloading of AS via gradle-intellij-plugin some time ago, so it cannot be a cause of this issue

@hsz hsz added this to the next milestone Mar 29, 2023
@hsz hsz closed this as completed Mar 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants