"Ant debug"输出始终不显示任何更改。如何强制 apkbuilder 构建 APK?



当我在Jenkins上键入"ant debug"时,我总是收到这样的消息:

  • [aapt]没有更改资源。R.java和Manifest.java未受影响
  • [dex]没有新的编译代码。无需将字节码转换为dalvik格式
  • [aapt]没有更改资源或资产
  • [apkuilder]没有更改。无需创建apk

来自本地计算机的同一命令针对Eclipse的同一代码不会输出上述消息。它总是从命令行中找到修改后的输入并正确地创建一个带有调试密钥的apk。我的目标是在Jenkins上创建一个带有调试密钥的APK。

知道为什么"ant debug"显示如下输出吗?有没有办法强制apkbuilder创建一个apk?

-code-gen:
[mergemanifest] No changes in the AndroidManifest files.
     [echo] Handling aidl files...
     [aidl] No AIDL files to compile.
     [echo] ----------
     [echo] Handling RenderScript files...
[renderscript] No RenderScript files to compile.
     [echo] ----------
     [echo] Handling Resources...
     [aapt] No changed resources. R.java and Manifest.java untouched.
     [echo] ----------
     [echo] Handling BuildConfig class...
[buildconfig] No need to generate new BuildConfig.
-pre-compile:
-compile:
-post-compile:
-obfuscate:
-dex:
      [dex] input:  /Users/buildmaster/.jenkins/workspace/my-ci-job-name/bin/classes
      [dex] input: /Users/buildmaster/.jenkins/workspace/my-ci-job-name/libs/Robotium.jar
      [dex] Using Pre-Dexed Robotium-764572c80737d765208bdb367579ac89.jar <- /Users/buildmaster/.jenkins/workspace/my-ci-job-name/libs/Robotium.jar
      [dex] No new compiled code. No need to convert bytecode to dalvik format.
-crunch:
   [crunch] Crunching PNG Files in source dir: /Users/buildmaster/.jenkins/workspace/my-ci-job-name/res
   [crunch] To destination dir: /Users/buildmaster/.jenkins/workspace/my-ci-job-name/bin/res
   [crunch] Crunched 0 PNG files to update cache
-package-resources:
     [aapt] No changed resources or assets. Settings_Tests_New.ap_ remains untouched
-package:
[apkbuilder] No changes. No need to create apk.
-post-package:
-do-debug:
 [zipalign] Run cancelled: no changes to input file         /Users/buildmaster/.jenkins/workspace/my-ci-job-name/bin/Settings_Tests_New-debug-unaligned.apk
     [echo] Debug Package: /Users/buildmaster/.jenkins/workspace/my-ci-job-name/bin/Settings_Tests_New-debug.apk
[propertyfile] Updating property file: /Users/buildmaster/.jenkins/workspace/my-ci-job-name/bin/build.prop
[propertyfile] Updating property file: /Users/buildmaster/.jenkins/workspace/my-ci-job-name/bin/build.prop
[propertyfile] Updating property file: /Users/buildmaster/.jenkins/workspace/my-ci-job-name/bin/build.prop
[propertyfile] Updating property file: /Users/buildmaster/.jenkins/workspace/my-ci-job-name/bin/build.prop
-post-build:
debug:
BUILD SUCCESSFUL

我做

rm -rf bin/* gen/*

然后构建

您可以在构建之前使用此命令进行清理:

蚂蚁清洁

此外,如果您希望触摸所有文件来更改时间戳,请使用此命令。然后所有文件都将重建:

触摸find .

希望这能帮助

我已经将以下目标添加到我的中心build.xml中,以使用一个命令进行清理和构建:

<target name="rebuild" depends="clean, release" />

相关内容

  • 没有找到相关文章

最新更新