Subwavelength resonant nanostructures have facilitated strong light-matter interactions and tunable degrees of freedom of light, such as spectrum, polarization, and direction, thus boosting photonic applications toward light emission, manipulation, and detection. For photodetection, resonant nanostructures have enabled emerging technologies, such as light detection and ranging, spectrometers, and polarimeters, within an ultracompact footprint. However, resonant nanophotonics usually relies on nanofabrication technology, which suffers from the trade-offs between precision and scalability. Here, we first realize the self-assembly of subwavelength resonant nanostructures of metal-halide perovskites for spatial object localization and tracking. By steering crystallization along capillary corner bridges localized at edges, we achieve single crystallinity, subwavelength size, and resonant coupling between perovskite nanowires, thus leading to an angle-resolved photodetector with an angular resolution of 0.523°. Furthermore, we integrate multiple pairs of coupled resonant nanowires along two orthogonal orientations to form angle-resolved photodetector arrays for spatial light localization of both static and moving objects with an error of less than 0.6 cm. These findings create a platform for self-assembled resonant nanostructures, thus paving the way for multifunctional nanophotonic and optoelectronic devices.