How do I ship an Android Library (aar) with remote dependencies (gradle)?

孤者浪人 提交于 2019-11-28 10:55:56

try using the transitive attribute:

compile ('group_id:artifact_id:version_name@aar'){
    transitive = true
}

you can check this link:

Transitive dependencies not resolved for aar library using gradle

you have to create a POM file as follows:

<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <modelVersion>4.0.0</modelVersion>
  <groupId>com.sprezzat</groupId>
  <artifactId>app</artifactId>
  <version>1.0.0</version>
  <packaging>aar</packaging>
  <dependencies>
    <dependency>
      <groupId>com.bugsense.trace</groupId>
      <artifactId>bugsense</artifactId>
      <version>3.6</version>
      <scope>compile</scope>
    </dependency>
   </dependencies>
</project>

and deploy it on maven.

After that, you can define it in your android application build.gradle config like this:

compile ('com.somepackage:LIBRARY_NAME:1.0.0@aar'){
    transitive=true
}
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!