Nativescript: Android SplashScreen takes ~15 seconds

Created on 27 Apr 2017  Â·  18Comments  Â·  Source: NativeScript/NativeScript

Please, provide the details below:

NativeScript Template / Hello World project (created when firing tns create projectName --ng) takes around 15 seconds on Samsung Galaxy S5 before it finishes SplashScreen & moves to the List screen.

Did you verify this is a real problem by searching [Stack Overflow]yes

Tell us about the problem

I create a project with tns create projectName --ng. That creates a project with list screen & detail screen. now when I run the same on Samsung Galaxy S5, the app stays for appx 15 seconds on SplahScreen & then moves to List screen. This is not normal as splash screen should not take more than 3 seconds. Is this the problem or I am missing something here?

Which platform(s) does your issue occur on?

Android

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

  • CLI: 2.5.0

  • Cross-platform modules: 2.5.2

  • Runtime(s): tns-android 2.5.0
  • Plugin(s): I am not sure of what plugin's version I need to check here.

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

Create a project with tns create project_name --ng command.

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

android question

Most helpful comment

Hey @SandipFichadiya,

There are few aspects needed to be considered:

  • the load time will be longer on the initial load but will be less than half that time once the app is installed.

  • the results you are achieving are when you generate your debug APK executing tns run android which is not optimized for production and provides the developers with debugging techniques not needed in a release. Also, when you build in production, there is enabled Android snapshot which greatly improves the loading time.
    To build for production use the following command

tns build android --release --key-store-path <path-to-keystore-file> --key-store-password <keystore-password> --key-store-alias <alias-username> --key-store-alias-password <alias-password>

And now the loading time will be cut in half or more! For very old LG G2 the loading time dropped from 15 to 6 seconds (initial load) and less than 4 seconds for each next load. Keep in mind that this is tested on a very old phone (LG G2 with API 17) and the same APK on newer device with API23 will have initial load less than 4s and secondary load approx 2.5 seconds.

  • another thing that will further improve the performance of your Angular based application is using Webpack with AoT. Article about how to enable and use WebPack can be found here
    This said when you generate your release apk with webpack this wil furhter improve the performance.

example command to build for release with enabled webpack

npm run build-android-bundle -- --release --for-device --key-store-path D:\my-release-key.jks --key-store-password <key-pass>--key-store-alias <alias-name> --key-store-alias-password <alias-pass>
  • for a bigger Angular application using lazy loading for your components is also crucial for improving the overall performance and to lower your initial load time. Here you can find a great blog post covering this technique

All that said there are many possibilities to improve your app performance and should not be concerned about the starting time in debug mode. Track your load time for release/production and use webpack and lazy-loading for your Angular based applications.

All 18 comments

Hey @SandipFichadiya,

There are few aspects needed to be considered:

  • the load time will be longer on the initial load but will be less than half that time once the app is installed.

  • the results you are achieving are when you generate your debug APK executing tns run android which is not optimized for production and provides the developers with debugging techniques not needed in a release. Also, when you build in production, there is enabled Android snapshot which greatly improves the loading time.
    To build for production use the following command

tns build android --release --key-store-path <path-to-keystore-file> --key-store-password <keystore-password> --key-store-alias <alias-username> --key-store-alias-password <alias-password>

And now the loading time will be cut in half or more! For very old LG G2 the loading time dropped from 15 to 6 seconds (initial load) and less than 4 seconds for each next load. Keep in mind that this is tested on a very old phone (LG G2 with API 17) and the same APK on newer device with API23 will have initial load less than 4s and secondary load approx 2.5 seconds.

  • another thing that will further improve the performance of your Angular based application is using Webpack with AoT. Article about how to enable and use WebPack can be found here
    This said when you generate your release apk with webpack this wil furhter improve the performance.

example command to build for release with enabled webpack

npm run build-android-bundle -- --release --for-device --key-store-path D:\my-release-key.jks --key-store-password <key-pass>--key-store-alias <alias-name> --key-store-alias-password <alias-pass>
  • for a bigger Angular application using lazy loading for your components is also crucial for improving the overall performance and to lower your initial load time. Here you can find a great blog post covering this technique

All that said there are many possibilities to improve your app performance and should not be concerned about the starting time in debug mode. Track your load time for release/production and use webpack and lazy-loading for your Angular based applications.

Hi @NickIliev Nick!

