Comments (8)
按照这个描述,应该没能排除是“神策plugin”先把类改坏了的情况。你可以先只应用shadow plugin测试一下。
类似的情况在业务中见过。有的字节码编辑plugin采用了asm工具,编辑时不像javassist一样验证类的合法性。
如果是shadow的问题,instrument transform的实际作用不大,建议自己多研究下怎么兼容。我这边最近不太方便调试,只有手机用。
from shadow.
只应用shadow plugin就没问题,这个类不是Android的四大组件,编译过程中是否可以忽略这个错误,遇到这个exception继续执行呢?
from shadow.
忽略对某些类的处理在通用的方案上肯定是不可行的。但我相信确实存在一些类或部分代码在运行时是无用的,它们被忽略掉是没关系的。但这就要你自己二次开发了。
不过看起来问题不在shadow这,那坏掉的class在转dex时可能也有问题,proguard也不见得能放过去。如果忽略真的可行的话,也许你应该考虑从第三方库的jar中,在源头上,直接删掉有问题的类。
from shadow.
好的谢谢,我再想想处理办法
from shadow.
好的谢谢,我再想想处理办法
最近阿里互动直播SDK也存在这个问题 java.lang.RuntimeException: javassist.CannotCompileException: by javassist.bytecode.BadBytecode: (Lcom/alivc/rtc/e/b$g;Landroid/content/Context;)V in com.alivc.rtc.e.b: inconsistent stack height Index 12 out of bounds for length 12
请问有解决方案么?
from shadow.
两种方法:
1.先让shadow plugin处理,再让其他三方plugin处理,这样有风险,如果三方plugin新增了context相关的方法那就 寄
2.三方plugin提供黑白名单,可以声明对那些类不做处理(目前我是这么解决的)
from shadow.
大佬,黑白名单在哪里配置呢?
from shadow.
需要先查出来是哪个gradle plugin搞坏了类,然后由对应的gradle plugin提供黑白名单,在transform阶段不去处理黑白名单的类才行
from shadow.
Related Issues (20)
- 插件集成 nfc 功能问题 HOT 3
- throw new RuntimeException("packageArchiveInfo is NullPointException") HOT 2
- 如何通过反射调用插件中的方法并获取返回值 HOT 2
- ShadowNativeActivityDelegate.getPackageManager getMPluginActivity NullPointerException HOT 1
- NativiActivity java.lang.RuntimeException: java.lang.IllegalArgumentException: Unable to find native library main using classloade
- 宿主和插件之间的资源共享 HOT 4
- 存在转换后被调用方法未实现的问题 getOnBackInvokedDispatcher HOT 2
- gradle8适配 HOT 6
- com.tencent.shadow.plugin 这个插件最大支持的 AGP 和 Gradle 版本分别是多少?还有 compileSdk 版本? HOT 10
- 插件中使用 WorkManager 时启动插件出错 HOT 1
- 线上偶现Rejecting re-init on previously-failed class xxx,NoClassDefFoundError Class not found using the boot class loader; no stack trace available HOT 1
- gradle执行transformClassesWithShadowTransformForPluginDebug任务时卡住 HOT 6
- NoSuchMethodException: com.android.tools.apk.analyzer.BinaryXmlParser.decodeXml 错误 HOT 2
- 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
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.