Coder Social home page Coder Social logo

Comments (2)

shifujun avatar shifujun commented on June 14, 2024

现有的代码是不支持的。Android系统在不断开发中一直在完善这个能力,所以跨apk共享资源的api不稳定。想要在大部分低版本系统上支持这个特性几乎是不可能的。实际上目前的插件Resources构造本身就是插件可以访问宿主资源的。实现就是根据api高低有两套实现。高api的实现依赖的就是aapt的资源id分区设计。但是这个开发中也能测试到很多接口在不同oem系统的不同版本上支持情况也不一致。这个特性基本上只是为系统app服务的,因为它们不需要安装到其他系统上。

所以总的来说,针对较高Android版本,具体多少忘了,差不多至少api 28以上吧。是可以利用aapt本身的资源id分区来实现跨插件复用资源的。这一方案和shadow现有代码没什么冲突,是比较容易二次开发的。

业务中实际上更多是采用Java接口共享已经从Resources中取出的资源。

from shadow.

boboZeng avatar boboZeng commented on June 14, 2024

目前我们需要拆分多个sample-app插件,但是都引用了sample-base-lib资源,如果使用pluginCompileOnly project(":sample-base-lib"),插件app里有资源引用直接打包报错,不通过pluginImplementation依赖,有什么建议方式可以让打包通过吗

from shadow.

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.