Lars here... First, thank you very much replying to my "cry out" on issue #3515 ... I never hoped to get such a rapid response....

With regards to the above, I'll certainly get through it, I'll certainly build up a new fresh project from scratch myself, getting to know the whole webpack flow in every little detail....

I am thankful to know that in due time, I'll be able to produce an app which will start at 2.5 or 4 seconds... Even though mine is now at 13 seconds...

I have read the article of your colleague Stanimira and cloned the LazyNinjas repo locally... And built it without changing a thing, but also that (release) one does 10 - 13 seconds on my Honor 5X....

So, please, don't get angry on me, if, in the near future, I'll "harass" you with more questions!! :-)

Thanks, Lars

@NickIliev web-pack has greatly helped to reduce time :). I am closing this issue for now. However, I am facing issue in implementing webpack which I have opened here https://github.com/NativeScript/nativescript-dev-webpack/issues/137. I will be able to judge perfectly the optimization only after that. So if anything goes wrong, I'll re-open this issue.

@SandipFichadiya the url you linked is broken, forced to copy-paste the link text.

Also out of curiosity, how long does it take for you right now to load? i've been able to reduce the angular template to 4~5 secs load time.

The AoT version of tns create test --ng is 6.6s on my Samsung Galaxy S5 mini.

Well, i'm using a TP-Link model TP702C and it takes around 5.3~5.5 secs using nativescript-dev-webpack without snapshot yet.

@dxshindeo Yours have Quad with 1.4Ghz, while mine has Octa with 1.3Ghz, so it makes sense to be a bit faster, but still slow, i hope that the nativescript-dev-webpack snapshot feature does make a significant difference.

HelloWorld application from NativeScript official webpage (just an apple spinning) takes 11~12 seconds in splash screen on Asus Zenfone 5 (Android 5).

@NickIliev I created the release apk but I see no difference . The debug apk as well as the release apk is taking almost same time i.e. 13 seconds to load

@Shifs you can bundle your application with Webpack to improve the overall performance. Also if creating Angular application that loads many modules you can implement the lazy loading technique described here.

@NickIliev I tried configuring webpack as mentioned in the document , but I am getting error
Running tns prepare...
Copying template files...
â—Ÿ Installing tns-androidInstalling tns-android
TypeError: Cannot read property '0' of undefined

prepare

@Shifs you are probably trying to bundle an application that does not have Android platform added (or with deleted platforms folder). To resolve that issue follow these steps:

cd myProject
tns prepare android  // or tns platform add android
npm i nativescript-dev-webpack --save-dev
npm install
npm run start-android-bundle

@NickIliev : Thanks , the issue got solved but there is one new error

An uncaught Exception occurred on "main" thread.
java.lang.RuntimeException: Unable to create application com.tns.NativeScriptApplication: com.tns.NativeScriptException: 

Error calling module function 

Error calling module function 

ReferenceError: net is not defined
File: "file:///data/data/org.nativescript.sai/files/app/bundle.js, line: 42563, column: 23

StackTrace: 
    Frame: function:'', file:'file:///data/data/org.nativescript.sai/files/app/bundle.js', line: 42563, column: 24
    Frame: function:'__webpack_require__', file:'file:///data/data/org.nativescript.sai/files/app/vendor.js', line: 53, column: 30
    Frame: function:'', file:'file:///data/data/org.nativescript.sai/files/app/bundle.js', line: 19968, column: 38
    Frame: function:'__webpack_require__', file:'file:///data/data/org.nativescript.sai/files/app/vendor.js', line: 53, column: 30
    Frame: function:'module.exports.module.exports.module.deprecate', file:'file:///data/data/org.nativescript.sai/files/app/bundle.js', line: 102579, column: 16
    Frame: function:'__webpack_require__', file:'file:///data/data/org.nativescript.sai/files/app/vendor.js', line: 53, column: 30
    Frame: function:'', file:'file:///data/data/org.nativescript.sai/files/app/bundle.js', line: 46728, column: 16
    Frame: function:'__webpack_require__', file:'file:///data/data/org.nativescript.sai/files/app/vendor.js', line: 53, column: 30
    Frame: function:'', file:'file:///data/data/org.nativescript.sai/files/app/bundle.js', line: 46585, column: 30
    Frame: function:'__webpack_require__', file:'file:///data/data/org.nativescript.sai/files/app/vendor.js', line: 53, column: 30
    Frame: function:'webpackJsonpCallback', file:'file:///data/data/org.nativescript.sai/files/app/vendor.js', line: 25, column: 23
    Frame: function:'', file:'file:///data/data/org.nativescript.sai/files/app/bundle.js', line: 2, column: 1
    Frame: function:'require', file:'', line: 1, column: 266
    Frame: function:'', file:'file:///data/data/org.nativescript.sai/files/app/starter.js', line: 2, column: 1
    Frame: function:'require', file:'', line: 1, column: 266


ReferenceError: net is not defined
File: "<unknown>, line: 1, column: 265

StackTrace: 
    Frame: function:'', file:'file:///data/data/org.nativescript.sai/files/app/bundle.js', line: 42563, column: 24
    Frame: function:'__webpack_require__', file:'file:///data/data/org.nativescript.sai/files/app/vendor.js', line: 53, column: 30
    Frame: function:'', file:'file:///data/data/org.nativescript.sai/files/app/bundle.js', line: 19968, column: 38
    Frame: function:'__webpack_require__', file:'file:///data/data/org.nativescript.sai/files/app/vendor.js', line: 53, column: 30
    Frame: function:'module.exports.module.exports.module.deprecate', file:'file:///data/data/org.nativescript.sai/files/app/bundle.js', line: 102579, column: 16
    Frame: function:'__webpack_require__', file:'file:///data/data/org.nativescript.sai/files/app/vendor.js', line: 53, column: 30
    Frame: function:'', file:'file:///data/data/org.nativescript.sai/files/app/bundle.js', line: 46728, column: 16
    Frame: function:'__webpack_require__', file:'file:///data/data/org.nativescript.sai/files/app/vendor.js', line: 53, column: 30
    Frame: function:'', file:'file:///data/data/org.nativescript.sai/files/app/bundle.js', line: 46585, column: 30
    Frame: function:'__webpack_require__', file:'file:///data/data/org.nativescript.sai/files/app/vendor.js', line: 53, column: 30
    Frame: function:'webpackJsonpCallback', file:'file:///data/data/org.nativescript.sai/files/app/vendor.js', line: 25, column: 23
    Frame: function:'', file:'file:///data/data/org.nativescript.sai/files/app/bundle.js', line: 2, column: 1
    Frame: function:'require', file:'', line: 1, column: 266
    Frame: function:'', file:'file:///data/data/org.nativescript.sai/files/app/starter.js', line: 2, column: 1
    Frame: function:'require', file:'', line: 1, column: 266


ReferenceError: net is not defined
File: "<unknown>, line: 1, column: 265

StackTrace: 
    Frame: function:'', file:'file:///data/data/org.nativescript.sai/files/app/bundle.js', line: 42563, column: 24
    Frame: function:'__webpack_require__', file:'file:///data/data/org.nativescript.sai/files/app/vendor.js', line: 53, column: 30
    Frame: function:'', file:'file:///data/data/org.nativescript.sai/files/app/bundle.js', line: 19968, column: 38
    Frame: function:'__webpack_require__', file:'file:///data/data/org.nativescript.sai/files/app/vendor.js', line: 53, column: 30
    Frame: function:'module.exports.module.exports.module.deprecate', file:'file:///data/data/org.nativescript.sai/files/app/bundle.js', line: 102579, column: 16
    Frame: function:'__webpack_require__', file:'file:///data/data/org.nativescript.sai/files/app/vendor.js', line: 53, column: 30
    Frame: function:'', file:'file:///data/data/org.nativescript.sai/files/app/bundle.js', line: 46728, column: 16
    Frame: function:'__webpack_require__', file:'file:///data/data/org.nativescript.sai/files/app/vendor.js', line: 53, column: 30
    Frame: function:'', file:'file:///data/data/org.nativescript.sai/files/app/bundle.js', line: 46585, column: 30
    Frame: function:'__webpack_require__', file:'file:///data/data/org.nativescript.sai/files/app/vendor.js', line: 53, column: 30
    Frame: function:'webpackJsonpCallback', file:'file:///data/data/org.nativescript.sai/files/app/vendor.js', line: 25, column: 23
    Frame: function:'', file:'file:///data/data/org.nativescript.sai/files/app/bundle.js', line: 2, column: 1
    Frame: function:'require', file:'', line: 1, column: 266
    Frame: function:'', file:'file:///data/data/org.nativescript.sai/files/app/starter.js', line: 2, column: 1
    Frame: function:'require', file:'', line: 1, column: 266


    at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5406)
    at android.app.ActivityThread.-wrap2(ActivityThread.java)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1545)
    at android.os.Handler.dispatchMessage(Handler.java:102)
    at android.os.Looper.loop(Looper.java:154)
    at android.app.ActivityThread.main(ActivityThread.java:6119)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
