【问题标题】:Nativescript failed on build release apk success on debug.apkNativescript 在 debug.apk 上构建发布 apk 成功时失败
【发布时间】:2017-02-27 04:20:36
【问题描述】:

我尝试在 android 上构建 Nativescript --release 但失败了。 这是调试结果:

* 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.

我找不到任何指南来使用带有 CLI 的 nativescript 解决此问题。我可以使用 android studio 构建,但我更喜欢使用 CLI。我使用 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>]    │
└─────────┴───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘

在模拟器上构建 debug.apk 没有问题。谢谢。

【问题讨论】:

  • 您是否通过 --release 提供密钥库/别名/密钥库密码?

标签: android nativescript


【解决方案1】:

创建发布版本需要 2 个步骤:

  1. 为发布创建密钥库文件

  2. 借助密钥库生成发布版本

为发布创建密钥库文件

keytool -genkey -v -keystore file/location/where/you/want/to/save/appkeystore_ks.jks -keyalg RSA -keysize 2048 -validity 10000 -alias YourApplicatioNameAlias

参考:https://developer.android.com/studio/publish/app-signing.html#signing-manually

在密钥库的帮助下生成发布版本

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

参考:https://docs.nativescript.org/publishing/publishing-android-apps

问候。

【讨论】:

  • 它适用于 android sdk。
猜你喜欢
  • 1970-01-01
  • 2011-12-28
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多