Reputation: 45
I tried to build Nativescript --release on android but failed. This is debug result:
* What went wrong:
A problem was found with the configuration of task ':packageF0F1F2Release'.
> File 'D:\NativeScript\key' specified for property 'signingConfig.storeFile' is not a file.
I cant find any guide to resolve this using nativescript with CLI. I can build using android studio but I prefer to use CLI. I followed this Command with nativescript v 2.52 , tns-core-module 2.51 and tns-android 2.50
┌─────────┬───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ Usage │ Synopsis │
│ General │ $ tns build android [--compileSdk <API Level>] [--key-store-path <File Path> --key-store-password <Password> --key │
│ │ -store-alias <Name> --key-store-alias-password <Password>] [--release] [--static-bindings] [--copy-to <File Path>] │
└─────────┴───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
There is no problem when building debug.apk on emulator. Thank you.
Upvotes: 2
Views: 1440
Reputation: 2173
Creating Release build require 2 steps :
Create keystore file for release
Generate release build with the help of keystore
Create keystore file for release
keytool -genkey -v -keystore file/location/where/you/want/to/save/appkeystore_ks.jks -keyalg RSA -keysize 2048 -validity 10000 -alias YourApplicatioNameAlias
Ref : https://developer.android.com/studio/publish/app-signing.html#signing-manually
Generate release build with the help of keystore
tns build android --release --key-store-path /keystore/file/location/appkeystore_ks.jks --key-store-password thepassword --key-store-alias YourApplicatioNameAlias --key-store-alias-password thepassword
Ref : https://docs.nativescript.org/publishing/publishing-android-apps
Regards.
Upvotes: 3