我已经安装了 Android Studio,并想使用 Cordova 和 Phonegap 开发应用程序,这要感谢我的合作伙伴 @karel 的帮助,他向我展示了这个问题:
如何在 Ubuntu 上安装 Android Studio?
我严格按照说明操作,但即便如此,我还是遇到了几个错误。当您使用以下命令启动 Android Studio 时,sudo -E /opt/google/android-studio/bin/studio.sh
会显示第一个错误:
Gtk-Message: 09:07:14.283: Failed to load module "canberra-gtk-module"
(java:13968): IBUS-WARNING **: 09:07:14.566:
The owner of /home/miguel/.config/ibus/bus is not root!
我安装了 SDK,(我认为我安装了必要的 SDK),当我返回到 Cordova 项目时,我运行cordova requirements
以查看一切是否正常,结果如下:
Android Studio project detected
Requirements check results for android:
Java JDK: installed 11.0.2
Android SDK: installed true
Android target: not installed
avdmanager: Command failed with exit code 1 Error output:
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.AvdManagerCli.run(AvdManagerCli.java:213)
at com.android.sdklib.tool.AvdManagerCli.main(AvdManagerCli.java:200)
Caused by: java.lang.ClassNotFoundException: javax.xml.bind.annotation.XmlSchema
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:583)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
... 5 more
Gradle: not installed
Could not find an installed version of Gradle either in Android Studio,
or on your system to install the gradle wrapper. Please include gradle
in your path, or install Android Studio
Some of requirements check failed
miguel@miguel:~/todo-codigos/proyectos-2019/cordova/zombies$
我做错了什么?我该怎么做才能纠正这个问题并能够在 Cordova 和 Phonegap 上运行我的应用程序?