Ant 使用依赖库构建 Android 项目

编程入门 行业动态 更新时间:2024-10-28 04:28:31
本文介绍了Ant 使用依赖库构建 Android 项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时送ChatGPT账号..

我有两个 Android 项目,一个共享库和一个应用程序.现在我想编译依赖于库的应用程序.在 Eclipse 中,它工作得很好.之后,我通过 git 将其上传到我的存储库并触发 Jenkins 构建这两个项目.

I have two Android projects, one shared library and the app. Now I want to compile the app with dependency to the library. In Eclipse, it works very well. After that, I upload it via git to my repository and trigger Jenkins to build both projects.

我的问题是,发生错误:sdk/android-sdk-linux/tools/ant/build.xml:440:../shared-lib 解析为没有项目的 project.properties 文件的路径".这很清楚,因为在 Jenkins 中,作业的存储方式与在 Eclipse 中不同.

My problem is, that the error occurs: "sdk/android-sdk-linux/tools/ant/build.xml:440: ../shared-lib resolve to a path with no project.properties file for project". That's clear, because in Jenkins the jobs are stored different than under Eclipse.

另一个问题是,Eclipse 将共享编译为.jar",Ant 将其编译为classes.jar"(在 sdk/android-sdk-linux/tools/ant/build.xml 中命名).

Another problem is, that Eclipse compiled the shared to ".jar" and Ant compiled it to "classes.jar" (is named in sdk/android-sdk-linux/tools/ant/build.xml).

推荐答案

我用复制文件修复了它.第一个项目构建我的 shared-lib.jar.其他项目(手机和平板电脑)将此文件(shared-lib.jar)复制到 libs-文件夹并正确构建.但是现在我在服务器和我的开发客户端上有不同的 projects.properties.这个没有签入git.

I fixed it with copy files. The first project builds my shared-lib.jar. The other projects (phone and tablet) copy this file (shared-lib.jar) to there libs-folder and build correctly. But now I have different projects.propertieson the server and my dev-client. This one is not checked in into git.

这篇关于Ant 使用依赖库构建 Android 项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

更多推荐

[db:关键词]

本文发布于:2023-04-20 10:22:13,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/982152.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:项目   Ant   Android

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!