question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can't get android min API sdk version to change from 17

See original GitHub issue

Environment 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:closed
  • Created 2 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
NathanWalkercommented, Mar 18, 2022

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

1reaction
matthew798commented, May 9, 2021

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Changing API level Android Studio - Stack Overflow
1. Click View on menu bar · 2. Click Open Module Settings · 3. Open Flavors tab · 4. Choose Min Sdk version...
Read more >
<uses-sdk> | Android Developers
Lets you express an application's compatibility with one or more versions of the Android platform, by means of an API Level integer.
Read more >
Android: can't set minimum API level - Unity Forum
Hi All For some reason I can't set API levels inside Unity ... `AndroidMinSdkVersion` change the value to any minimum API level you...
Read more >
How to change Minimum SDK and Target SDK Version of
How to change Minimum SDK and Target SDK Version - Android Studio tutorial || Minimum SDK version || Target SDK versionFollow me on ......
Read more >
How to Change the API SDK Level in Android Studio?
One needs to stay very alert while making changes here. Step 1: Open your project in Android mode then go to Gradle Scripts...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found