Appcelerator on Windows: No valid Android SDK Targ

2019-07-25 06:48发布

问题:

I'm trying to run an app on my Samsung Galaxy S6 installed with Marshmallow 6.0 in Appcelerator. I have downloaded Android Studio and used the SDK Manager to download the SDK for the OS. However, when trying to run my code, the console outputs these errors:

[ERROR] : No valid Android SDK targets found.
[ERROR] : Please download an Android SDK target API level 23 or newer from the Android 
          SDK Manager.

I tried uninstalling the API level 23 for Marshmallow 6.0 and reinstalling it directly through the manager rather than through installation of the studio, but this did not fix the issue. Appcelerator is able to detect my device, and developer mode as well as USB debugging are enabled on my S6.

How do I get Appcelerator to accept the SDK target API level 23?

回答1:

To use the Android SDK with Studio, the path to the SDK must be set in the Preferences dialog.

Open the Preferences dialog:

On Mac OS X, from the menu bar, select Appcelerator Studio > Preferences.

On Windows, from the menu bar, select Window > Preferences.

In the Preferences dialog, navigate to Studio > Platforms > Android SDK.

Set your Android SDK path. Enter the path to your Android SDK in the Android SDK Home textbox or click the Configure button to navigate to the SDK directory.

Select your default Android SDK. Select a Google APIs item from the Default Android SDK drop-down menu.

Reference Link: Link



回答2:

I have had the same problem, probably after Java was updated or because of Android SDK update (i'm not sure yet).

I managed to solve this problem by entering this in the CLI to select a specific Android SDK to build:

ti config android.buildTools.selectedVersion 23.0.3

Note that this is just a temporary solution to get going, but you might want to update this to a newer SDK version in time.

Edit: Best solution (on Windows): Go to Preferences > Studio > Platforms > Android. Click "Install SDK" and select/install Android 6.0 SDK.

Update: See this topic to update to Android 6.0 SDK