Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change @Inject to @Autowired annotations #29

Open
Weinschenk opened this issue Jan 4, 2017 · 3 comments
Open

Change @Inject to @Autowired annotations #29

Weinschenk opened this issue Jan 4, 2017 · 3 comments

Comments

@Weinschenk
Copy link

I am struggling in the OSGi environment that annotations with @Inject do not work properly but @Autowired work.

Is it possible to change annotations?

@renarj
Copy link
Member

renarj commented Jan 4, 2017

It is very hard to change those annotations because the @Inject is needed to support Android with Guice dependency injection and does not work with @Autowired which is a spring principle. As I have not managed to get spring working on Android not sure how to help you here.

I have considered in the past forking of the codebase for the Android version which could yet be another argument to finally do this, but this is not a short-term thing unfortunately.

@Weinschenk
Copy link
Author

Thank you for the explanation. Is it possible to mix both, means adding both annotations? I just tried it with Spring and it seems to work.

As a workaround I will try to generate a spring context file without the component-scan, but creating the beans explicitly

@renarj
Copy link
Member

renarj commented Jan 6, 2017

I think a retest is needed of the Android support to see, i am unsure if that will work with double annotations. Most likely the context file will be the only solution in this case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants