Open eyJhb opened 3 months ago
I experience the same issues, I have also tried using the flake and get the same error.
Using the flake and devshell.nix from the template and starting android-studio from within the devshell I also get No installed SDK found!
2024-04-20 13:34:19,173 [ 81844] SEVERE - #com.android.tools.idea.avdmanager.AvdManagerConnection - No installed SDK found! java.lang.Throwable: No installed SDK found! at com.intellij.openapi.diagnostic.Logger.error(Logger.java:370) at com.android.tools.idea.avdmanager.DeviceManagerConnection.getDefaultDeviceManagerConnection(DeviceManagerConnection.java:80) at com.android.tools.idea.avdmanager.AvdDeviceData.getUniqueId(AvdDeviceData.java:192) at com.android.tools.idea.avdmanager.AvdDeviceData.initDefaultValues(AvdDeviceData.java:430) at com.android.tools.idea.avdmanager.AvdDeviceData.
(AvdDeviceData.java:174) at com.android.tools.idea.avdmanager.AvdOptionsModel. (AvdOptionsModel.java:167) at com.android.tools.idea.avdmanager.AvdOptionsModel. (AvdOptionsModel.java:161) at com.android.tools.idea.avdmanager.AvdManagerImpl.createAvd(LocalEmulatorProvisionerFactory.kt:79) at com.android.sdklib.deviceprovisioner.LocalEmulatorProvisionerPlugin$createDeviceAction$1.create(LocalEmulatorProvisionerPlugin.kt:297) at com.android.tools.idea.devicemanagerv2.DeviceManagerPanel$toAnAction$3.invoke(DeviceManagerPanel.kt:313) at com.android.tools.idea.devicemanagerv2.DeviceManagerPanel$toAnAction$3.invoke(DeviceManagerPanel.kt:313) at com.android.tools.idea.devicemanagerv2.DeviceManagerPanel$toAnAction$2$actionPerformed$1.invokeSuspend(DeviceManagerPanel.kt:308) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:702) at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:699) at java.base/java.security.AccessController.doPrivileged(AccessController.java:399) at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:699) at java.base/java.lang.Thread.run(Thread.java:840)
I copied out the Nix-provided Android SDK from the Nix Store to my home directory, and after making it writable, selecting it in Android Studio resulted in a new screen saying "Nothing to do! Android SDK is up to date.".
It seems like there's no difference between the two:
diff --recursive /nix/store/dfvplmh6ykc6ys22xa08wpjv694cql4c-android-sdk-env/share/android-sdk android-sdk
produces no output.
However, after going back to the Nix-provided SDK in the Nix Store, it is now able to be selected and new projects can be created. So it seems this might be a workaround for now.
When using the default shell provided in the repo (without flakes), opening Android Studio gives the following error.
The path is correct to the SDK, and it seems to have all the things needed included. However, it ONLY works if the SDK is moved outside the nix store, and made RW. I can see that it changes one file, between the one in the store (android-sdk RO) and the one outside the store (android-sdk2 RW), and then it works.
I'm not sure what the issue is, but I'm somewhat amazed that no issues have been made for it yet.