Can't get android min API sdk version to change from 17
See original GitHub issueEnvironment
Provide version numbers for the following components (information can be retrieved by running tns info
in your project folder or by inspecting the package.json
of the project):
✔ Component nativescript has 8.0.1 version and is up to date.
✔ Component @nativescript/core has 8.0.4 version and is up to date.
✖ Component @nativescript/ios is not installed.
✔ Component @nativescript/android has 8.0.0 version and is up to date.
$ ns --version : 8.0.1
Plugins: “@freevse/nativescript-blufi”: “file:…/nativescript-plugin-seed/dist/packages/nativescript-blufi”, “@nativescript-community/ble”: “3.0.18”, “@nativescript/firebase”: “^11.1.3”, “@nstudio/nativescript-floatingactionbutton”: “^3.0.4”, “nativescript-dna-netservices”: “^1.1.0”, “rxjs”: “^6.5.5”
Describe the bug Unable to change the minimum SDK version for android.
App_Resource/app.gradle:
android {
defaultConfig {
minSdkVersion 19
targetSdkVersion 30
generatedDensities = []
}
aaptOptions {
additionalParameters "--no-version-vectors"
}
}
I alos tried adding the correct version to the AndroidManifest.xml but it also changes nothing.
ctrl+click on android.bluetooth
brings me to android-platform-17.d.ts
, when it should beandroid-platform-19.d.ts
Builds fail because I try to use android.bluetooth.BluetoothGattCallback
whic is not present in API 17, but it is in 18,
To Reproduce
Expected behavior
To reproduce, clone https://github.com/FREEVSE/app.git and ns build android
. If you try to add anything from later than API 17, build will fail.
The project should compile using the android API 19.
Additional context
I also tried with a clean project from tns create test
and I can’t get the API level to change with app.gradle.
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (2 by maintainers)
You can change your references to any API Level you’d like. We configure higher targets in our plugin workspaces since we are often developing with newer APIs but the android types ship with 17 - all the way up to latest 32 - just set to any you’d like, for example: https://github.com/NativeScript/plugins/blob/f6f4a863459e1aefdfa84ec5cd193586c1321ada/references.d.ts#L2
A little more information. I was fiddling with the gradle scripts to see if the bug was there, when I decided to check the @nativescript/type-android package in node_modules.
The lib/android.d.ts file contains
/// <reference path="./android-17.d.ts" />
. Changing this to/// <reference path="./android-17.d.ts" />
works. The project builds with types from sdk 19. This is obviously not an acceptable fix.