skydoves / PreferenceRoom

:truck: Android processing library for managing SharedPreferences persistence efficiently and structurally.
Apache License 2.0
378 stars 26 forks source link

Myclass.class is not a preference entity. #8

Closed tsironis13 closed 5 years ago

tsironis13 commented 5 years ago

I have created Preference Component inside app module:

@PreferenceComponent(entities = Myclass.class) public interface MyComponent { void inject(MyActivity _); }

Myclass preference entity is located inside another android library module and I am getting the following build error: 'error: ==================== ERROR LOG ==================== library.package.Myclass.class is not a preference entity.'.

When I move entity class to app module my application is built successfully.

skydoves commented 5 years ago

@tsironis13 Hello! The PreferenceComponent and Entity should be inside in the same package. Because in the annotation processor, the processor can only work in one module. So If you want to separate to multi-module, you should move component together.

You can reference this posting about Creating Clean Architecture Multi-Project App. Section - Room for Data layer.