UdhayaBalaji / androidannotations

Automatically exported from code.google.com/p/androidannotations
0 stars 0 forks source link

Two projects depending on a single Library Project in Eclipse #77

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
This issue is a C&P from a StackOverflow question : 
http://stackoverflow.com/questions/6580436/android-using-androidannotations-in-l
ibrary-project-eclipse

*******************

I'm making a paid/free version of my app so have a 'Library Project' that the 
two apps use.

I'm trying to use Android Annotations to clean up my code: 
http://code.google.com/p/androidannotations/

Unfortunately when I use this in my shared library project, one of my projects 
gets the error in Eclipse: The type xActivity_ is already defined 
xActivity_.java /ProjectName/.apt_generated/lib/activities/

Because Android Annotations automatically creates a new activity with an extra 
'_' in the folder .apt_generated one of the apps is allowed to create this 
file, but the other gets the error "already defined".

Is there a way in Eclipse to resolve this? Or is it a problem with the Android 
Annotations?

*********

I have an Android Libary project ProjectLib say, that has an activity using the 
AndroidAnnotations. But I have two projects that use this library, and one of 
them is able to build the project successfully. But the other has an error in 
Eclipse: The type xActivity_ is already defined xActivity_.java 
/ProjectName/.apt_generated/lib/activities/ I guess because it is trying to 
generate the same file which is already existing. Now I saw in the 'Annotation 
Processing' the path is set to '.apt_generated' should I change this for one of 
the projects? Sorry I can't be more clear! 

Original issue reported on code.google.com by py.ricau on 19 Jul 2011 at 9:40

GoogleCodeExporter commented 9 years ago
My answer :

***************

This seems to be an AndroidAnnotations bug, and should be reported on the 
dedicated bug tracker.

AndroidAnnotations wasn't designed with this use case in mind, but this is 
still a very valid use case. The problem seems to be that the activity is 
generated in the shared library project, when it should be generated in each 
depending project, am I right ?

(please answer in the bug tracker)

Original comment by py.ricau on 19 Jul 2011 at 9:42

GoogleCodeExporter commented 9 years ago
User Answer on StackOverflow:
***************

Thanks for your input, I was going to submit to bug tracker, but just wanted to 
check if it could be fixed in eclipse. Yes the activity should be generated in 
the depending project, otherwise both of the depending projects are trying to 
generate the same activity in the same location.

Original comment by py.ricau on 20 Jul 2011 at 1:23

GoogleCodeExporter commented 9 years ago
Won't fix this bug until I get more feedback and a user involved with this. I 
need a project showing the problem so that I can work on it. Bug on hold for 
now.

Original comment by py.ricau on 2 Oct 2011 at 4:51

GoogleCodeExporter commented 9 years ago
attached is an eclipse project illustrating the problem

Original comment by bsagal@gmail.com on 27 Nov 2012 at 11:05

Attachments:

GoogleCodeExporter commented 9 years ago
This project has moved to GitHub, please create a new issue there: 
https://github.com/excilys/androidannotations/issues/new

Original comment by py.ricau on 27 Nov 2012 at 11:08