[英]How to include runtimeOnly dependency in a Library project which will be consumed as aar in my Application
I want to include runtimeOnly dependency in an android library project, which has to be consumed by android app project. 我想在android库项目中包含runtimeOnly依赖项,必须由android app项目使用。 Now, when i declare runtimeOnly in android library project. 现在,当我在android库项目中声明runtimeOnly时。 Those dependencies are not available as part of apk 这些依赖项不是apk的一部分
You are using implementation
or api
? 您正在使用implementation
或api
?
According to your description you should use api
in your library project, api
will expose the dependency to the consumer
in your situation consumer
is your app project. 根据你的描述,你应该使用api
库中的项目, api
将公开依赖于consumer
在您的情况consumer
是你的应用项目。
Here is the duplicate question this may help you. 这是重复的问题,这可能对您有所帮助。 Answer1 Answer2 正确答案为 ANSWER2
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.