Caused by: com.tns.NativeScriptException: 

Error calling module function 

Error calling module function 

ReferenceError: net is not defined
File: "file:///data/data/org.nativescript.sai/files/app/bundle.js, line: 42563, column: 23

StackTrace: 
    Frame: function:'', file:'file:///data/data/org.nativescript.sai/files/app/bundle.js', line: 42563, column: 24
    Frame: function:'__webpack_require__', file:'file:///data/data/org.nativescript.sai/files/app/vendor.js', line: 53, column: 30
    Frame: function:'', file:'file:///data/data/org.nativescript.sai/files/app/bundle.js', line: 19968, column: 38
    Frame: function:'__webpack_require__', file:'file:///data/data/org.nativescript.sai/files/app/vendor.js', line: 53, column: 30
    Frame: function:'module.exports.module.exports.module.deprecate', file:'file:///data/data/org.nativescript.sai/files/app/bundle.js', line: 102579, column: 16
    Frame: function:'__webpack_require__', file:'file:///data/data/org.nativescript.sai/files/app/vendor.js', line: 53, column: 30
    Frame: function:'', file:'file:///data/data/org.nativescript.sai/files/app/bundle.js', line: 46728, column: 16
    Frame: function:'__webpack_require__', file:'file:///data/data/org.nativescript.sai/files/app/vendor.js', line: 53, column: 30
    Frame: function:'', file:'file:///data/data/org.nativescript.sai/files/app/bundle.js', line: 46585, column: 30
    Frame: function:'__webpack_require__', file:'file:///data/data/org.nativescript.sai/files/app/vendor.js', line: 53, column: 30
    Frame: function:'webpackJsonpCallback', file:'file:///data/data/org.nativescript.sai/files/app/vendor.js', line: 25, column: 23
    Frame: function:'', file:'file:///data/data/org.nativescript.sai/files/app/bundle.js', line: 2, column: 1
    Frame: function:'require', file:'', line: 1, column: 266
    Frame: function:'', file:'file:///data/data/org.nativescript.sai/files/app/starter.js', line: 2, column: 1
    Frame: function:'require', file:'', line: 1, column: 266


ReferenceError: net is not defined
File: "<unknown>, line: 1, column: 265

StackTrace: 
    Frame: function:'', file:'file:///data/data/org.nativescript.sai/files/app/bundle.js', line: 42563, column: 24
    Frame: function:'__webpack_require__', file:'file:///data/data/org.nativescript.sai/files/app/vendor.js', line: 53, column: 30
    Frame: function:'', file:'file:///data/data/org.nativescript.sai/files/app/bundle.js', line: 19968, column: 38
    Frame: function:'__webpack_require__', file:'file:///data/data/org.nativescript.sai/files/app/vendor.js', line: 53, column: 30
    Frame: function:'module.exports.module.exports.module.deprecate', file:'file:///data/data/org.nativescript.sai/files/app/bundle.js', line: 102579, column: 16
    Frame: function:'__webpack_require__', file:'file:///data/data/org.nativescript.sai/files/app/vendor.js', line: 53, column: 30
    Frame: function:'', file:'file:///data/data/org.nativescript.sai/files/app/bundle.js', line: 46728, column: 16
    Frame: function:'__webpack_require__', file:'file:///data/data/org.nativescript.sai/files/app/vendor.js', line: 53, column: 30
    Frame: function:'', file:'file:///data/data/org.nativescript.sai/files/app/bundle.js', line: 46585, column: 30
    Frame: function:'__webpack_require__', file:'file:///data/data/org.nativescript.sai/files/app/vendor.js', line: 53, column: 30
    Frame: function:'webpackJsonpCallback', file:'file:///data/data/org.nativescript.sai/files/app/vendor.js', line: 25, column: 23
    Frame: function:'', file:'file:///data/data/org.nativescript.sai/files/app/bundle.js', line: 2, column: 1
    Frame: function:'require', file:'', line: 1, column: 266
    Frame: function:'', file:'file:///data/data/org.nativescript.sai/files/app/starter.js', line: 2, column: 1
    Frame: function:'require', file:'', line: 1, column: 266


