stephanenicolas / Quality-Tools-for-Android

1.27k stars 235 forks source link

Running Sample App Hangs Eclipse IDE #5

Closed johnfrey99 closed 11 years ago

johnfrey99 commented 11 years ago

After importing the project into eclipse via "Import Existing Maven Projects" the sample app hangs eclipse when trying to run it with "Run as Android Application". The output in the console reports "Dx warning: Ignoring InnerClasses attribute for an anonymous inner class" and eventually Eclipse runs out of memory.

I'm not sure if this is an issue with your project per se so much as an issue with the maven eclipse plugin leaving test scoped dependencies in the android classpath at runtime. I remember seeing this issue before with maven projects using robolectric tests in the same project as the main app.

Would it be possible to separate out the robolectric tests into a separate maven module and still get unit test coverage reported via cobertura or jacoco? I did some experimenting with this but failed to get the coverage to work.

stephanenicolas commented 11 years ago

Hi John,

the eclipse setup works really fine and I can't say where your error can come from. The warning about inner classes is just a warning, nothing really important.

We use profiles to clearly separate compile and tests scoped dependencies so that eclipse doesn't mess all dependencies.

Nevertheless, I think you are right. I have been wondering about separating the robolectric tests in a different project. I find this to be less convenient but that would provide a better integration within eclipse. The only problem I have with that is that this change would only be made to patch an eclipse / ADT deficiency. Everything already works pretty well on command line and in intelli J. I would really prefer to see eclipse moving in the right direction about this.

johnfrey99 commented 11 years ago

I did some more digging and it seems I'm not the only one with this issue.

https://groups.google.com/forum/?fromgroups=#!topic/robolectric/rIFAdsQNnfE https://groups.google.com/forum/?fromgroups=#!topic/robolectric/YUPisrQ-5xE http://stackoverflow.com/questions/5591811/ignoring-innerclasses-attribute-warning-is-killing-eclipse https://groups.google.com/forum/#!msg/maven-android-developers/uTz1SmKVNFE/677Woc7P1C0J

And I think this one seems the root of the problem.... https://github.com/rgladwell/m2e-android/issues/52

stephanenicolas commented 11 years ago

I plan this for next update. I am not sure whether eclipse integration is gonna get better any time soon.

johnfrey99 commented 11 years ago

Fantastic! I agree it looks like the issue in the eclipse integration has stalled and it's unfortunate that you should have to implement a workaround. I personally made the switch to IntelliJ a few months ago but there are still some members of my team who won't give up eclipse.

I really appreciate the fine work you have done on this project and you have saved me a huge amount of time figure these configurations out on my own. It also looks like you have made several nice contributions to the android maven plugin so thank you for that as well.

stephanenicolas commented 11 years ago

My pleasure John,

this project has been very interesting for us as well. We could explore a lot of new technologies and try to combine them in a meaningful way. All that's missing for us now is a better way to integrate all those tests inside sonar or any other visualization alternative.

S.

2013/4/8 John Frey notifications@github.com

Fantastic! I agree it looks like the issue in the eclipse integration has stalled and it's unfortunate that you should have to implement a workaround. I personally made the switch to IntelliJ a few months ago but there are still some members of my team who won't give up eclipse.

I really appreciate the fine work you have done on this project and you have saved me a huge amount of time figure these configurations out on my own. It also looks like you have made several nice contributions to the android maven plugin so thank you for that as well.

— Reply to this email directly or view it on GitHubhttps://github.com/stephanenicolas/Quality-Tools-for-Android/issues/5#issuecomment-16025855 .

Stéphane NICOLAS, OCTO Technology Développeur & Consultant Android / Java .......................................................... 50, Avenue des Champs-Elysées 75008 Paris +33 (0)6.26.32.34.09 www.octo.com - blog.octo.com www.usievents.com ...........................................................

stephanenicolas commented 11 years ago

Hi john,

I have updated the repo. Robolectric tests are now separate, in their own project. It's been hard to make cobertura coverage in that config, but it works now. Jacoco coverage still works like a charm for both unit and integration tests.

stephanenicolas commented 11 years ago

FYI, I could add the Robolectric tests back inside the project under tests and get working configuration within eclipse and maven. This new layout is much more standard for maven.

johnfrey99 commented 11 years ago

yeah I'm fine with that. The last of the eclipse developers on my team has left and the rest converted to Android Studio anyway. Again I appreciate all your hard work on this project.