【问题标题】:ant.properties file missing in android projectandroid项目中缺少ant.properties文件
【发布时间】:2013-08-05 06:36:30
【问题描述】:

我正在从命令行构建 android 应用程序。我需要签署我的应用程序才能在设备上安装构建的 .apk 文件。为此,我需要在 ant.properties 文件中编写 key.store 和 key.alias。但是 ant.properties 文件丢失了。所以有人知道请告诉我。

【问题讨论】:

  • 你确定你是用 ant 构建你的 apk 吗?你的项目中是 .gradle 文件吗?
  • 是的,我正在用 ant 构建。我的项目根目录中没有这样的 .grade 文件。
  • 我手动复制了一个 ant.properties 文件,然后我在这里写了 key.store 和 key.alias 来签署应用程序。当我使用 ant 构建文件时,它生成了未签名的 .apk 文件。而且在cmd中也同时报错。错误是“密钥库的值无效。它必须是单个路径”
  • 运行android update project -p .

标签: android ant


【解决方案1】:

运行android update project -p .

手动创建ant.properties文件,内容如下

# This file is used to override default values used by the Ant build system.
#
# This file must be checked in Version Control Systems, as it is
# integral to the build system of your project.

# This file is only used by the Ant script.

# You can use this to override default values such as
#  'source.dir' for the location of your java source folder and
#  'out.dir' for the location of your output folder.

# You can also use it define how the release builds are signed by declaring
# the following properties:
#  'key.store' for the location of your keystore and
#  'key.alias' for the name of the key to use.
# The password will be asked during the build when you use the 'release' target.

android.library.reference.1=###link to any external libraries####

key.alias=android_key
key.store.password==#########
config.logging=false
key.store=#########path to keystore##########
key.alias.password=######

【讨论】:

  • 这对我不起作用。当我运行 android update project -p 时,我没有得到 ant.properties 文件。什么给了?
  • @Tarun,你知道如何使用来自不同目录的ant.properties,而不是platforms/android/ stackoverflow.com/questions/29404465/…
猜你喜欢
  • 2016-05-24
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2019-09-21
  • 2011-06-18
  • 2015-03-13
相关资源
最近更新 更多