Unsolved Installing AVDs
-
Hi,
I am running Qt Creator 4.6.1 (based on Qt 5.11.0) on Windows 10. I also installed:
-
JDK 1.8.0_171
-
SDK
-
NDK android- ndk-r17b.
The installation is correct; I have a green check mark before each item. When I try to install an AVD I get Exception in thread "main" java.lang.NoClassDefFoundError. How can I fix this problem?
Thank you
-
-
Does the exception also happen when you run AVD manager separately (not from within Qt Creator)?
Please check - maybe modern SDK/NDK requires Java 1.9?
-
@sierdzio
How can I run the AVD manager separately? My .Android/AVD folder is empty and there is nothing I can run. -
@gabor53 said in Installing AVDs:
@sierdzio
How can I run the AVD manager separately? My .Android/AVD folder is empty and there is nothing I can run.Go to:
<Android SDK directory>/tools
and there run./android avd
. On Windows it might be something likeandroid.exe avd
, not sure. -
@sierdzio
I went to the directory you recommended.This is what was there. There is nothing I can actually run. The applications don't allow any kind of interaction.
-
You need to open a command line there. Or add arguments (the
avd
) to properties of theandroid.bat
file (right there in the middle of your pic) and then double click it. -
@sierdzio
I get the same error message no matter what command I use (for example update or list AVDs. -
OK, at least that means it is not Qt bug, but something in Android SDK. Make sure your SDK installtion is corrects and that you have correct Java JDK version.
-
@sierdzio
Which versions can I use together? -
No idea, I'm still on some mighty old SDK/NDK/Java combo and I'm afraid to update it. Every time I try, something breaks ;-)
Looking at their Wiki it seems that they recommend OpenJDK 1.8, so the same stuff you have already (unless you are using Oracle Java then it might cause issues).
Have you tried reinstalling the SDK?
-
@sierdzio
I am trying to reinstall, but it is possible to get the SDK only without Android Studio? -
@gabor53 said in Installing AVDs:
I am trying to reinstall, but it is possible to get the SDK only without Android Studio?
-
@sierdzio
The older versions don't work.
I followed the instructions on this page to set the JAVA_HOME.
After that I followed these instructions to create AVDs.
At this time I didn't have any error messages (neither using the command line nor using Qt > Options > Devices > AVD Manager.
If I use the command line theAVD is created, because there are no errormessages. The question is how to find the created AVDs and how to add them to Qt Devices? The AVD manager's add function is thinking for a while then exit without any messages and without adding the AVD. -
I don't know, something is definitely broken in your SDK installation. I don't know how to fix it, and I have not ever seen this error myself.
-
This solved the problems for me:
I downloaded and installed AVD Manager.
It allows me to create AVDs and Qt can read them and place them under the AVD manager tab in Devices. The only problem is that the Target field in AVD manager is grayed out therefore I can't enter anything in that field. Without the target field Qt doesn't want to use the AVD. Is there any way to enter Target? -
I know this question is really old, but I like to left this for someone that might face the same problem. The most likely cause of this error is that the "java.exe" in the PATH it's from a JDK or JRE more recent than 1.8. A JDK or JRE 1.8 is required, the solution is to uninstall the JDK or JRE present and install the version1.8 of the JDK, or if like me, you can't do that, install the version1.8 of the JDK in another location and modify the PATH previous to launch QtCreator, something like: SET "PATH=path\to\jdk1.8;%PATH%".