Archinamon / android-gradle-aspectj

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

after produce apk,aspectj can not work #30

Closed zhoujunqz closed 7 years ago

zhoujunqz commented 7 years ago

In android sutdio,I use assembleRelease prodce apk,but aspectj can not work!!!
why?

Archinamon commented 7 years ago

Can you provide more info about the issue you've faced? Any logs and details will be great.

zhoujunqz commented 7 years ago

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

mikekudzin commented 7 years ago

@zhoujunqz Do you have minifyEnabled true in your project's build.gradle?

Archinamon commented 7 years ago

@zhoujunqz please, look at app/build/ajc-details.log file and copy the content here in comment.

zhoujunqz commented 7 years ago

@mikekudzin @Archinamon thank you.I solve the problem。 I am so stupid! There is something wrong with build.gradle obviously.