Tns build android outputing error


i am running nativescript 2.5.2 targeting api 21, api 19 and api 22. here is the error its shows when i build android.

FAILURE: Build failed with an exception.

  • Where:
    Build file ‘C:\Users\Techadon\edu1\platforms\android\build.gradle’ line: 118

  • What went wrong:
    A problem occurred evaluating root project ‘edu1’.

Invalid revision: 26.0.0-preview

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.


Total time: 8.109 secs
Processing node_modules failed. Error: Command C:\Users\Techadon\edu1\platforms\android\gradlew.bat failed with exit code 1


@leontinashe looks like the gradle build script doesn’t recognize the 26.0.0-preview android SDK revision. By default android projects will be built with the latest available android platform SDK installed, and in your case it appears to be a preview of api 26.

You can specify the compile sdk by providing the --compileSdk flag during a build.
tns run android --compileSdk 22 for example.


thanks for the red flag, i tried only building for SDK 22 but it gave the same error and then i just uninstalled SDK 26


android has been built but i keep on having the same problem of having the stuck on the native-script splash screen when i haven’t inserted any code.


here is the infor

│ Component │ Current version │ Latest version │ Information │
│ nativescript │ 2.5.2 │ 2.5.3 │ Update available │
│ tns-core-modules │ 2.5.2 │ 2.5.2 │ Up to date │
│ tns-android │ 2.5.0 │ 2.5.0 │ Up to date │
│ tns-ios │ │ 2.5.0 │ Not installed │


I had the same error just after updating Android SDKs on my Linux PC, I just deleted the platforms folder and rebuild.
That solved the problem for me.


I had the same problem, I resolved by deleting the folder corresponding to 26.0.0 preview located in C: \ Android \ android-sdk \ build-tools