Comments (2)
像这样的问题,对于shadow来说首先要在AOSP的系统上测试复现。因为shadow主要是立足于公开api实现的。确实有原版系统上没问题,但是到了一些oem系统上不兼容的情况。
我最近手边没有电脑适合测试这个问题。
注意到not instance of 'Reference: android.app.Activity'
这样的报错。因为shadow处理的插件中是不会有android.app.Activity这个类型出现的。所有它出现就说明这里发生了超出Java范畴的问题。一般就是AOT相关实现造成的了。我的猜测是系统有私有的逻辑,认为我们的插件activity不可能不是android.app.Activity,所有直接把它作为android.app.Activity处理了。但我还猜不出来系统是根据什么推测的。如果只有某几个用例会复现问题,那可能是一些系统API造成的。可能是某个API我们是在Context类型上调用的,但你测试的系统上是在Activity类型上实现的,并且还是AOT实现的,所以它认为传来的this应该是个android.app.Activity。如果是这种情况,又非要兼容的话,我们就得看看改为在宿主container activity上调用可否满足需求了。
这种AOT实现的行为在debug版APP上不生效是我可以确定的,有经验的场景。应该和R8之类的没有关系。
from shadow.
可以在 AVD android13(google play) 上复现
from shadow.
Related Issues (20)
- NoSuchMethodException: com.android.tools.apk.analyzer.BinaryXmlParser.decodeXml 错误 HOT 3
- transformClassesWithShadowTransformForPluginDebug执行时卡住 HOT 1
- Unsupported class loader HOT 2
- 关于插件uuid的设计问题 HOT 9
- 多插件运行时崩溃问题 HOT 10
- PluginLoaderImpl类加载器出现java.lang.LinkageError
- 在插件中使用packageManager.queryIntentActivities(@NonNull Intent intent, int flags) HOT 7
- 使用shadow反射插件资源时出现异常 HOT 2
- onNewIntent可能丢失数据
- 崩溃必现 android.util.SuperNotCalledException: Activity {com.xx.act.DefaultContainerActivity} did not call through to super.onCreate() HOT 1
- 替换add和findFragmentByTag等调用,给插件fragment的tag都加个前缀,是否可行?@shifujun
- 这样开发出来的app能上google play? HOT 1
- 想将android.content.res.TypedArray#getDrawable hook住,但是编译报错 HOT 2
- 插件中SO库更新问题
- 关于仿写插件访问sample-host-lib中HostAddPluginViewContainerHolder的疑问
- 升级com.google.android.material:material到1.11.0后编译报错 HOT 1
- 无法在插件进程启动Service
- getResource 的问题。
- Android 15 Beta版本 Sample Demo 启动插件稳定崩溃: java.lang.RuntimeException: AssetManager has been closed HOT 3
- 首次安装耗时较长 HOT 2
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 shadow.