pyricau / CleanAndroidCode

ALL YOUR LIB ARE BELONG TO US
173 stars 32 forks source link

Cannot add ActionBarSherlock #3

Closed ashokgelal closed 9 years ago

ashokgelal commented 11 years ago

I was playing with this project and decided to add ActionBarSherlock as: `

com.actionbarsherlock
            <artifactId>actionbarsherlock</artifactId>
            <version>4.2.0</version>
            <type>apklib</type>
       </dependency>`

to the top of cleanandroidcode/pom.xml. As soon as I do that, I get all kind of UNEXPECTED TOP-LEVEL EXCEPTION errors.

What am I doing wrong? Is ABS not suppose to work with AndroidAnnotations (properly)?

pyricau commented 11 years ago

ABS is supposed to work with AndroidAnnotations. I've seen quite a bunch of projects using both.

Could you be more specific about what you call UNEXPECTED TOP-LEVEL EXCEPTION ? Is that a runtime exception, or a compile time exception ? If it's compile time, do you get that in Eclipse, Intelli-J, Maven, Ant ? Could you paste the stacktrace ?

ashokgelal commented 11 years ago

Its a compile time exception. It looks like it has something to do with the combination of otto+dagger+AA+ABS. I couldn't figure out why after already spending hours on it. Following is the error message. I'm using IntelliJ but even doing mvn clean install from the command line gives the same error.

UNEXPECTED TOP-LEVEL EXCEPTION: [INFO] java.lang.IllegalArgumentException: already added: Landroid/support/v4/app/Watson$OnCreateOptionsMenuListener; [INFO] at com.android.dx.dex.file.ClassDefsSection.add(ClassDefsSection.java:123) [INFO] at com.android.dx.dex.file.DexFile.add(DexFile.java:163) [INFO] at com.android.dx.command.dexer.Main.processClass(Main.java:490) [INFO] at com.android.dx.command.dexer.Main.processFileBytes(Main.java:459) [INFO] at com.android.dx.command.dexer.Main.access$400(Main.java:67) [INFO] at com.android.dx.command.dexer.Main$1.processFileBytes(Main.java:398) [INFO] at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:135) [INFO] at com.android.dx.cf.direct.ClassPathOpener.processDirectory(ClassPathOpener.java:191) [INFO] at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:123) [INFO] at com.android.dx.cf.direct.ClassPathOpener.processDirectory(ClassPathOpener.java:191) [INFO] at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:123) [INFO] at com.android.dx.cf.direct.ClassPathOpener.processDirectory(ClassPathOpener.java:191) [INFO] at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:123) [INFO] at com.android.dx.cf.direct.ClassPathOpener.processDirectory(ClassPathOpener.java:191) [INFO] at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:123) [INFO] at com.android.dx.cf.direct.ClassPathOpener.processDirectory(ClassPathOpener.java:191) [INFO] at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:123) [INFO] at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:109) [INFO] at com.android.dx.command.dexer.Main.processOne(Main.java:422) [INFO] at com.android.dx.command.dexer.Main.processAllFiles(Main.java:333) [INFO] at com.android.dx.command.dexer.Main.run(Main.java:209) [INFO] at com.android.dx.command.dexer.Main.main(Main.java:174) [INFO] at com.android.dx.command.Main.main(Main.java:91) [INFO]

about 257 errors.

Do you have any sample app with CleanCodeAndroid + ABS? I've a presentation in few hours where I'll be demoing CleanCodeAndroid and desperately need it.

pyricau commented 11 years ago

It seems that pull request #4 fixes that problem, I'm not exactly sure in which way (let me know). I hope you fixed this in time for your presentation (sorry for the slow response, I'm a bit offline these days)