Android SDK / Android.bat没有findSWT.jar文件


我正在运行Windows 7 x64,我的文件位置如下所示:

 Android SDK (zip version) - C:\android-sdk-windows SWT.jar (from the Zip) - C:\android-sdk-windows\tools\lib\x86 C:\android-sdk-windows\tools\lib\x86_64 JDK 6 u24 x64 - C:\Program Files\Java\jdk1.6.0_24 


 ANDROID_SWT = C:\android-sdk-windows\tools\lib\x86_64 Path = ;C:\Program Files\Java\jdk1.6.0_24\bin 


在执行Android SDKpipe理器时,黑色命令屏幕快速闪烁并消失,不会启动SDK,因此我无法下载任何平台和附加组件。


我追查到的android.bat文件的罪魁祸首,但似乎无法弄清楚。 我已经为SWT.jar文件设置了环境variables。


 @echo off rem Copyright (C) 2007 The Android Open Source Project rem rem Licensed under the Apache License, Version 2.0 (the "License"); rem you may not use this file except in compliance with the License. rem You may obtain a copy of the License at rem rem rem rem Unless required by applicable law or agreed to in writing, software rem distributed under the License is distributed on an "AS IS" BASIS, rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. rem See the License for the specific language governing permissions and rem limitations under the License. rem Useful links: rem Command-line reference: rem rem don't modify the caller's environment setlocal rem Set up prog to be the path of this script, including following symlinks, rem and set up progdir to be the fully-qualified pathname of its directory. set prog=%~f0 rem Grab current directory before we change it set work_dir="%cd%" rem Change current directory and drive to where the script is, to avoid rem issues with directories containing whitespaces. cd /d %~dp0 rem Check we have a valid Java.exe in the path. set java_exe= call lib\find_java.bat if not defined java_exe goto :EOF set jar_path=lib\sdkmanager.jar rem Set SWT.Jar path based on current architecture (x86 or x86_64) for /f %%a in ('%java_exe% -jar lib\archquery.jar') do set swt_path=lib\%%a if "%1 %2"=="update sdk" goto StartUi if not "%1"=="" goto EndTempCopy :StartUi echo [INFO] Starting Android SDK and AVD Manager rem We're now going to create a temp dir to hold all the Jar files needed rem to run the android tool, copy them in the temp dir and finally execute rem from that path. We do this only when the launcher is run without rem arguments, to display the SDK Updater UI. This allows the updater to rem update the tools directory where the updater itself is located. set tmp_dir=%TEMP%\temp-android-tool xcopy %swt_path% %tmp_dir%\%swt_path% /I /E /C /G /R /Y /Q > nul copy /B /D /Y lib\androidprefs.jar %tmp_dir%\lib\ > nul copy /B /D /Y lib\org.eclipse.* %tmp_dir%\lib\ > nul copy /B /D /Y lib\sdk* %tmp_dir%\lib\ > nul copy /B /D /Y lib\common.jar %tmp_dir%\lib\ > nul copy /B /D /Y lib\commons-compress* %tmp_dir%\lib\ > nul rem jar_path and swt_path are relative to PWD so we don't need to adjust them, just change dirs. set tools_dir=%cd% cd /d %tmp_dir% :EndTempCopy rem The global ANDROID_SWT always override the SWT.Jar path if defined ANDROID_SWT set swt_path=%ANDROID_SWT% if exist %swt_path% goto SetPath echo ERROR: SWT folder '%swt_path%' does not exist. echo Please set ANDROID_SWT to point to the folder containing swt.jar for your platform. goto :EOF :SetPath rem Finally exec the java program and end here. call %java_exe%"%tools_dir%" -classpath "%jar_path%;%swt_path%\swt.jar" %* rem EOF 


 C:\Users\MuniFC Portable11>C:\android-sdk-windows\tools\android.bat [INFO] Starting Android SDK and AVD Manager 'xcopy' is not recognized as an internal or external command, operable program or batch file. No command line parameters provided, launching UI. See 'android --help' for operations from the command line. java.lang.NullPointerException at at at<init>( at at<init>( at<init>( at<init>( at at at at` 




命令提示符运行 – Android.bat =

 C:\Users\MuniFC Portable11>C:\android-sdk-windows\tools\android.bat [INFO] Starting Android SDK and AVD Manager No command line parameters provided, launching UI. See 'android --help' for operations from the command line. java.lang.NullPointerException at at at<init>( at at<init>( at<init>( at<init>( at at at at C:\Users\MuniFC Portable11> 

Solutions Collecting From Web of "Android SDK / Android.bat没有findSWT.jar文件"

添加C:\windows\system32到PATH xcopy错误消失了,但是android.bat仍然有swt.jar的问题。 删除ANDROID_SWTvariables为我工作。


最后,我通过将java和android sdk文件夹重命名为空字符清除了这个问题。

在开始时,java安装在D:\Program Files\Java ,android sdk安装在D:\Program Files\Android

切换到D:\JavaD:\Android ,并将D:\Java\jdk1.7.0_04\binPATH ,并出现。

我曾经有同样的问题,清除AVD文件夹(虚拟设备的configuration)为我工作…你应该尝试一下。 接缝,问题是一个腐败AVD,导致android.bat脚本parsing时失败。

只需从您的Windowsconfiguration文件文件夹中删除.android ,它应该工作,因为它为我工作。

好,所以我也有这个问题,以及在环境variables,ANDROID_SWT = libx86_64,并将Android和Java移动到C:\我也没有修改工作修复中的android.bat。

我在Windows 8.1专业版x64上运行Android Studio x64。 随着JDK 8 x64安装。

我有同样的问题从Android Studio运行AVD。 以下是修复:

编辑系统环境variables…使用Windowssearch只需键入环境variables,它会打开编辑器。 添加一个名为ANDROID_SWT的新系统variables。 如果它已经在那里不需要添加另一个。 将“variables值”设置为swt.jar所在的path。 我发现我的通过:

C:…. \ Android的工作室\ SDK \工具\ LIB \ x86_64的\ SWT.JAR

然后,我复制并将该path粘贴到新的(或现有的)ANDROID_SWT系统variables值中。 然后我按OK键保存新的系统variables,它是新的值(这是swt.jar的path),closures并重新打开Android Studio和AVD启动!


尝试打开'uiautomatorviewer.bat'时遇到同样的问题。 为了解决这个问题,我添加了ANDROID_SWT环境variables,并将android_sdk / tools文件夹添加到PATH




 find /i "x86" > NUL && set arch_ext=32 || set arch_ext=64 

删除arch_ext=32||之间的arch_ext=32 ,像arch_ext=32|| ,重新打开cmd,所有工具都能正常工作。