Coder Social home page Coder Social logo

Comments (7)

kezong avatar kezong commented on May 28, 2024 2

首先,试用于该插件的应该是library,而不是application。
我先假设主module是library,然后主module依赖于module1, module1依赖module2;

如果module1和module2都需要合入主module中产生的aar中,则需要在主module中添加对module1以及module2的embed依赖(哪怕主module只依赖于module1, 但是module1依赖了module2,所以都需要在主module中加embed)。
而module1和module2之间的依赖关系不用修改,按照官方的implementation就行。

所有的embed关系都应该在主module中添加,不应该在子module中添加。

from fat-aar-android.

CCY0122 avatar CCY0122 commented on May 28, 2024

感谢回答。那主module添加对module2的依赖是只需要embed还是embed+compileOnly?

from fat-aar-android.

kezong avatar kezong commented on May 28, 2024

感谢回答。那主module添加对module2的依赖是只需要embed还是embed+compileOnly?

加compileOnly只是为了编码时引用到该依赖可以代码提示,并不会影响实际编译结果,如果你实际上不直接依赖该module,可以只加embed。

from fat-aar-android.

zmylls avatar zmylls commented on May 28, 2024

作者你好,还是library引用module1,module1引用module2,但是module2中引用了eventbus,okhttp等第三方,这需要特殊处理吗?另外我这里确定已经使用embed引用了所有的module,但是还有会有错误找不到符号的。

from fat-aar-android.

kezong avatar kezong commented on May 28, 2024

作者你好,还是library引用module1,module1引用module2,但是module2中引用了eventbus,okhttp等第三方,这需要特殊处理吗?另外我这里确定已经使用embed引用了所有的module,但是还有会有错误找不到符号的。

看你是否需要将eventbus和okhttp整体打包,如果需要整体打包,就需要在library中embed eventbus以及okhttp;
你可以查一下找不到的符号属于哪个module,再看看library是否有embed该module。

from fat-aar-android.

zmylls avatar zmylls commented on May 28, 2024

需要添加的module都已经使用embed,然后我这里改用了1.1.6版本能成功了。但是碰到另一个问题。我有个基础保common,其中包含Gson的引用,gradle使用的是api的方式引入。打出来的aar中有地方引用了gson,这个时候会报错,因为包中没有gson相关内容。不知道这块有没有什么建议。

目前使用的版本情况是:
gradle插件:3.4.1
gradle-wrapper: 5.1.1
fat-aar: 1.1.6
AndroidStudio: 3.4.1

from fat-aar-android.

kezong avatar kezong commented on May 28, 2024

需要添加的module都已经使用embed,然后我这里改用了1.1.6版本能成功了。但是碰到另一个问题。我有个基础保common,其中包含Gson的引用,gradle使用的是api的方式引入。打出来的aar中有地方引用了gson,这个时候会报错,因为包中没有gson相关内容。不知道这块有没有什么建议。

要么将gson通过embed一起打包,要么在app中引入aar的同时通过implementation或者api引入该gson库。

from fat-aar-android.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.