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

Android SDK 29 support #4926

Closed KristianDD closed 5 years ago

KristianDD commented 5 years ago

Is your feature request related to a problem? Please describe. NativeScript should be able to build applications with Android SDK29

Describe the solution you'd like The Android SDK29 should be chosen by default if available on the machine.

Describe alternatives you've considered No alternatives

Additional context There are currently two places where we keep the compatible Android SDK versions - NS CLI and NS Doctor. This makes the update difficult and no straight forward. There is also a lot of repetition of code in android-tools-info modules inside the CLI and NS Doctor. For future updates it will be beneficial to extract the logic at one place.

If the targeted device is APK Level 29(Android 10) the application should use the next version of NativeScript Adnroid Runtime!

Acceptance Criteria Valid values for --compileSdk are >=28. (should be installed) Valid values for --sdk are >= 17 <=29 (corresponds to targetSdk and not mandatory to be installed) Valid Android build tools on the machine are >=23 (should be installed)

rosen-vladimirov commented 5 years ago

Due to issues with Android Runtime when building the applications with Android SDK 29 and running them on devices (emulators) with SDK 29 that are fixed in Android Runtime (tns-android package) 6.1.0, the following logic is implemented in CLI:

SDK Installed tns-android < 6.1.0 tns-android 6.1.0 or later
Android SDK 28 and 29 CLI will use SDK 28 CLI will use SDK 29
Android SDK 28 CLI will use SDK 28 CLI will use SDK 28
Android SDK 29 CLI will not allow build and throw an error CLI will use SDK 29

Description of the table:

endarova commented 5 years ago

In case you have only Android SDK 29 installed, and you are still using Android Runtime (tns-android) before 6.1.0 there is not descriptive error that this combination is not supported

JamesPJ commented 4 years ago

In case you have only Android SDK 29 installed, and you are still using Android Runtime (tns-android) before 6.1.0 there is not descriptive error that this combination is not supported

I'm bit confused with the statement there is not descriptive error that this combination is not supported.

I'm having NS 5.4 and the app built on angular 4. But, if I build the app with taregetSDK 29. The installed app start crashing.

Also I've tried upgrading to latest NativeScript version. But, I noticed it is required to have the latest version of Angular. And my code needs lot of modificatons. Let me know is there any easy migration path if it is mandatory to have the latest NS cli.

jamescodesthings commented 3 years ago

If anyone ends up here because they have a build still based on 5.4 they have to support whilst updating is underway I found that the crash on startup issue is https://github.com/NativeScript/android-runtime/issues/1458 which was not applied to the 5.x branches.

You can check out android-runtime at the version you need and cherry-pick the commit in to produce a build of 5.4.0 that works on SDK level 29.

NathanaelA commented 3 years ago

@jamescodesthings - NS 5 is several years old. If you have a support contract with nStudio, we would be willing to build you a custom version -- However, you should also try using a NS 6.x runtime with your NS5 app, it probably will work, most the time they are actually backwards compatible...

leena-bhise commented 3 years ago

@JamesPJ, I'm facing the same issue. Is this issue resolved if yes, So let me know what steps you follow for resolved this issue?

JamesPJ commented 3 years ago

@leena-bhise Yes, but I had to upgrade to NS{6}

leena-bhise commented 3 years ago

@JamesPJ, I also upgraded to NS{6} and follow the steps below:

but still facing the issue. Let me know if I'm missing something.

JamesPJ commented 3 years ago

@leena-bhise I'm not sure what issue you are facing. But, I had faced issue with certain cli versions. Below are my current cli versions.

tns-android has 6.5.3 version
tns-ios has 6.5.2 version