Appcelerator工作室无法启动我的Android应用程序

时间:2015-07-07 08:49:24

标签: android appcelerator

我是Appcelerator的新手,我最近在Windows 7 64位计算机上安装了Appcelerator Studio。我有Android SDKs - 5.1.1和5.1.0。我还使用“appc ti config”命令将Android版本从22.0.0(默认)更改为21.0.0,因为它显示了默认Android版本的警告。

我现在正试图在我的Android手机上启动测试应用程序。 Appcelerator工作室能够发现我的设备,但是当我运行应用程序时,我收到以下错误:

[ERROR] :  Missing required Android SDK tools: zipalign, aapt, aidl, dx
[ERROR] :  
[ERROR] :  The Android SDK located at C:\android-sdk-win has incomplete or out-of-date packages.
[ERROR] :  
[ERROR] :  Current installed Android SDK tools:
[ERROR] :    Android SDK Tools:          24.3.3
[ERROR] :    Android SDK Platform Tools: 22.0.0
[ERROR] :    Android SDK Build Tools:    21.0.0
[ERROR] :  
[ERROR] :  Make sure you have the latest Android SDK Tools, Platform Tools, and Build Tools installed.
[ERROR] :  
[ERROR] :  You can also specify the exact location of these required tools by running:
[ERROR] :    appc ti config android.executables.zipalign "C:\path\to\android-sdk\zipalign.exe"
[ERROR] :    appc ti config android.executables.aapt "C:\path\to\android-sdk\aapt.exe"
[ERROR] :    appc ti config android.executables.aidl "C:\path\to\android-sdk\aidl.exe"
[ERROR] :    appc ti config android.executables.dx "C:\path\to\android-sdk\dx.bat"

修改

我能够通过运行'appc ti config android.executables.aapt'等命令来解决上述错误:C:\ path \ to \ android-sdk \ aapt.exe“

但是应用程序启动仍然没有成功。它停留在“启动Appcelerator ...... :( 57%)”控制台输出如下:

    Appcelerator Command-Line Interface, version 4.0.2
Copyright (c) 2014-2015, Appcelerator, Inc.  All Rights Reserved.
TRACE  | __command__ search paths:
[
  "C:\\Users\\username\\.appcelerator\\install\\4.0.2\\package",
  "C:\\Users\\username\\.appcelerator\\install\\4.0.2\\package\\node_modules",
  "C:\\Windows\\system32\\node_modules",
  "C:\\Windows\\node_modules",
  "C:\\node_modules",
  "C:\\Users\\username\\.appcelerator\\.npm\\lib\\node_modules"
]
DEBUG  | [PLUGIN-LOAD] 1ms C:\Users\username\.appcelerator\install\4.0.2\package\appc.js
DEBUG  | [PLUGIN-LOAD] 2058ms C:\Users\username\.appcelerator\install\4.0.2\package\node_modules\appc-cli-titanium\appc.js
DEBUG  | [PLUGIN-LOAD] 2ms C:\Users\username\.appcelerator\install\4.0.2\package\node_modules\arrow\appc.js
log level set to "trace"
executing command "run"
set environment to {"registry":"https://software.appcelerator.com","security":"https://security.appcelerator.com","baseurl":"https://platform.appcelerator.com"}
checking credentials for existing session
Attempting to load session info from config file
check if session is invalidated
session expiry 1436363230210 false
ACS config file: C:\Users\username\.acs
found ACS login { mid: '78-84-3C-EB-1E-EE',
  username: '<my email here>',
  cookie: [ 'connect.sid=s%3ANzD7%2F4ddUCpGeXpMINQQqfbr.yg%2BuCo3wTu7J%2Fy%2Bcf1VFefQVIjyOKnB9AxlzX5rd8WY; path=/; expires=Wed, 08 Jul 2015 13:46:11 GMT; httpOnly' ],
  publishHost: 'https://admin.cloudapp-enterprise.appcelerator.com',
  publishPort: 443,
  defaultEP: 
   { publishHost: 'https://admin.cloudapp-enterprise.appcelerator.com',
     publishPort: 443 } } , checking nodeACSEndpoint= https://admin.cloudapp-enterprise.appcelerator.com
ACS cookie expiry [ 1436363171000 ]
session already loaded in opts.session
getCredentials() session:
{
  "ipaddress": "<HIDDEN>",
  "username": "<my email here>",
  "password": "<OMITTED>",
  "session": "<OMITTED>",
  "nonce": "<OMITTED>",
  "environment": {
    "name": "production",
    "isProduction": true,
    "acsBaseUrl": "https://api.cloud.appcelerator.com",
    "acsAuthBaseUrl": "https://secure-identity.cloud.appcelerator.com",
    "nodeACSEndpoint": "https://admin.cloudapp-enterprise.appcelerator.com"
  },
  "token": "<OMITTED>",
  "fingerprint": "a70646c9735845c52dd791bf727f8db1a0eca0a9",
  "fingerprint_description": "Windows Machine ID: <HIDDEN>",
  "org_id": <HIDDEN>,
  "expiry": 1436363230210
}
loading plugins for command "run"
run search paths:
[
  "C:\\Users\\username\\.appcelerator\\install\\4.0.2\\package",
  "C:\\Users\\username\\.appcelerator\\install\\4.0.2\\package\\node_modules",
  "C:\\Windows\\system32\\node_modules",
  "C:\\Windows\\node_modules",
  "C:\\node_modules",
  "C:\\Users\\username\\.appcelerator\\.npm\\lib\\node_modules"
]
[PLUGIN-LOAD] 0ms C:\Users\username\.appcelerator\install\4.0.2\package\appc.js
[PLUGIN-LOAD] 992ms C:\Users\username\.appcelerator\install\4.0.2\package\node_modules\appc-cli-titanium\appc.js
run plugin: C:\Users\username\.appcelerator\install\4.0.2\package\node_modules\appc-cli-titanium
[PLUGIN-LOAD] 4ms C:\Users\username\.appcelerator\install\4.0.2\package\node_modules\arrow\appc.js
run plugin: C:\Users\username\.appcelerator\install\4.0.2\package\node_modules\arrow
plugin "arrow" failed its "when" function check, skipping...
loading plugin "titanium" for command "run" CLI options via function
loading plugin "titanium" for command "run" CLI options via array
Duplicate option "colors" for command "run", removing...
executing command "run" with the following plugins:
["titanium"]
TRACE  | Attempting to load session info from config file
TRACE  | check if session is invalidated
TRACE  | session expiry 1436363230210 false
TRACE  | session already loaded in opts.session
DEBUG  | Titanium Downloads Last Checked: 1436257959200
TRACE  | "C:\Program Files\nodejs\node.exe" "C:\Users\username\.appcelerator\install\4.0.2\package\node_modules\appc-cli-titanium\node_modules\titanium\bin\titanium" config -o json-object
TRACE  | "C:\Program Files\nodejs\node.exe" "C:\Users\username\.appcelerator\install\4.0.2\package\node_modules\appc-cli-titanium\node_modules\titanium\bin\titanium" sdk -o json
TRACE  | checking for titanium, result:
 { activeSDK: '4.0.0.GA',
  defaultInstallLocation: 'C:\\ProgramData\\Titanium',
  installLocations: 
   [ 'C:\\ProgramData\\Titanium',
     'C:\\Users\\username\\AppData\\Roaming\\Titanium',
     'C:\\ProgramData\\Application Data\\Titanium' ],
  installed: { '4.0.0.GA': 'C:\\ProgramData\\Titanium\\mobilesdk\\win32\\4.0.0.GA' } }
TRACE  | C:\Program Files\nodejs\node.exe [ 'C:\\Users\\username\\.appcelerator\\install\\4.0.2\\package\\node_modules\\appc-cli-titanium\\node_modules\\titanium\\bin\\titanium',
  'build',
  '--platform',
  'android',
  '--log-level',
  'trace',
  '--sdk',
  '4.0.0.GA',
  '--project-dir',
  'C:\\work\\Appcelerator\\Favebooks',
  '--target',
  'device',
  '--android-sdk',
  'C:\\android-sdk-win',
  '--device-id',
  'TA09407S62',
  '--liveview',
  '--deploy-type',
  'development',
  '--no-colors',
  '--no-progress-bars',
  '--no-prompt',
  '--prompt-type',
  'socket-bundle',
  '--prompt-port',
  '49577',
  '--username',
  '<my email here>',
  '--password',
  '[HIDDEN]',
  '--plugin-paths',
  'C:\\Users\\username\\.appcelerator\\install\\4.0.2\\package\\node_modules',
  '--config-file',
  'C:\\Users\\username\\AppData\\Local\\Temp\\build-1436281919408.json',
  '--no-banner' ]

Android SDK Manager output

更新2

我认为我已经向前迈进了一步 -

  • 我重新安装了Android SDK几次。
  • 编辑了我的tiapp.xml并添加了<uses-sdk minSdkVersion="10" targetSdkVersion="21"/>
  • 尝试使用ti build命令生成apk。

当前状态是使用Appcelerator Studio启动应用程序仍然失败。当我尝试使用Titanium CLI构建apk文件,即appc ti build -b命令时,我收到以下错误:

[ERROR] Failed to run dexer:
[ERROR]
[ERROR] :
Error: Unable to access jarfile null

