vaenow / cordova-plugin-app-update

App updater for Cordova/PhoneGap
MIT License
299 stars 146 forks source link

Unknown provider: $cordovaAppUpdateProvider #19

Closed micpape closed 7 years ago

micpape commented 7 years ago

Hi to all,

after installing the plugin ('cordova plugin add cordova-plugin-app-update --save') I'll try yo use it but unfotunately something goes wrong.

In my 'controller.js' I've wrote this simple code:

.controller('UpdateappCtrl', function($scope, apiServerAddress, AppUpdate) {

     $scope.updateTest = function() {
    var updateUrl = apiServerAddress+'/../uploads/version.xml';

    window.AppUpdate.checkAppUpdate(
            function(){
                console.log('ok. Successfully updated app')
            },function(){
                console.error('Error updating app')
            },
            updateUrl
        );
})

Unfotunately I got this error: Unknown provider: $cordovaAppUpdateProvider

In the same project I use successfully the following plugins: cordova-plugin-app-update 1.3.9 "AppUpdate" cordova-plugin-appversion 1.0.0 "App Version" cordova-plugin-camera 2.2.0 "Camera" cordova-plugin-compat 1.0.0 "Compat" cordova-plugin-file 4.2.0 "File" cordova-plugin-whitelist 1.2.2 "Whitelist" phonegap-plugin-barcodescanner 6.0.2 "BarcodeScanner"

Any ideas ?

Thank you in advance

   mic
vaenow commented 7 years ago

$cordovaAppUpdateProvider seems like there are some issues in your framework.

Please paste the full error stacktrace about the Unknown provider

micpape commented 7 years ago

at first thank you for you quick reply.

Here the full error messages coming from Chrome:

ionic.bundle.js:26799 Error: [$injector:unpr] Unknown provider: AppUpdateProvider <- AppUpdate <- UpdateappCtrl http://errors.angularjs.org/1.5.3/$injector/unpr?p0=AppUpdateProvider%20%3C-%20AppUpdate%20%3C-%20UpdateappCtrl at ionic.bundle.js:13443 at ionic.bundle.js:17793 at Object.getService [as get] (ionic.bundle.js:17946) at ionic.bundle.js:17798 at getService (ionic.bundle.js:17946) at injectionArgs (ionic.bundle.js:17970) at Object.instantiate (ionic.bundle.js:18012) at $controller (ionic.bundle.js:23417) at Object.self.appendViewElement (ionic.bundle.js:59908) at Object.render (ionic.bundle.js:57901)

vaenow commented 7 years ago

This url you pasted is detailed enough.

http://errors.angularjs.org/1.5.3/$injector/unpr?p0=AppUpdateProvider%20%3C-%20AppUpdate%20%3C-%20UpdateappCtrl

try your best 👍