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't debug .aj file in Android Studio #118

Open cyangibm opened 4 years ago

cyangibm commented 4 years ago

The plugin doesn't allow you to set debug breakpoint in .aj classes. If it does, how do you enable it?

jdvp commented 4 years ago

This is an IDE issue, not an issue with this plugin

cyangibm commented 4 years ago

Thanks for your reply. I guess AS doesn't support .aj files, when you enable the AspectJ plugin in the Preference menu and try to open a .aj file, it freezes.

jdvp commented 4 years ago

Oh that's strange. I have personally had luck debugging on java aspect files in the pat. If you don't have many aspects/pointcuts it may be worth it to convert to the annotation-based aspects in java rather than .aj if debugging is necessary

cyangibm commented 4 years ago

Interesting, not sure how you got it to work on your project. Would you mind sharing your Archinamon plugin app settings? I've migrated many .aj files from Eclipse project, so it's lots of rework.

jdvp commented 4 years ago

@cyangibm Sure, this sample project is what my setup looks like (I think Android Gradle 4.0.0, Gradle 6.1.1, android-gradle-aspectj 4.2.1)

https://github.com/jdvp/AndroidAspectExample

I am able to debug in Android Studio on the advices defined inside the AspectLogging.kt file. Hopefully that helps