本文介绍了rinkResources true不能在Instant Apps功能上使用吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时删除!!

当我尝试缩小功能APK的大小时,我在功能Build Gradle中使用了shrinkResources true.但是它抱怨Error:Resource shrinker cannot be used for libraries.

When I try to shrink my Feature APK size, I use shrinkResources true in my feature Build Gradle.However it complaints Error:Resource shrinker cannot be used for libraries.

本文要求我们使用它 https://medium.com/jet-stories/make-your-app -instant-33855ab5d02b

This article ask us to use ithttps://medium.com/jet-stories/make-your-app-instant-33855ab5d02b

我做错什么了吗,或者Instant Apps确实不支持此操作吗?

Did I do something wrong or is this really not supported by Instant Apps?

推荐答案

根据我从本文中了解到的内容(我已经快速阅读,但仍在我的阅读列表中待定),只需要shrinkResources true即可减少APK 删除未使用的资源 Instant Apps的正式要求.我猜工具链无法确定资源是否会在库中闲置,因为最终的APK尚未构建.

From what I understand from the article (I've just read it quickly, still pending in my reading list), shrinkResources true is only needed to reduce APK size by removing unused resources, but it is not a formal requirement of Instant Apps. I guess the toolchain cannot decide if a resource will be unused in a library, as final APK is not built.

因此,如果您的项目中没有未使用的资源,应该没有问题,可以将其删除.

So, if there are no unused resources in your project, should not be a problem and could be removed.

然后,您的项目中可能有一件事是错误的(没有亲自尝试过Instant Apps,而是阅读并看到了Google IO谈话):据我了解,即时应用程序的所有模块都是APK,而不是库.因此,如果将shrinkResources true应用于APK,则应该很好.如果您的项目中有用于组装最终APK模块的库,请在此处删除shrinkResources true,然后将其保留在模块中.

Then, there is one thing that maybe is wrong in your project (without having tried Instant Apps by myself, just read and saw Google IO talks): from what I understand, all the modules of an instant app are APKs, not libraries. So, if you apply the shrinkResources true to the APKs, you should be good to go. If you have libraries in your project that are used to assemble the final APK modules, then remove shrinkResources true there, and just leave it in the modules.

这篇关于rinkResources true不能在Instant Apps功能上使用吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

1403页,肝出来的..

09-07 15:14