看起来Running dexer命令中的“-jar”之后有一个空参数(“”)导致问题:

C:\Progra~2\Java\jdk1.7.0_06\bin\java.exe "-Xmx1024M" "-XX:-UseGCOverheadLimit" "-Djava.ext.dirs=C:\android-sdk-win\platform-tools" "-jar" "" "--dex" "--output=C:\work\Appcelerator\Favebooks\build\android\bin\classes.dex" "C:\work\Appcelerator\Favebooks\build\android\bin\classes" "C:\ProgramData\Titanium\mobilesdk\win32\4.0.0.GA\android\lib\titanium-verify.jar" ..long list of jar files..

长话短说,我将针对上述问题创建一个单独的SO问题。

appc ti setup check输出:

    ──────────────────┤ Check Environment ├───────────────────

Node.js
  *  node               new version v0.12.6 available! (currently v0.12.2)
  *  npm                new version v3.1.0 available! (currently v2.7.4)

Titanium CLI
  √  cli                up-to-date (v4.0.1)

Titanium CLI Dependencies
  √  async              up-to-date (v0.2.10)
  √  colors             up-to-date (v0.6.2)
  √  fields             up-to-date (v0.1.24)
  √  humanize           up-to-date (v0.0.9)
  √  jade               up-to-date (v0.35.0)
  √  longjohn           up-to-date (v0.2.4)
  √  moment             up-to-date (v2.4.0)
  x  node-appc          missing
  √  optimist           up-to-date (v0.6.1)
  √  request            up-to-date (v2.27.0)
  √  semver             up-to-date (v2.2.1)
  √  sprintf            up-to-date (v0.1.5)
  √  temp               up-to-date (v0.6.0)
  √  winston            up-to-date (v0.6.2)
  x  wrench             missing

Titanium SDK
  √  latest sdk         installed (v4.0.0.GA)
  x  selected sdk       selected Titanium SDK "vundefined" is not installed

Android Environment
  √  sdk                installed (C:\android-sdk-win)
  !  tools              untested version 24.3.3; may or may not work
  √  platform tools     installed (v22.0.0)
  x  build tools        unsupported version 21.0.0
  √  adb                installed C:\android-sdk-win\platform-tools\adb.exe
  √  android            installed C:\android-sdk-win\tools\android.bat
  √  emulator           installed C:\android-sdk-win\tools\emulator.exe
  √  mksdcard           installed C:\android-sdk-win\tools\mksdcard.exe
  √  zipalign           installed C:\android-sdk-win\build-tools\21.1.1\zipalign.exe
  √  aapt               installed C:\android-sdk-win\build-tools\21.1.1\aapt.exe
  √  aidl               installed C:\android-sdk-win\build-tools\21.1.1\aidl.exe
  √  targets            installed (3 found)
  √  avds               installed (6 found)
  √  ndk                installed (undefined)
  √  ndk-build          installed (undefined)

Java Development Kit
  √  jdk                installed (v1.7.0)
  √  java               installed C:\Progra~2\Java\jdk1.7.0_06\bin\java.exe
  √  javac              installed C:\Progra~2\Java\jdk1.7.0_06\bin\javac.exe
  √  keytool            installed C:\Progra~2\Java\jdk1.7.0_06\bin\keytool.exe
  √  jarsigner          installed C:\Progra~2\Java\jdk1.7.0_06\bin\jarsigner.exe

Intelr Hardware Accelerated Execution Manager (HAXM)
  √  compatible
  √  installed

Network
  √  online
  -  no proxy server configured
  √  Network connection test
  √  Java-based connection test

Directory Permissions
  √  home directory
  √  titanium config directory
  √  titanium sdk install directory
  √  temp directory

2 个答案:

答案 0 :(得分:3)

嗯,本周我遇到了同样的问题,我发现问题是钛cli指的是我的机器上没有安装的“构建工具”版本。

我已通过命令验证了这一点:

appc ti setup check

它的回归与你的相同:

 x  build tools        unsupported version 21.0.0

因此,要正确配置构建工具的版本,我运行命令:

titanium config android.buildTools.selectVersion "<YOUR VERSION>"
titanium config android.buildTools.selectedVersion "<YOUR VERSION>"

然后,重新启动cmd并再次运行build命令,它应该没问题。 如果即使在此之后问题仍然存在且构建工具保持“不受支持”,请尝试通过SDK Manager下载新版本,并使用上述相同命令进行更改。

答案 1 :(得分:1)

Android SDK一定有问题。看起来您设法通过设置每个所需工具的路径来修复其中的一些,但它仍然必须在其他地方破坏Titanium。 C:\android-sdk-win的内容是什么?您将android.executables.aapt和其他人设置为什么路径?