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

Dagger tries to load NContentObserverJob on <5.0 #4147

Closed
tobiasKaminsky opened this issue Jun 14, 2019 · 11 comments
Closed

Dagger tries to load NContentObserverJob on <5.0 #4147

tobiasKaminsky opened this issue Jun 14, 2019 · 11 comments

Comments

@tobiasKaminsky
Copy link
Member

java.lang.NoClassDefFoundError: com.owncloud.android.jobs.NContentObserverJob
        at com.nextcloud.client.di.DaggerAppComponent.getMapOfClassOfAndProviderOfAndroidInjectorFactoryOf(DaggerAppComponent.java:320)
        at com.nextcloud.client.di.DaggerAppComponent.getDispatchingAndroidInjectorOfActivity(DaggerAppComponent.java:323)
        at com.nextcloud.client.di.DaggerAppComponent.injectMainApp(DaggerAppComponent.java:714)
        at com.nextcloud.client.di.DaggerAppComponent.inject(DaggerAppComponent.java:710)
        at com.owncloud.android.MainApp.attachBaseContext(MainApp.java:185)

NContentObserverJob is >=Lollipop and such it is not compiled/accessible on <5.0.

@ezaquarii do you have an idea how to fix this?
Maybe we need two different ComponentsModule, depending on API?

This needs to be fixed before 3.7.0 can be released.

@tobiasKaminsky
Copy link
Member Author

@ezaquarii
Copy link
Collaborator

ezaquarii commented Jun 14, 2019 via email

@tobiasKaminsky
Copy link
Member Author

Thanks for this great idea how to solve it.
I was somehow totally blocked and only tried to find a way how to solve it with DI.
I will release a RC4 with this fix at ~24.06., as I am on vacation next week.

@ezaquarii
Copy link
Collaborator

I will release a RC4 with this fix at ~24.06., as I am on vacation next week.

Ok, in such case I can possibly supply a proper fix for this mergable when you get back.

@ezaquarii
Copy link
Collaborator

I think that optimal solution would be to migrate it to https://developer.android.com/reference/androidx/work/WorkManager

This official library abstracts away platform differences betwen API levels. We could probably also migrate evernote tasks too.

@ezaquarii
Copy link
Collaborator

Quick fix: #4171 - I removed dagger DI.

@stale
Copy link

stale bot commented Jul 22, 2019

This request did not receive an update in the last 4 weeks. Please take a look again and update the issue with new details, otherwise the issue will be automatically closed in 2 weeks. Thank you!

@stale stale bot added the stale label Jul 22, 2019
@stale
Copy link

stale bot commented Jul 22, 2019

This request did not receive an update in the last 4 weeks. Please take a look again and update the issue with new details, otherwise the issue will be automatically closed in 2 weeks. Thank you!

@AndyScherzinger
Copy link
Member

PR exists

@stale stale bot removed the stale label Jul 22, 2019
@ezaquarii
Copy link
Collaborator

ezaquarii commented Jul 22, 2019

This PR was meant to help push 3.7.0 out of the door only. I'm ok with merging it however, as it has minimal impact anyway.

In longer term I'd rather kill this NContentObserverJob and replace it with latest WorkManager that works on all android api levels.

@tobiasKaminsky
Copy link
Member Author

In longer term I'd rather kill this NContentObserverJob and replace it with latest WorkManager that works on all android api levels.

That is a good way to go.
So we close this and #3147 is about to switch to WorkManager, so we do not forget it.

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

No branches or pull requests

3 participants