uPhyca / gradle-android-aspectj-plugin

A Gradle plugin which enables AspectJ for Android builds.
Apache License 2.0
279 stars 55 forks source link

Multi-flavour project fails: "Unknown location : SOURCE_OUTPUT" #27

Closed BrantApps closed 9 years ago

BrantApps commented 9 years ago

To replicate

    |_ debug
    |_ main
    |_ release
    |_ withGoogleMaps
    |_ withOsm

Snippet 1: Project structure exhibiting the failure

:app:compileWithGoogleMapsDebugAspectj
Internal compiler error: java.lang.IllegalArgumentException: Unknown location : SOURCE_OUTPUT at org.aspectj.org.eclipse.jdt.internal.compiler.apt.util.EclipseFileManager.getFileForOutput(EclipseFileManager.java:420)

 FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:compileWithGoogleMapsDebugAspectj'.
> Internal compiler error: java.lang.IllegalArgumentException: Unknown location : SOURCE_OUTPUT at org.aspectj.org.eclipse.jdt.internal.compiler.apt.util.EclipseFileManager.getFileForOutput(EclipseFileManager.java:420)

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 15.584 secs
BrantApps commented 9 years ago

This is directly related to the use of dagger-compiler - closing.

renaudcerrato commented 8 years ago

@BrantApps : how did you circumvented this?

BrantApps commented 8 years ago

Hi @renaudcerrato - I've documented the workaround on Stackoverflow here - let me know if it works for you. I'm afraid that the real solution here though is to remove aspectj from my Android project. The Jack & Jill complier may well completely break this sort of thing since it will go from .java to .dex directly...not via .class....the step needed for AspectJ as I know it. I think the proguard guy said that there will be ways around it but I don't know how to build such support. My next steps will be to remove AspectJ from my app I think...

renaudcerrato commented 8 years ago

@BrantApps thanks for the feedback - I'm using a fork of that plugin, and I created an issue https://github.com/Archinamon/GradleAspectJ-Android/issues/5, the guy is very responsive - hope we we'll find a solution.