With the introduction of the QUERY_ALL_PACKAGES permission, figuring out the native library path of other apps seems to have become disabled by default, as the information is actively being filtered, see https://developer.android.com/training/package-visibility
When an app targets Android 11 (API level 30) or higher and queries for information about the other apps that are installed on a device, the system filters this information by default.
However, any app with the QUERY_ALL_PACKAGES permission can indeed use getPackageManager().getInstalledPackages() for example, to query all apps and can then use the method mentioned above, getApplicationInfo().nativeLibraryDir, to figure out the path.