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

android-studie + sdk fails, SDK missing or out of date #91

Open
eyJhb opened this issue Apr 2, 2024 · 9 comments
Open

android-studie + sdk fails, SDK missing or out of date #91

eyJhb opened this issue Apr 2, 2024 · 9 comments

Comments

@eyJhb
Copy link

eyJhb commented Apr 2, 2024

When using the default shell provided in the repo (without flakes), opening Android Studio gives the following error.

image

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.

$ diff --recursive android-sdk android-sdk2
diff '--color=auto' --recursive android-sdk/.knownPackages android-sdk2/.knownPackages
1c1
< ^���o6��[0m
\ No newline at end of file
---
> �(1h?E��
\ No newline at end of file
> xxd android-sdk/.knownPackages
00000000: 9a5e f119 dbe3 f179 ab6f 3698 17e0 d8dd  .^.....y.o6.....
> xxd android-sdk2/.knownPackages
00000000: effb 2831 683f b98a 45d4 e0cc d0a4 9894  ..(1h?..E.......

I'm not sure what the issue is, but I'm somewhat amazed that no issues have been made for it yet.

@thegrubster
Copy link

I experience the same issues, I have also tried using the flake and get the same error.

@robert-elles
Copy link

robert-elles commented Apr 20, 2024

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)

@robbins
Copy link

robbins commented May 1, 2024

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.

@musjj
Copy link

musjj commented Nov 10, 2024

Also having the same issue. Are there some instructions missing from the readme or something? Or is it just currently broken?

@GlennWSo
Copy link

i have the same issue.

i noted this in my warning printed to the terminal from android-studio.

2024-11-21 15:20:21,308 [ 25079] WARN - #c.i.o.u.WindowStateService - cannot find a project frame for ProjectDefault (Template) Project

I think this might be the culprit

@GlennWSo
Copy link

also not all required componets appers to be found.
But im a android noob. So i dont know what the diffrence is between:

  1. android sdk
  2. android sdk-platform

20241121_16h31m06s_grim

@GlennWSo
Copy link

GlennWSo commented Nov 21, 2024

i workaround might be to pin down nixpkgs and/or android-nixpkgs to some version in the flake.lock.

If anyone have a known working flake.lock based on the template in this repo. Please share 🙏

@musjj
Copy link

musjj commented Nov 21, 2024

I managed to make it work thanks to one of the maintainers in nixpkgs. Here's the comment that completely solved it for me: NixOS/nixpkgs#355045 (comment).

It's for the one in nixpkgs, but it works for this flake too.

@numinit
Copy link

numinit commented Nov 26, 2024

Yeah, it was very non obvious even when adding that to the wrapper. I've historically just created a local.properties in a shell hook to get around this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants