Archinamon / android-gradle-aspectj

gradle plug-in adding supports of AspectJ into Android project
Apache License 2.0
365 stars 58 forks source link

can you help me please ? #96

Open franck-serot opened 5 years ago

franck-serot commented 5 years ago

Hi Eduard, I found your work about aspectj for android studio project. I created a simple HelloWorld project with the android studio wizard. Then, I tried to follow your "step by step" described in the section "Usage" on this page https://github.com/Archinamon/android-gradle-aspectj. I created also the following Java class in order to test with 2 break points :

The program stop on the second break point but not on the first one. Can you help me to understand and solve this problem? Thank you in advance for your help. Best regards, Franck


package fr.fserot.hellojavaworld.aspectj;

import org.aspectj.lang.ProceedingJoinPoint; import org.aspectj.lang.annotation.Around; import org.aspectj.lang.annotation.Aspect;

@Aspect public class LogAspect {

@Around("execution(* fr.fserot.hellojavaworld.MainActivity.onCreate(*))")
public Object logAroundAllMethods(final ProceedingJoinPoint joinPoint) throws Throwable {
    Object obj = joinPoint.proceed();
    return obj;
}

}

franck-serot commented 5 years ago

I added some logs in the function "logAroundAllMethods". I run again my demo and the logs are produced but we can break into the advice. So, we can close this issue.

Archinamon commented 5 years ago

Hello! Try to add log output in aspect class and look, plz, for file app/build/ajc-transform.log — there should be helpful info about what's going on your application.