Closed zhoujunqz closed 7 years ago
Can you provide more info about the issue you've faced? Any logs and details will be great.
@Archinamon it is very strange!In android studio,i run app.It is running normally(Log is printed). But I use "assembleRelease" to produce apk,then,install to phone.Aspectj can not work(Log is not printed)!!!
it is my code
@Aspect public class DemoAspect { @Pointcut("execution( ..MainActivity.guaxiaoxi(..))") public void gua() { } @Before("gua()") public void guaxiao(JoinPoint joinPoint) { Log.e("TAG","success"); } }
public class MainActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); guaxiaoxi(); }
public void guaxiaoxi(){} }
@zhoujunqz Do you have minifyEnabled true in your project's build.gradle?
@zhoujunqz please, look at app/build/ajc-details.log file and copy the content here in comment.
@mikekudzin @Archinamon thank you.I solve the problem。 I am so stupid! There is something wrong with build.gradle obviously.
In android sutdio,I use assembleRelease prodce apk,but aspectj can not work!!!
why?