5
votes

When I attempt building a android distribution of my app through the appcelerator CLI, I get the following error: [ERROR] Target Android SDK API 23 is not installed.

I have installed android sdk api 23 but when I run appc ti info -t android it appears that Titanium is not recognizing the installed targets.

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!

Output of 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/
3
Please check ti config android. It should show android.buildTools.selectedVersion which points to your buildTools version. I'm using 25.0.1 but I have 23.0.3 installed too.miga
@miga I have checked android.buildTools.selectedVersion and it is 25.0.2 which is what I have installed.user7581786
did you try to install the buildTools 23.0.3 too?miga

3 Answers

2
votes

In you I wouldn't use and Android SDK installed for another environment, but I would set Appcelerator to use an ad-hoc Android SDK containing only the API 23 downloaded from Appcelerator Studio. In my experience giving to Titanium an SDK downloaded for another purpose (Android native, Ionic, Xamarin, ...) is never a good idea.

Appcelerator Studio Android SDK config

2
votes

I have been wrestling with this issue for about 2 days and thanks to Mauro's solution (which I would mark as correct) above posted solution was finally able to resolve it. Here is what I have speculated happened. Prior to March 1, 2017, I was able to successfully use appc on the command to build and run Appcelerator apps using the SDK downloaded via Android Studio. About 3 days ago, I did an overdue update to Android Studio (and probably the SDK) and could no longer build on the command line.

Apparently, on March 1, Google updated the Android SDK such to "deprecate" the android CLI tool, i.e. break it completely, which apparently affected a bunch of build tools that depend on it such as Unity, Ionic, etc and my guess Appcelerator.

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

The only remedy I've found so far is now using the Android SDK provided by the Appcelerator Studio, and not one installed by either Android Studio or brew as the android command like tool no longer works as expected before the update.

2
votes

I had the same problem a few days ago. The solution was to download an SDK version 24.4.1 and replace tools folder downloaded in my path: "/Users/nicolascantod/Library/android-sdk-macosx/tools"

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