1.在项目中新建一个module

2.在app中关联这个module

在module中添加依赖后,无法在app下的module中使用问题的解决

3.在module中引入图片变换库

在module中添加依赖后,无法在app下的module中使用问题的解决

4.在app中使用图片变换库

在module中添加依赖后,无法在app下的module中使用问题的解决

至此,问题就出现了,在app下的activity中,无法解析到图片变换库中的内容...

解决方案:

将module中引入的图片变换库的implementation更改为compile或api,再同步,即可.

在module中添加依赖后,无法在app下的module中使用问题的解决

或者

在module中添加依赖后,无法在app下的module中使用问题的解决

为什么呢?

这是因为implementation只能用于当前的module,倘若在库中用这种方式设置依赖,我们在app的module就引用不到.但是api或compile可以.

相关文章: