Lottie draws the whole composition, not just the visible shapes. If the designer drew a 64 px icon in a 500 x 500 comp, the file is 500 x 500 with a lot of empty space, and your layout gets that space too.
Fix it at the source
In After Effects, use the Region of Interest tool to draw a box around the artwork, then Composition > Crop Comp to Region of Interest. Leave a few pixels so nothing is clipped when it scales or overshoots, then export again. This also makes the file easier for other developers to use.
Without After Effects, you can edit the JSON: the top-level w and h are the canvas size. Changing them alone moves the artwork off-centre, so you would also need to shift the layers, which is fiddly. An editor such as LottieFiles Lottie Creator is easier.
Fix it in the player
lottie.loadAnimation({
container,
renderer: 'svg',
path: '/icon.json',
rendererSettings: { preserveAspectRatio: 'xMidYMid slice' }
});You can also put the player in a fixed-size container with overflow hidden and scale it up with CSS transform. On Android, set scaleType to centerCrop or set a scale on the LottieAnimationView. On iOS, set contentMode to .scaleAspectFill and clip to bounds.
Player-side fixes crop the drawing, so test at every size you use. Cropping the comp is the only fix that changes the file itself.