running new project on android: Exception in thread "main" java.lang.NoClassDefFoundError
See original GitHub issueWhen running tns run android
on fresh project scaffold:
WARNING: There seem to be some problems with the Android configuration
Exception in thread "main" java.lang.NoClassDefFoundError: javax/xml/bind/annotation/XmlSchema
at com.android.repository.api.SchemaModule$SchemaModuleVersion.<init>(SchemaModule.java:156)
at com.android.repository.api.SchemaModule.<init>(SchemaModule.java:75)
at com.android.sdklib.repository.AndroidSdkHandler.<clinit>(AndroidSdkHandler.java:81)
at com.android.sdklib.tool.sdkmanager.SdkManagerCli.main(SdkManagerCli.java:73)
at com.android.sdklib.tool.sdkmanager.SdkManagerCli.main(SdkManagerCli.java:48)
Caused by: java.lang.ClassNotFoundException: javax.xml.bind.annotation.XmlSchema
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:602)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
... 5 more
Issue Analytics
- State:
- Created 3 years ago
- Comments:13 (4 by maintainers)
Top Results From Across the Web
Exception in thread "main" java.lang.NoClassDefFoundError
Running as an android test deploys the test apk to the device and runs it there (under dalvik vm). A long time ago...
Read more >3 ways to solve java.lang.NoClassDefFoundError in Java J2EE
Exception in thread “main” simply indicates that it's the “main” thread that is not able to find a particular class it could be...
Read more >r/libgdx - getting Exception in thread "main" java.lang ... - Reddit
I am getting the java.lang.NoClassDefFoundError when I click 'run with coverage' and run the desktoop launcher. I know what java.lang.
Read more >NoClassDefFoundError when trying to run a scratch file in ...
When trying to instantiate a class from my Android Studio project in a scratch file I get a NoClassDefFoundError. ... Exception in thread...
Read more >Exception in thread "main" java.lang.NoClassDefFoundError
It's denoted by java.lang.NoClassDefFoundError and comes when that particular class is present during compile time but somehow not available during runtime.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@JimLynchCodes I have a draft of the setup guide rewritten for the new docs, perhaps you can try these steps: https://gist.github.com/rigor789/7829f09b5a903fdf31799b65b902c52e
Your issue seems to be an invalid or missing ANDROID_HOME environment variable.
Your
PATH
is missing$ANDROID_HOME/emulator:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools
. Well, only theplatform-tools
is necessary the others are useful otherwise.These were in the guide I linked btw:
Happy to help but opening multiple issues with the same content/question won’t get you further - it’s easier to help in a single place, so I closed one of the issues.