动态加载AAR库 [英] Dynamically loading aar library

查看:146
本文介绍了动态加载AAR库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试构建一个库,并使用gradle将其动态加载到Android Studio的另一个应用程序中.

I'm trying to build a library and dynamically load it in another app in Android Studio using gradle.

我了解如何创建jar并将其转换为dex文件进行加载.但是,当我使用Gradle在Android Studio中构建库时-我没有得到一个jar-我得到了一个aar文件-我似乎无法转向或作为dex加载.

I understand how to create jars and turn them to dex files for loading. But when I build a library in Android Studio with Gradle - I don't get a jar - I get an aar file - which I can't seem to turn to or load as a dex.

如何将aar转换为dex文件?

How can I turn the aar to a dex file?

推荐答案

您可以使用动态功能交付并将AAR纳入动态功能模块中.然后,您可以将动态功能模块与核心应用程序分开安装.

You can use dynamic feature delivery and make the AAR part of the dynamic feature module. You can then install the dynamic feature module separately from the core application.

在此处了解更多信息: https://developer.android.com/guide/playcore/feature-delivery

Read more here: https://developer.android.com/guide/playcore/feature-delivery

这篇关于动态加载AAR库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