  We formulate a general framework to study the flow of the electron liquid in
two dimensions past a random array of impenetrable obstacles in the presence of
a magnetic field. We derive a linear-response formula for the resistivity
tensor $\hat\rho$ in hydrodynamics with obstacles, which expresses $\hat\rho$
in terms of the vorticity and its harmonic conjugate, both on the boundary of
obstacles. In the limit of rare obstacles, in which we calculate $\hat\rho$,
the contributions of the flow-induced electric field to the dissipative
resistivity from the area covered by the liquid and the area inside obstacles
are shown to be equal to each other. We demonstrate that the averaged electric
fields outside and inside obstacles are rotated by Hall viscosity from the
direction of flow. For the diffusive boundary condition on the obstacles, this
effect exactly cancels in $\hat\rho$. By contrast, for the specular boundary
condition, the total electric field is rotated by Hall viscosity, which means
the emergence of a Hall-viscosity-induced effective -- proportional to the
obstacle density -- magnetic field. Its effect on the Hall resistivity is
particularly notable in that it leads to a deviation of the Hall constant from
its universal value. We show that the applied magnetic field enhances
hydrodynamic lubrication, giving rise to a strong negative magnetoresistance.
We combine the hydrodynamic and electrostatic perspectives by discussing the
distribution of charges that create the flow-induced electric field around
obstacles. We provide a connection between the tensor $\hat\rho$ and the
disorder-averaged electric dipole induced by viscosity at the obstacle. This
establishes a conceptual link between the resistivity in hydrodynamics with
obstacles and the notion of the Landauer dipole. We show that the
viscosity-induced dipole is rotated from the direction of flow by Hall
viscosity.
