Closed KristianDD closed 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:
tns-android
) before 6.1.0, CLI will use SDK 28.tns-android
) 6.1.0 or later (including pre-release versions of 6.1.0), CLI will use SDK 29.tns-android
) before 6.1.0, CLI will use SDK 28.tns-android
) 6.1.0 or later (including pre-release versions of 6.1.0), CLI will use SDK 28.tns-android
) before 6.1.0, CLI will throw an error that this combination is not supported. In this case you can either install Android SDK 28 or update your Android Runtime version to latest version (tns platform remove android && tns platform add android@latest
).tns-android
) 6.1.0 or later (including pre-release versions of 6.1.0), CLI will use SDK 29.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
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.
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.
@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...
@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?
@leena-bhise Yes, but I had to upgrade to NS{6}
@JamesPJ, I also upgraded to NS{6} and follow the steps below:
npm i
tns migrate
tns run android
but still facing the issue. Let me know if I'm missing something.
@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
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)
tns run android
should be the same as in previous version. Can add a plugin that needs build (hasManifest.xml
andinclude.gradle
but no.aar
in package). This can be emulated installingnativescript-mapbox
, deleting the.aar
file fromnode_modules/nativescript-mapbox
and then copy theManifest.xml
from here.tns build android --compileSdk 16
where SDK16 is installedtns build android --compileSdk 25
where SDK25 is not installedtns plugin build
- should clone a plugin that hasplatforms\Android\Manifest.xml
. - for example this one.tns plugin build --compileSdk 16
where SDK16 is installedtns plugin build --compileSdk 25
where SDK25 is not installed