NativeScript / nativescript-background-http

Background Upload plugin for the NativeScript framework
Apache License 2.0
102 stars 50 forks source link

Cannot read property 'extend' of undefined after installing the plugin #96

Closed dali-gharbi closed 6 years ago

dali-gharbi commented 6 years ago

Hi, i installed the plugin on nativescript angular envorinnement via :

tns plugin add nativescript-background-http

"tns-ios": {
  "version": "3.4.0"
},
"tns-android": {
  "version": "3.4.0"
}

when i start my app on android i get TypeError : Cannot read property 'extend' of undefined Files : "file:///data/data/appname/files/app/tns_modules/nativescript-background-http.js, line 7, column 77

lini commented 6 years ago

Hi,

Can you give us some more details about this? I tried to reproduce it using the following commands using NativeScript 3.4.0:

tns create ngapp --ng
cd ngapp/
npm i
tns platform add android
tns plugin add nativescript-background-http
tns run android

I did not see any error in the console.

The error you pasted might be caused by a missing dependency. The plugin uses an external library, which is defined in the include.gradle file:

//optional elements
dependencies {
    compile 'net.gotev:uploadservice:3.0.3'
}

For some reason this dependency was not included in your app. Review the build/deployment process and see if there are any issues there. You can also try deleting the platforms/ directory and running tns run android again after that.

dali-gharbi commented 6 years ago

Hi @lini , Indeed it was due to 'net.gotev:uploadservice:3.0.3' that was missing, after clearing platform folder and doing a fresh build the plugin worked fine and the file was uploaded. thanks for your help.