ReferenceError: net is not defined
File: "<unknown>, line: 1, column: 265

StackTrace: 
    Frame: function:'', file:'file:///data/data/org.nativescript.sai/files/app/bundle.js', line: 42563, column: 24
    Frame: function:'__webpack_require__', file:'file:///data/data/org.nativescript.sai/files/app/vendor.js', line: 53, column: 30
    Frame: function:'', file:'file:///data/data/org.nativescript.sai/files/app/bundle.js', line: 19968, column: 38
    Frame: function:'__webpack_require__', file:'file:///data/data/org.nativescript.sai/files/app/vendor.js', line: 53, column: 30
    Frame: function:'module.exports.module.exports.module.deprecate', file:'file:///data/data/org.nativescript.sai/files/app/bundle.js', line: 102579, column: 16
    Frame: function:'__webpack_require__', file:'file:///data/data/org.nativescript.sai/files/app/vendor.js', line: 53, column: 30
    Frame: function:'', file:'file:///data/data/org.nativescript.sai/files/app/bundle.js', line: 46728, column: 16
    Frame: function:'__webpack_require__', file:'file:///data/data/org.nativescript.sai/files/app/vendor.js', line: 53, column: 30
    Frame: function:'', file:'file:///data/data/org.nativescript.sai/files/app/bundle.js', line: 46585, column: 30
    Frame: function:'__webpack_require__', file:'file:///data/data/org.nativescript.sai/files/app/vendor.js', line: 53, column: 30
    Frame: function:'webpackJsonpCallback', file:'file:///data/data/org.nativescript.sai/files/app/vendor.js', line: 25, column: 23
    Frame: function:'', file:'file:///data/data/org.nativescript.sai/files/app/bundle.js', line: 2, column: 1
    Frame: function:'require', file:'', line: 1, column: 266
    Frame: function:'', file:'file:///data/data/org.nativescript.sai/files/app/starter.js', line: 2, column: 1
    Frame: function:'require', file:'', line: 1, column: 266


    at com.tns.Runtime.runModule(Native Method)
    at com.tns.Runtime.runModule(Runtime.java:521)
    at com.tns.Runtime.run(Runtime.java:513)
    at com.tns.NativeScriptApplication.onCreate(NativeScriptApplication.java:19)
    at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1024)
    at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5403)
    ... 8 more

@NickIliev : Here is my webpack file

const { resolve, join  } = require("path");

const webpack = require("webpack");
const nsWebpack = require("nativescript-dev-webpack");
const nativescriptTarget = require("nativescript-dev-webpack/nativescript-target");
const CopyWebpackPlugin = require("copy-webpack-plugin");
const ExtractTextPlugin = require("extract-text-webpack-plugin");
const { BundleAnalyzerPlugin } = require("webpack-bundle-analyzer");

const { AotPlugin } = require("@ngtools/webpack");

const mainSheet = `app.css`;

module.exports = env => {
    const platform = getPlatform(env);

    // Default destination inside platforms/<platform>/...
    const path = resolve(nsWebpack.getAppPath(platform));

    const entry = {
        // Discover entry module from package.json
        bundle: `./${nsWebpack.getEntryModule()}`,

        // Vendor entry with third-party libraries
        vendor: `./vendor`,

        // Entry for stylesheet with global application styles
        [mainSheet]: `./${mainSheet}`,
    };

    const rules = getRules();
    const plugins = getPlugins(platform, env);
    const extensions = getExtensions(platform);

    const config = {
        context: resolve("./app"),
        target: nativescriptTarget,
        entry,
        output: {
            pathinfo: true,
            path,
            libraryTarget: "commonjs2",
            filename: "[name].js",
        },

        resolve: {
            extensions,

            // Resolve {N} system modules from tns-core-modules
            modules: [
                "node_modules/tns-core-modules",
                "node_modules",
            ],

            alias: {
                '~': resolve("./app")
            },
        },
        node: {
            // Disable node shims that conflict with NativeScript
            "http": false,
            "timers": false,
            "setImmediate": false,
            "fs": "empty",    


            // net: 'empty'
        },
        module: { rules },
        plugins,
    };

    if (env.snapshot) {
        plugins.push(new nsWebpack.NativeScriptSnapshotPlugin({
            chunk: "vendor",
            projectRoot: __dirname,
            webpackConfig: config,
            targetArchs: ["arm", "arm64", "ia32"],
            tnsJavaClassesOptions: { packages: ["tns-core-modules" ] },
            useLibs: false
        }));
    }

    return config;
};


