Android gradle plugin and NDK and .so file size

I couldn’t find the right answer anywhere. please lead me on the way…

I built this project on two different PCs.

One is a mac(m1), the other is an intel CPU PC.
Among the .so files included in the sample app project above, the largest file, libCHIPController.so, is about 340MB.
When this .so file is built as a release APK on each PC,
When I opened the apk,
On the mac it was reduced to about 25 MB, while on the intel it stayed the same at 340 MB.

I struggled a bit at first, but I found the clue.
There is no difference between the CPU of the build PC.
The cause is that the above project is built with AGP (android gradle plugin), and AGP has a basic NDK version for each version.
The AGP of the above project is 7.4 and the default NDK version is 23.1.7779620.

The above NDK version, 23.1.7779620, was installed on the Mac,
NDK 21.4.xx, 25.2.xxx were installed on the Intel PC.

Due to this difference, the size of the .so file packaged in the apk was such a difference.

As far as I know, there is no need to install NDK when building a prebuilt .so file as an apk.
In fact, the build itself doesn’t fail. However, there is only a difference in the size of the .so file.

When packaging the .so file in the android project, should the NDK version suitable for the so file be installed?
Has anyone seen a guide or document about this? am i missing something?

I also asked this question on android NDK github.
As a matter of fact, AGP seems most relevant.