谢谢火焰给你光明,但不要忘了在黑暗中替你执灯的人!——泰戈尔
安卓集成aspectj
首先要引入依赖
先在项目gradle中配置
dependencies { classpath "com.android.tools.build:gradle:4.0.1" classpath 'com.hujiang.aspectjx:gradle-android-plugin-aspectjx:2.0.10' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files }
然后在模块gradle中配置
apply plugin: 'android-aspectjx'
以及
aspectjx { exclude 'module-info.class' enabled true }
还有在最下面的依赖中加入
api 'org.aspectj:aspectjrt:1.9.5'
之后就可以使用我们的AOP了



