HujiangTechnology / gradle_plugin_android_aspectjx

A Android gradle plugin that effects AspectJ on Android project and can hook methods in Kotlin, aar and jar file.
Apache License 2.0
3.95k stars 570 forks source link

ArrayIndexOutOfBoundsException #327

Open dupengyun opened 3 years ago

dupengyun commented 3 years ago

java.lang.ArrayIndexOutOfBoundsException: 3 at org.aspectj.weaver.ResolvedType.getMemberParameterizationMap(ResolvedType.java:970) at org.aspectj.weaver.ReferenceType.getDeclaredInterfaces(ReferenceType.java:747) at org.aspectj.weaver.ResolvedType.getDirectSupertypes(ResolvedType.java:82) at org.aspectj.weaver.ResolvedType.collectInterTypeMungers(ResolvedType.java:1398) at org.aspectj.weaver.ResolvedType.collectInterTypeMungers(ResolvedType.java:1403) at org.aspectj.weaver.ResolvedType.getInterTypeMungersIncludingSupers(ResolvedType.java:1379) at org.aspectj.weaver.ResolvedType.checkInterTypeMungers(ResolvedType.java:1450) at org.aspectj.weaver.bcel.BcelWeaver.weave(BcelWeaver.java:1677) at org.aspectj.weaver.bcel.BcelWeaver.weaveWithoutDump(BcelWeaver.java:1641) at org.aspectj.weaver.bcel.BcelWeaver.weaveAndNotify(BcelWeaver.java:1406) at org.aspectj.weaver.bcel.BcelWeaver.weave(BcelWeaver.java:1188) at org.aspectj.ajdt.internal.compiler.AjPipeliningCompilerAdapter.weaveQueuedEntries(AjPipeliningCompilerAdapter.java:514) at org.aspectj.ajdt.internal.compiler.AjPipeliningCompilerAdapter.afterCompiling(AjPipeliningCompilerAdapter.java:375) at org.aspectj.ajdt.internal.compiler.CompilerAdapter.ajc$afterReturning$org_aspectj_ajdt_internal_compiler_CompilerAdapter$2$f9cc9ca0(CompilerAdapter.java:69) at org.aspectj.org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:471) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.performCompilation(AjBuildManager.java:1051) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.performBuild(AjBuildManager.java:274) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.batchBuild(AjBuildManager.java:187) at org.aspectj.ajdt.ajc.AjdtCommand.doCommand(AjdtCommand.java:112) at org.aspectj.ajdt.ajc.AjdtCommand.runCommand(AjdtCommand.java:60) at org.aspectj.tools.ajc.Main.run(Main.java:371) at sun.reflect.GeneratedMethodAccessor2993.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) at org.codehaus.groovy.runtime.callsite.PlainObjectMetaMethodSite.doInvoke(PlainObjectMetaMethodSite.java:43) at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite$PojoCachedMethodSite.invoke(PojoMetaMethodSite.java:188) at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.call(PojoMetaMethodSite.java:53) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:135) at com.hujiang.gradle.plugin.android.aspectjx.internal.AJXTask.call(AJXTask.groovy:99) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) org.aspectj.apache.bcel.classfile.ClassFormatException: Invalid byte tag in constant pool: 19 at org.aspectj.apache.bcel.classfile.Constant.readConstant(Constant.java:139) at org.aspectj.apache.bcel.classfile.ConstantPool.(ConstantPool.java:98) at org.aspectj.apache.bcel.classfile.ClassParser.readConstantPool(ClassParser.java:186) at org.aspectj.apache.bcel.classfile.ClassParser.parse(ClassParser.java:131) at org.aspectj.weaver.bcel.Utility.makeJavaClass(Utility.java:472) at org.aspectj.weaver.bcel.UnwovenClassFile.getJavaClass(UnwovenClassFile.java:68) at org.aspectj.weaver.bcel.BcelWeaver.addClassFile(BcelWeaver.java:453) at org.aspectj.weaver.bcel.BcelWeaver.addJarFile(BcelWeaver.java:400) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.initBcelWorld(AjBuildManager.java:900) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.performBuild(AjBuildManager.java:251) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.batchBuild(AjBuildManager.java:187) at org.aspectj.ajdt.ajc.AjdtCommand.doCommand(AjdtCommand.java:112) at org.aspectj.ajdt.ajc.AjdtCommand.runCommand(AjdtCommand.java:60) at org.aspectj.tools.ajc.Main.run(Main.java:371) at sun.reflect.GeneratedMethodAccessor2993.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) at org.codehaus.groovy.runtime.callsite.PlainObjectMetaMethodSite.doInvoke(PlainObjectMetaMethodSite.java:43) at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite$PojoCachedMethodSite.invoke(PojoMetaMethodSite.java:188) at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.call(PojoMetaMethodSite.java:53) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:135) at com.hujiang.gradle.plugin.android.aspectjx.internal.AJXTask.call(AJXTask.groovy:99) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745)

AGP -4.2.1 Gradle-6.7.1 aspectx-2.0.10 kotlin -1.5.0 会直接导致这个插件项目插幢失败会导致后期的,dex文件合并异常产生空的zip文件。各位朋友奉劝插幢不要用此插件,后期维护成本会很高。建议插幢使用原生的ASM 完成

wangshujun123 commented 3 years ago

谢谢

wurensen commented 3 years ago

可以使用我修复的版本看看:https://github.com/HujiangTechnology/gradle_plugin_android_aspectjx/issues/332