2012-12-12 365 views
0

我已經下載了Android SDK工具。解壓縮文件,然後在目錄工具Android編譯失敗

  1. ./android update sdk --no-ui
  2. ./android create project --target 1 --name MyApp --path ./MyApp --activity MyAppActivity --package com.example.myapp
  3. cd MyApp
  4. ant debug

運行這些命令和得到這個錯誤:

BUILD FAILED /home/lived/devel/android/tools/MyApp/build.xml:90: The following error occurred while executing this line: /home/lived/devel/android/tools/ant/build.xml:108: taskdef A class needed by class com.android.ant.SignApkTask cannot be found: com.android.ant.SignApkTask using the classloader AntClassLoader[/home/lived/devel/android/tools/lib/anttasks.jar:/home/lived/devel/android/tools/lib/common.jar:/home/lived/devel/android/tools/lib/guava-tools.jar:/home/lived/devel/android/tools/lib/sdklib.jar:/home/lived/devel/android/tools/lib/layoutlib_api.jar:/home/lived/devel/android/tools/lib/commons-compress-1.0.jar:/home/lived/devel/android/tools/lib/httpclient-4.1.1.jar:/home/lived/devel/android/tools/lib/httpcore-4.1.jar:/home/lived/devel/android/tools/lib/httpmime-4.1.1.jar:/home/lived/devel/android/tools/lib/commons-logging-1.1.1.jar:/home/lived/devel/android/tools/lib/commons-codec-1.4.jar:/home/lived/devel/android/tools/lib/dvlib.jar:/home/lived/devel/android/tools/lib/manifmerger.jar]

系統信息:

[email protected]:~> cat /etc/SuSE-release 
openSUSE 12.2 (x86_64) 
VERSION = 12.2 
CODENAME = Mantis 

[email protected]:~> java -version 
java version "1.7.0_09" 
OpenJDK Runtime Environment (IcedTea7 2.3.3) (suse-3.16.1-x86_64) 
OpenJDK 64-Bit Server VM (build 23.2-b09, mixed mode) 

[email protected]:~> javac --version 
javac (SUSE Linux) 4.7.1 20120723 [gcc-4_7-branch revision 189773] 
Copyright (C) 2012 Free Software Foundation, Inc. 
This is free software; see the source for copying conditions. There is NO 
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 

[email protected]:~> ant -version 
Apache Ant(TM) version 1.8.2 compiled on June 23 2012 

我錯過了什麼?

感謝

回答

0

我通過安裝包的java-1_7_0-的OpenJDK-devel的解決了這個問題。在我只安裝了patters-openSUSE-devel_java之前。