ProgressNS / sidekick-feedback

This repository is for feedback regarding NativeScript Sidekick. Use the issues system here to submit feature requests or vote for existing ones.
45 stars 9 forks source link

APK size is huge - NativeScript 3.4.3 #149

Closed NickIliev closed 6 years ago

NickIliev commented 6 years ago

From @venkateshsj on March 23, 2018 3:48

Dear friend, we, the rest of the NativeScript community really appreciate your feedback! While we are doing all we can to take care of every issue, sometimes we get overwhelmed. Because of that, we will consider issues that are not constructive or problems that cannot be reproduced "dead". Additionally, we will treat feature requests or bug reports with unanswered questions regarding the behavior/reproduction for more than 20 days "dead". All "dead" issues will get closed.

Please, provide the details below:

Did you verify this is a real problem by searching the NativeScript Forum and the other open issues in this repo?

Yes. On Android.

Tell us about the problem

Please, ensure your title is less than 63 characters long and starts with a capital letter.

Which platform(s) does your issue occur on?

iOS/Android/Both - checking on Android currently

Please provide the following version numbers that your issue occurs with:

nativescript - 3.4.3 - Up to date tns-core-modules - 3.4.1 - Up to date tns-android - 3.4.2 - Up to date tns-ios - 3.4.1 - Not installed

"dependencies": { "nativescript-animatecss": "1.0.0", "nativescript-appversion": "1.4.1", "nativescript-cardview": "2.0.5", "nativescript-dom": "2.0.0", "nativescript-exit": "1.0.1", "nativescript-fancyalert": "1.2.0", "nativescript-floatingactionbutton": "4.1.3", "nativescript-globalevents": "1.2.1", "nativescript-loading-indicator": "2.4.0", "nativescript-pro-ui": "3.4.1", "nativescript-snackbar": "2.0.1", "nativescript-textinputlayout": "2.0.2", "nativescript-theme-core": "~1.0.4", "nativescript-toasts": "1.0.3", "tns-core-modules": "~3.4.0" }, "devDependencies": { "babel-traverse": "6.4.5", "babel-types": "6.4.5", "babylon": "6.4.5", "copy-webpack-plugin": "~4.3.0", "css-loader": "~0.28.7", "extract-text-webpack-plugin": "~3.0.2", "lazy": "1.0.11", "nativescript-dev-webpack": "~0.9.1", "nativescript-worker-loader": "~0.8.1", "raw-loader": "~0.5.1", "resolve-url-loader": "~2.2.1", "uglifyjs-webpack-plugin": "~1.1.6", "webpack": "~3.10.0", "webpack-bundle-analyzer": "^2.9.1", "webpack-sources": "~1.1.0" } }

Please tell us how to recreate the issue in as much detail as possible.

The best approach would be to get your code running in the NativeScript Playground and share the link with us, along with any additional details or steps to reproduce needed for examining the issue there.

I created a Javascript project using NativeScript SideKick. I created around 8 screens and installed on the device for testing. I checked the .apk size and it comes to around 25MB. I uncompressed to check why is it taking this much size, I found that the APK contains the following folders, (a) /assets/app/tns_modules- 40MB - Why does this folder contain the 'TypeScript' (33MB+) folder when I am not even using TypeScript? The cumulative size of remaining folders in 'tns_modules' is around 4MB.

(b) /lib - this folder is also of around 20MB

I am assuming this is why the size of the APK is swelling up. Is there any solution for this?

Is there code involved? If so, please share the minimal amount of code needed to recreate the problem.

Copied from original issue: NativeScript/NativeScript#5577

NickIliev commented 6 years ago

@venkateshsj there are multiple techniques to reduce your APK size including building in release, building with Webpack and uglify and using ABI splits for Android.

However, there should be no TypeScript files in your tns-modules folder for the JavaScript application - can you give us more details in which folder are these TS files (they are probably coming from a specific plugin)

NickIliev commented 6 years ago

From @venkateshsj on March 23, 2018 7:47

Please refer my earlier post, I have mentioned the list of plugins installed in my App and also the paths in which the 'TypeScript' folder exists. I am again mentioning the folder path below, (a) apk-uncompressed-folder/assets/app/tns_modules/TypeScript - approx 34MB (b) apk-uncompressed-folder/lib - approx 20MB

The uncompressed folder size is approx 74MB. I am sorry, but I cannot provide you with the source code or the APK.

Another reason can be that the ActionBar doesn't support icon-fonts, hence need to include the actual icons of different sizes in App_Resources, which can lead to an increase in size if an app requires to use to different icons for different functionalities in ActionBar.

NickIliev commented 6 years ago

@venkateshsj the issue seems to be related not with Sidekick but with eventually with the CLI - I am currently trying to reproduce but for now, let's continue the conversation in the original issue (sorry for the moving around)