I created a new NS project with ns create
and selected the plain JS template
, after that I simply ran ns run android
and the size of the APK I got is almost 30MB (29.7MB)
This is what Android Studio profiling shows (82.8% size is taken by lib
):
An excerpt from this article on NativeScript's website says,
...blank NativeScript projects for Android are ~12MB by default because they include three copies of the NativeScript runtime built for different Android CPU architectures.
But that's clearly not the case here. I tried creating a new project with hello world vue template
, the apk size was again around 30MB. Isn't that TOO MUCH? How can I get it to atleast 12MBs (as mentioned on the official website) ?
I tried ABI split mechanism as well, but even for a SEPARATE x86 build, size comes around 12.2MB. How to reduce the APK SIZE for a blank project?
This can be an Old documentation issue again.
Will make some size fixes. But using
--aab
flag will make real differenceCheck out this answer.
For nativescript-vue:
You can check package.json file of vue-cli-template you will see some packages are not used but still there.
You don't need :
https://github.com/nativescript-vue/vue-cli-template