Unity started using ancient Android libraries?!

This is quite strange.
I’m trying to release an update for my app, but it won’t compile for android, because of the error

package org.apache.http does not exist

That’s quite normal, because package is deprecated and removed since API 23. But then why Unity uses it? Plus, a few months ago (with slightly older unity version, now using 2019.1.8f1) everything worked. No solutions (related to Unity) exists to this problem.
After fixing it with appending useLibrary 'org.apache.http.legacy to gradle file, I’ve got another error, that Notification.setLastEventInfo() doesn’t exist. Thats from Notification library, also deprecated and removed a long time ago.

Whats happening, anyone encountered this by chance? Or will I need to rewrite all those java classes with updated libraries myself?

OK, I’ve managed to fix this.

Turns out I had unused script in my project which contained some network related obsolete API calls. Unity only showed a warning about this. The script was an old obb extractor script.