Background-http plugin with TypeError: Cannot read property 'extend' of undefined


#1

When I use background-http plugin during running application I’ve got error:

TypeError: Cannot read property ‘extend’ of undefined

Which appears in

line with code

net.gotev.uploadservice.UploadServiceBroadcastReceiver.extend

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var application = require("application");
var data_observable = require("data/observable");
var utils = require("utils/utils");
var fileSystemModule = require("file-system");
var ProgressReceiver = net.gotev.uploadservice.UploadServiceBroadcastReceiver.extend({
    onProgress: function (uploadInfo) {
        var uploadId = uploadInfo.getUploadId();
        var task = Task.fromId(uploadId);
        var totalBytes = uploadInfo.getTotalBytes();
        var currentBytes = uploadInfo.getUploadedBytes();
        task.setTotalUpload(totalBytes);
        task.setUpload(currentBytes);
        task.setStatus("uploading");
        task.notify({ eventName: "progress", object: task, currentBytes: currentBytes, totalBytes: totalBytes });
    },

How fix it?


#2

May be the gradle dependency was not installed properly. Did you try a clean build after installing the plugin?


#3

It works :slight_smile: thx