NativeScript / nativescript-cli

Command-line interface for building NativeScript apps
https://www.npmjs.com/package/nativescript
Apache License 2.0
1.04k stars 195 forks source link

Passing compile sdk lower than 28 fails build with tns-android@next #4052

Open endarova opened 5 years ago

endarova commented 5 years ago

CLI: 5.0.0-2018-10-16-12488 (RC) Android Runtime: 5.0.0-2018-10-23-165909-01

The new android runtime requires sdk 28. If you build such project with tns build --compileSdk 27 the build will fail with error for missing resources. We need a check in that case and warning that you cannot build project with last android runtime with sdk lower than 28.

Steps:

  1. tns create TestApp --js
  2. tns platform add android@next
  3. tns build android --compileSdk 27

FAILURE: Build failed with an exception.

dtopuzov commented 5 years ago

It is expected to fail since latest modules require sdk 28. However we can try to better handle situation with user friendly error message.

rosen-vladimirov commented 5 years ago

We can add warning when you pass --compileSdk that this will skip CLI's verification and the build may not work.

RosilBelli commented 5 years ago

My project is under the latest Nativescript version (5.3), but my app needs to run on android 5.1.

I'm trying to achieve that by running; tns run android --bundle --compileSdk 22

But I'm asked to install Android SDK 28.

How can I generate a build for the version I need? Couldn't find anything on the docs.

dtopuzov commented 5 years ago

Hi @RosilBelli,

No need to set compileSdk in this case. App you build with default options should work on all Android versions above 4.2.