function getPlatform(env) {
    return env.android ? "android" :
        env.ios ? "ios" :
        () => { throw new Error("You need to provide a target platform!") };
}

function getRules() {
    return [
        {
            test: /\.html$|\.xml$/,
            use: [
                "raw-loader",
            ]
        },
        // Root stylesheet gets extracted with bundled dependencies
        {
            test: new RegExp(mainSheet),
            use: ExtractTextPlugin.extract([
                {
                    loader: "resolve-url-loader",
                    options: { silent: true },
                },
                {
                    loader: "nativescript-css-loader",
                    options: { minimize: false }
                },
                "nativescript-dev-webpack/platform-css-loader",
            ]),
        },
        // Other CSS files get bundled using the raw loader
        {
            test: /\.css$/,
            exclude: new RegExp(mainSheet),
            use: [
                "raw-loader",
            ]
        },
        // SASS support
        {
            test: /\.scss$/,
            use: [
                "raw-loader",
                "resolve-url-loader",
                "sass-loader",
            ]
        },


        // Compile TypeScript files with ahead-of-time compiler.
        {
            test: /\.ts$/,
            loaders: [
                "nativescript-dev-webpack/tns-aot-loader",
                "@ngtools/webpack",
            ]
        }

    ];
}

function getPlugins(platform, env) {
    let plugins = [
        new ExtractTextPlugin(mainSheet),

        // Vendor libs go to the vendor.js chunk
        new webpack.optimize.CommonsChunkPlugin({
            name: ["vendor"],
        }),

        // Define useful constants like TNS_WEBPACK
        new webpack.DefinePlugin({
            "global.TNS_WEBPACK": "true",
        }),

        // Copy assets to out dir. Add your own globs as needed.
        new CopyWebpackPlugin([
            { from: mainSheet },
            { from: "css/**" },
            { from: "fonts/**" },
            { from: "**/*.jpg" },
            { from: "**/*.png" },
            { from: "**/*.xml" },
        ], { ignore: ["App_Resources/**"] }),

        // Generate a bundle starter script and activate it in package.json
        new nsWebpack.GenerateBundleStarterPlugin([
            "./vendor",
            "./bundle",
        ]),

        // Generate report files for bundles content
        new BundleAnalyzerPlugin({
            analyzerMode: "static",
            openAnalyzer: false,
            generateStatsFile: true,
            reportFilename: join(__dirname, "report", `report.html`),
            statsFilename: join(__dirname, "report", `stats.json`),
        }),

        // Angular AOT compiler
        new AotPlugin({
            tsConfigPath: "tsconfig.aot.json",
            entryModule: resolve(__dirname, "app/app.module#AppModule"),
            typeChecking: false
        }),

        // Resolve .ios.css and .android.css component stylesheets, and .ios.html and .android component views
        new nsWebpack.UrlResolvePlugin({
            platform: platform,
            resolveStylesUrls: true,
            resolveTemplateUrl: true
        }),

    ];

    if (env.uglify) {
        plugins.push(new webpack.LoaderOptionsPlugin({ minimize: true }));

        // Work around an Android issue by setting compress = false
        const compress = platform !== "android";
        plugins.push(new webpack.optimize.UglifyJsPlugin({
            mangle: { except: nsWebpack.uglifyMangleExcludes },
            compress,
        }));
    }

    return plugins;
}

// Resolve platform-specific modules like module.android.js
function getExtensions(platform) {
    return Object.freeze([
        `.${platform}.ts`,
        `.${platform}.js`,
        ".aot.ts",
        ".ts",
        ".js",
        ".css",
        `.${platform}.css`,
    ]);
}

@NickIliev I tried changing the version of nativescript-http-background to v2.5.1, but the error is same

@NickIliev : doing npm cache clean resolved the issue , but ng2 translate is not working with webpack. It gives error
ERROR Error: Uncaught (in promise): Response with status: 200 for URL: null

@Shifs glad to hear that you have resolved the initial problem! Regarding the ng2-translate with webpack - please open new issue so we could separate the different cases and focus on each one separately - also please provide the code where ng2 translate is used.

@NickIliev : I have created the issue https://github.com/ngx-translate/core/issues/608

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Was this page helpful?
0 / 5 - 0 ratings