-
-
Notifications
You must be signed in to change notification settings - Fork 297
Current Observations on Emulator #696
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
Comments
@rupeshkumar22 I think I set DOWNLOAD_EMU to false because at some moment it seemed that the emulator was downloaded by the SDK when requesting to create a system image, but this might have changed since then. Have you tried running the mode with DOWNLOAD_EMU = true? |
@codeanticode @ranaaditya
The issue seems to be related to the removal of JavaFX classes in Java 11 and Java 11+ Issue: #666 I will be sharing a design document for I observed DOWNLOAD_EMU |
@ranaaditya @codeanticode |
@rupeshkumar22 thanks for putting together this workflow. I'm surprised by the emulator being download repeatedly, I'm pretty sure this did not happen in the past, and not sure why it's happening now. I don't think we should have to keep the temporary file, the mode checks if the emulator command line tool exists: and only tries to download the emulator if that check fails. So something is wrong there, maybe due to a change in how the emulator files are saved in later versions of the Android SDK? My recommendation would be to try to download the SDK and then the emulator from the command line, and if that works, create a system image and launch the emulator, also from the command line, using a recent SDK (30 or higher). If that works, we should be able to make it work from the Android mode by replicating what you did from the command line. |
@codeanticode @ranaaditya When we opt to select Download New SDK for the first time on the dialog on startup it downloads the new SDK at The next time we use Download New SDK on the dialog on startup it downloads the new SDK at some new folder as The issue arises when we run the project in the emulator(Run in emulator) after selecting Is this parameterized constructor (the link that you shared) that holds the code to check emulator existence being referenced anywhere? Yes, I think it's a better way to first try the emulator on the command line, After using an emulator on the command line I will do the adjustments on Android Mode by replicating the work from the command line. |
@rupeshkumar22The fact that the mode keeps trying to download the system image suggests to me that the hasImages() function is always returning false, even when the image is already installed? This function in turns calls getImages(), which it definitely used to work in the past but maybe is not working anymore due to recent changes in the android tools or paths, what to you think? I'd add some breakpoints in those functions to try to find where things break. And at the end of the day, most of what the android mode does is just calling the underlying android tools included in the SDK, for instance in the case of getImages(), the key step is running the avd manager to get the list of available images. Same thing when creating a new image, just calls the avd manager. That's why I recommended to try to running all these steps by yourself from the command line, to make sure they do work. If they do, it would be simply a matter of replicating the correct calls inside the mode. |
@codeanticode @ranaaditya Thanks for the mentioned points to focus on, I have identified the cause of the issue and am able to run the sketch in the emulator by using Download New SDK option on startup. For the |
@rupeshkumar22 this is great progress, thank you! Some comments:
Properly supporting the emulator was always very tricky, but if the sdk manager is now able to handle download/installation by itself, then we could at least rely on that to make our lives easier. @ranaaditya please let us know if you have additional insights/suggestions. |
@codeanticode you have already given a very very detailed explanation here about emulators and system image. I will look into this issue in depth and will update this thread if I find something meaningful. Good work @rupeshkumar22 , keep it up 👌 Thanks, |
@codeanticode things are more clear in depth with this detailed explanation. I'll consider these points during implementation.This is really helpful. For the query in the first comment- Yes, @ranaaditya thanks for appreciation. I'll connect with you as discussed. Thanks! |
Hi @codeanticode @ranaaditya These deprecated SDK tools( |
@rupeshkumar22 thanks for the comments, great to know you are close to make a PR with the emulator fixes. First of all, one quick observation about the code you pointed to:
Isn't there a logic bug there? If tmp does not exist, then if goes to the else branch, where if check again it tmp exists, but at point we know it does, so it will never throw the BadSDKException? If I understand the meaning of that code correctly :-) shouldn't be:
But, if as you said, the versions of the SDK that have the command line tools inside the tools folder instead of cmdline-tools/latest are incompatible with the latest Java, then we should shown an error saying that the SDK is deprecated and a new one needs to be downloaded. Does it sound right? @ranaaditya what do you think? |
Yes, there is a logic bug thanks for indicating. I plan to remove
Yes, we can do that. This seems a better option to resolve any incompatibilities. |
You plan sounds good, thank you! |
I agree with @codeanticode 's observation and with his suggestion |
Hi @codeanticode @ranaaditya I moved forward with implementing a process to download the emulator directly by executing the command. I see the following error-
It seems that downloaded SDK packages just before downloaded emulators are dependent on the emulator and first the license of those packages needs to be accepted before downloading the emulator. I'm moving ahead with first implementing acceptance of license of existing packages before downloading Emulator. This seems to work because I remember first I accepted the license while downloading the emulator directly on the command line which was working well. |
good observation @rupeshkumar22 , is there any way to not disturb the user for accepting the Licence instead we can do that from code ? not sure about it but it pops a notification even in Android studio to accept the licence before downloading the sdk and emulator ! If you NDK issue while running the emulator for apps from PDE then refer issue #599 , solution is in the issue thread. Thanks ! |
Yes, we can automate the license acceptance other than manually by code but as we see a popup is there to ask the user to accept the license, there would be a need or it would be a more responsible way to ask the user to accept the license. Yes Android Studio does the same, But it asks to accept licenses one by one package specific. Whereas we accept licenses for all packages after downloading the packages together combined. I think that is creating an issue in installing an emulator because the emulator is dependent on packages and until and unless the license of packages is not accepted, these are not a part of SDK before installing the emulator, thus creating an issue. After confirming the working of this resolution, I will create a PR asap. Thanks for pointing out the references! |
As of now, I observe that DOWNLOAD_EMU is always set to false. It might have been set because of emulator issues.
The download destination will be
/sdk/emulator
based on thisAlso, With AndroidUtil.createSubFolder(androidFolder, "sdk"); some redundent SDKs gets created.
The emulator needs to be launched by selecting the
RUN IN EMULATOR
option, for now, it's not working on the Windows platform.The text was updated successfully, but these errors were encountered: