"android" command is deprecated"

android

#1

After setup ANDROID_HOME and ANDROID SDK_ROOT, i find exception in android list, what should i do.

C:\Users\admin\AppData\Local\Android\sdk\tools>android list sdk --all


The “android” command is deprecated.
For manual SDK, AVD, and project management, please use Android Studio.
For command-line tools, use tools\bin\sdkmanager.bat
and tools\bin\avdmanager.bat


“android” SDK commands can be translated to sdkmanager commands on a best-effort basis.
(This prompt can be suppressed with the --use-sdk-wrapper commend-line argument
or by setting the USE_SDK_WRAPPER environment variable)
Continue? [y/N]: y
Invoking “C:\Users\admin\AppData\Local\Android\sdk\tools\bin\sdkmanager” --list --verbose

Exception in thread “main” java.lang.NoClassDefFoundError: javax/xml/bind/annotation/XmlSchema
at com.android.repository.api.SchemaModule$SchemaModuleVersion.(SchemaModule.java:156)
at com.android.repository.api.SchemaModule.(SchemaModule.java:75)
at com.android.sdklib.repository.AndroidSdkHandler.(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:582)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:185)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:496)
… 5 more


#2

Crashlytics for Android lets you log caught exceptions in your app’s catch blocks. Add a call to Crashlytics.logException(Exception) to your catch block:

try {
myMethodThatThrows();
} catch (Exception e) {
Crashlytics.logException(e);
// handle your exception here!
}

from aaron