Android命令不起作用 - ubuntu 13.10

时间:2014-05-06 07:31:20

标签: java android ubuntu cordova ubuntu-13.10

当我正在运行android命令时显示以下错误消息

Invalid MIT-MAGIC-COOKIE-1 keyException in thread "main" org.eclipse.swt.SWTError: No more handles [gtk_init_check() failed]
at org.eclipse.swt.SWT.error(Unknown Source)
at org.eclipse.swt.widgets.Display.createDisplay(Unknown Source)
at org.eclipse.swt.widgets.Display.create(Unknown Source)
at org.eclipse.swt.graphics.Device.<init>(Unknown Source)
at org.eclipse.swt.widgets.Display.<init>(Unknown Source)
at org.eclipse.swt.widgets.Display.<init>(Unknown Source)
at org.eclipse.swt.widgets.Display.getDefault(Unknown Source)
at org.eclipse.swt.widgets.Shell.<init>(Unknown Source)
at org.eclipse.swt.widgets.Shell.<init>(Unknown Source)
at com.android.sdkuilib.internal.repository.ui.SdkUpdaterWindowImpl2.createShell(SdkUpdaterWindowImpl2.java:168)
at com.android.sdkuilib.internal.repository.ui.SdkUpdaterWindowImpl2.open(SdkUpdaterWindowImpl2.java:137)
at com.android.sdkuilib.repository.SdkUpdaterWindow.open(SdkUpdaterWindow.java:111)
at com.android.sdkmanager.Main.showSdkManagerWindow(Main.java:412)
at com.android.sdkmanager.Main.doAction(Main.java:390)
at com.android.sdkmanager.Main.run(Main.java:150)
at com.android.sdkmanager.Main.main(Main.java:116)

请帮我解决这个问题。谢谢。

1 个答案:

答案 0 :(得分:-1)

您需要先设置 android sdk path 。 要修改系统的PATH变量,您需要编辑 .bashrc 文件。为此,请在终端中执行以下命令:

$ nano ~/.bashrc

现在,您将在终端上启用Nano文本编辑器。现在,在文件的最顶部,输入以下内容:

#AndroidDev PATH

export PATH=${PATH}:~/android-sdk-linux/tools

export PATH=${PATH}:~/android-sdk-linux/platform-tools

完成后,按 CTRL + X,Y ,然后按 Enter 保存更改并退出Nano文本编辑器。

试试吧......