Comments (5)
more detail
from android-plugin-framework.
java.lang.ClassCastException: AAAA cannot be cast to AAAA
at android.app.LoadedApk$ServiceDispatcher.doConnected(LoadedApk.java:1223)
at android.app.LoadedApk$ServiceDispatcher$RunConnection.run(LoadedApk.java:1240)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5417)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
from android-plugin-framework.
这是因为在插件生命周期之外持有了插件对象的引用。就像内容泄露一样。这种情况框架感知不到。所以在热更新的时候这些引用清理不了。举个简单例子:宿主Activity中定义了一个成员变量,指向了插件中的一个对象。然后插件热更新完成后,这个宿主的Activity中的那个成员变量仍然是指向上个版本插件中的对象。这种情况框架是探测不到的。所以应该尽可能将插件当成整体功能使用,而不是看做成代码片段来使用。
from android-plugin-framework.
@limpoxe 所以我现在做的这种只取代码片段的插件化其实是违背的初衷了么,或者说或许我应该换种方案去实现嘛= =
from android-plugin-framework.
也不能说完全是违背初衷。我说的是尽可能的自律和绕行、使用标准的app之间的交互方式进行交互。但是不排除实际的场景中确实有特殊需求。所以框架中才会提供对控件级插件、fragment插件以及local service的支持。但是对这几种用法,也是要求尽可能不要在宿主中直接访问和获取这些对象。而是仅仅在宿主中提供一个显示区域而已,其他的东西全部收敛在插件组件内。如果确实要发生交叉访问,也尽量使用消息来解藕。
from android-plugin-framework.
Related Issues (20)
- 启动直接崩溃问题 HOT 1
- 宿主调用独立插件的Fragment报ClassCastException
- com.google.android.gms不是插件包名
- 支持安卓12+吗 HOT 1
- 需要kts版本的教程 HOT 1
- 安卓14兼容问题 HOT 1
- android 14 foregroundServiceType not supported
- 这个支付谷歌和facebook吗?
- 宿主app 不能开启 minifyEnabled true 混淆
- 能用来启动uiautomator2单元测试项目吗
- 插件apk 是否可以打包证书jks,保持插件自己的包名和签名?不同于宿主包名和签名? HOT 1
- 支持androidx吗 HOT 2
- studio4.0.1版本下,androidx 在SDK初始化报错 HOT 2
- 独立apk 安装完毕, 打开不了 HOT 4
- 有没有办法让宿主和插件用同一个applicationID HOT 1
- 请更新支持 Android 12
- 插件无法使用显示在应用上层特性 HOT 3
- 成功安装之后,查询列表也可以顺利得到安装包名,但是无法打开 HOT 1
- 能否过 Google Play 市场?
- 为什么集成不了?也没有Demo吗? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from android-plugin-framework.