简体   繁体   English

Nativescript在构建版本上失败,在debug.apk上成功完成apk

[英]Nativescript failed on build release apk success on debug.apk

I tried to build Nativescript --release on android but failed. 我试图在Android上构建Nativescript --release,但失败了。 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. 我找不到任何指南通过CLI使用nativescript解决此问题。 I can build using android studio but I prefer to use CLI. 我可以使用android studio进行构建,但我更喜欢使用CLI。 I followed this Command with nativescript v 2.52 , tns-core-module 2.51 and tns-android 2.50 我遵循此命令的nativescript v 2.52,tns-core-module 2.51和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. 在模拟器上构建debug.apk时没有问题。 Thank you. 谢谢。

Creating Release build require 2 steps : 创建发布版本需要2个步骤:

  1. Create keystore file for release 创建要发布的密钥库文件

  2. 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 参考: 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 参考: https : //docs.nativescript.org/publishing/publishing-android-apps

Regards. 问候。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM