'Nativescript for android build compile sdk errors
I setup environment for nativescript android build in 2 tries:
- at first I use auto setup through ns cli, but it fails at the end.
- after that I installed all manualy(android studio, JDK, and env. variables by ns official site instruction).
All this could lead to problems, so I let you know, how I'm getting in to the trouble.
Now I'm calling project build for android by tns build android and getting build error:
I tried to set target version manuali by flat --compileSdk 31 and got error, like a have't this compile sdk version:
But my android studio shows next things:
If I try to build using ns build android --compileSdk 30 - it starts but will fail with error at first screenshot.
I already tried to reinstall Android SDK Build-Tools and Android SDK Platform-Tools in android studio - none changes.
Any ideas how to fix this up?)
Solution 1:[1]
In project directory -> platform -> app build.gradle -> find "compileSdkVersion" inside android {} and set it value manualy:
compileSdkVersion 31
If it woun't help, try to look here:
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Mero |




