Appcelerator 未检测到 android sdk api

Appcelerator not detecting android sdk api

当我尝试通过 appcelerator CLI 构建我的应用程序的 android 分发版时,出现以下错误:[ERROR] Target Android SDK API 23 is not installed.

我已经安装了 android sdk api 23,但是当我 运行 appc ti info -t android 时,Titanium 似乎无法识别已安装的目标。

Appcelerator Command-Line Interface, version 6.0.0
Copyright (c) 2014-2017, Appcelerator, Inc.  All Rights Reserved.
Android SDK
  Android Executable          = /Users/Shared/Jenkins/Library/Android/sdk/tools/android
  ADB Executable              = /Users/Shared/Jenkins/Library/Android/sdk/platform-tools/adb
  SDK Path                    = /Users/Shared/Jenkins/Library/Android/sdk
Android NDK
  NDK Path                    = /Users/Shared/Jenkins/Library/Android/sdk/ndk-bundle
  NDK Version                 = 14.1.3816874
Android Platforms
  None
Android Add-Ons
  None
Android Emulators
  None
Genymotion Emulators
  None
Connected Android Devices
  None
Issues
  No issues detected! Your development environment should be working perfectly!

sdkmanager --list

的输出
devbuild1:bin jenkins$ ./sdkmanager --list
Warning: File /Users/Shared/Jenkins/.android/repositories.cfg could not be loaded.
Installed packages:
  Path                              | Version      | Description                    | Location
  -------                           | -------      | -------                        | -------
  add-ons;addon-g..._apis-google-15 | 3            | Google APIs                    | add-ons/addon-g...apis-google-15/
  add-ons;addon-g..._apis-google-16 | 4            | Google APIs                    | add-ons/addon-g...apis-google-16/
  add-ons;addon-g..._apis-google-17 | 4            | Google APIs                    | add-ons/addon-g...apis-google-17/
  add-ons;addon-g..._apis-google-18 | 4            | Google APIs                    | add-ons/addon-g...apis-google-18/
  add-ons;addon-g..._apis-google-19 | 20           | Google APIs                    | add-ons/addon-g...apis-google-19/
  add-ons;addon-g..._apis-google-21 | 1            | Google APIs                    | add-ons/addon-g...apis-google-21/
  add-ons;addon-g..._apis-google-22 | 1            | Google APIs                    | add-ons/addon-g...apis-google-22/
  add-ons;addon-g..._apis-google-23 | 1            | Google APIs                    | add-ons/addon-g...apis-google-23/
  add-ons;addon-g..._apis-google-24 | 1            | Google APIs                    | add-ons/addon-g...apis-google-24/
  build-tools;25.0.2                | 25.0.2       | Android SDK Build-Tools 25.0.2 | build-tools/25.0.2/
  emulator                          | 26.0.0       | Android Emulator               | emulator/
  extras;android;m2repository       | 47.0.0       | Android Support Repository     | extras/android/m2repository/
  extras;google;m2repository        | 46           | Google Repository              | extras/google/m2repository/
  ndk-bundle                        | 14.1.3816874 | NDK                            | ndk-bundle/
  patcher;v4                        | 1            | SDK Patch Applier v4           | patcher/v4/
  platform-tools                    | 25.0.4       | Android SDK Platform-Tools     | platform-tools/
  platforms;android-14              | 4            | Android SDK Platform 14        | platforms/android-14/
  platforms;android-15              | 5            | Android SDK Platform 15        | platforms/android-15/
  platforms;android-16              | 5            | Android SDK Platform 16        | platforms/android-16/
  platforms;android-17              | 3            | Android SDK Platform 17        | platforms/android-17/
  platforms;android-18              | 3            | Android SDK Platform 18        | platforms/android-18/
  platforms;android-19              | 4            | Android SDK Platform 19        | platforms/android-19/
  platforms;android-20              | 2            | Android SDK Platform 20        | platforms/android-20/
  platforms;android-21              | 2            | Android SDK Platform 21        | platforms/android-21/
  platforms;android-22              | 2            | Android SDK Platform 22        | platforms/android-22/
  platforms;android-23              | 3            | Android SDK Platform 23        | platforms/android-23/
  platforms;android-24              | 2            | Android SDK Platform 24        | platforms/android-24/
  platforms;android-25              | 3            | Android SDK Platform 25        | platforms/android-25/
  sources;android-15                | 2            | Sources for Android 15         | sources/android-15/
  sources;android-16                | 2            | Sources for Android 16         | sources/android-16/
  sources;android-17                | 1            | Sources for Android 17         | sources/android-17/
  sources;android-18                | 1            | Sources for Android 18         | sources/android-18/
  sources;android-19                | 2            | Sources for Android 19         | sources/android-19/
  sources;android-20                | 1            | Sources for Android 20         | sources/android-20/
  sources;android-21                | 1            | Sources for Android 21         | sources/android-21/
  sources;android-22                | 1            | Sources for Android 22         | sources/android-22/
  sources;android-23                | 1            | Sources for Android 23         | sources/android-23/
  sources;android-24                | 1            | Sources for Android 24         | sources/android-24/
  sources;android-25                | 1            | Sources for Android 25         | sources/android-25/
  tools                             | 26.0.0       | Android SDK Tools              | tools/

在你那里我不会使用 Android SDK 安装用于另一个环境,但我会将 Appcelerator 设置为使用仅包含 API 23 的临时 Android SDK从 Appcelerator Studio 下载。根据我的经验,为 Titanium 提供为其他目的下载的 SDK(Android 本机、Ionic、Xamarin 等)从来都不是一个好主意。

我已经为这个问题苦苦挣扎了大约 2 天,多亏了 Mauro 的解决方案(我将其标记为正确),上面发布的解决方案终于得以解决。这是我推测发生的事情。在 2017 年 3 月 1 日之前,我能够使用通过 Android Studio 下载的 SDK 在命令中成功使用 appc 来构建和 运行 Appcelerator 应用程序。大约 3 天前,我对 Android Studio(可能还有 SDK)进行了逾期更新,无法再在命令行上构建。

显然,在 3 月 1 日,Google 将 Android SDK 更新为 "deprecate" android CLI 工具,即完全破坏它,这显然影响了很多依赖于它的构建工具的数量,例如 Unity、Ionic 等以及我猜的 Appcelerator。

https://code.google.com/p/android/issues/detail?id=235455&sort=-id&colspec=ID%20Status%20Priority%20Owner%20Summary%20Stars%20Reporter%20Opened

目前我发现的唯一补救方法是使用 Appcelerator Studio 提供的 Android SDK,而不是 Android Studio 或 brew 安装的 SDK 作为android 类似命令的工具在更新前不再按预期工作。

几天前我遇到了同样的问题。解决方案是下载 SDK 版本 24.4.1 并替换在我的路径中下载的工具文件夹:“/Users/nicolascantod/Library/android-sdk-macosx/tools”

Link SDK: https://android-sdk.en.uptodown.com/mac/download