如何将AAR转换为JAR [英] How to convert AAR to JAR
本文介绍了如何将AAR转换为JAR的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
情况:
我打算使用Java库而我只有 AAR来自Maven存储库的文件,但我需要 JAR 文件。
I intend to use a Java library and I only have an AAR file from a Maven repository but I need the JAR file.
背景故事:
我试图编译一个库,但它的Gradle结构不稳定。所以我要求一个编译好的jar文件,它的开发人员从一些Maven存储库给我一个aar文件(开发人员无法编译自己的项目)。
Gradle配置很乱,它依赖于多个库而Gradle抛出了一些例外。
我试图使用它在我的IDEA IDE中,但它看不到它。库项目应该能够编译成jar文件,对吗?
问题:
如何将该AAR文件转换为JAR文件?
推荐答案
AAR 文件包含 JAR 文件和一些文件资源文件(它基本上是一个带有自定义文件扩展名的标准zip文件)。以下是转换步骤:
The AAR file consists of a JAR file and some resource files (it is basically a standard zip file with a custom file extension). Here are the steps to convert:
- 使用标准zip提取解压缩AAR文件(将其重命名为 * .zip 使其更容易)
- 在提取的文件中找到 classes.jar 文件
- 根据需要重命名并在项目中使用该jar文件
- Extract the AAR file using standard zip extract (rename it to *.zip to make it easier)
- Find the classes.jar file in the extracted files
- Rename it as you like and use that jar file in your project
这篇关于如何将AAR转换为JAR的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文