搭建环境步骤

基于Eclipse的Android开发环境搭建

在搭建环境过程中,碰到了一些问题,如下。

打开SDK Manager时控制台报错
DDMS files not found: D:\software\sdk\tools\traceview.bat

sdk\tools目录下的traceview.bat无法找到。在网上查找资料后,都说需要下载traceview.bat文件,然后这个又需要大量积分下载。因此找到了一种不需要积分就解决的方法。

​http://openstorage.gunadarma.ac.id/android/sdk/sdk_310712/tools/traceview.bat​

如果你无法打开这个链接的话,复制下面的内容即可。

@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 http://www.apache.org/licenses/LICENSE-2.0
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 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 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 jarfile=traceview.jar
set frameworkdir=

if exist %frameworkdir%%jarfile% goto JarFileOk
set frameworkdir=lib\

if exist %frameworkdir%%jarfile% goto JarFileOk
set frameworkdir=..\framework\

:JarFileOk

set jarpath=%frameworkdir%%jarfile%

if not defined ANDROID_SWT goto QueryArch
set swt_path=%ANDROID_SWT%
goto SwtDone

:QueryArch

for /f %%a in ('%java_exe% -jar %frameworkdir%archquery.jar') do set swt_path=%frameworkdir%%%a

:SwtDone

if exist %swt_path% goto SetPath
echo SWT folder '%swt_path%' does not exist.
echo Please set ANDROID_SWT to point to the folder containing swt.jar for your platform.
exit /B

:SetPath
set javaextdirs=%swt_path%;%frameworkdir%

call %java_exe% -Djava.ext.dirs=%javaextdirs% -Dcom.android.traceview.toolsdir= -jar %jarpath% %*

打开这个链接,复制全部内容存在名为traceview.bat文件中,移动到sdk下的tools目录下。 重启后也许就会成功,可以打开SDK Manager了

但是我依然没能打开,这次控制台没有任何报错,但是SDK Manager也没有反应。

参考博客:SDK manager打不开解决办法

我的JDK和JRE没有问题,所以直接去​​http://tools.android-studio.org/index.php/sdk​​下载SDK更换。

下载推荐的这个SDK:

Android——基于Eclipse EE搭建Android Studio开发环境_Android

双击安装后,Eclipse成功打开SDK Manager。

Android——基于Eclipse EE搭建Android Studio开发环境_Android_02


参考资料:

基于Eclipse的Android开发环境搭建

SDK manager打不开解决办法