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();
}
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(){} }