2016-11-23 3 views
0

Это ошибка я получаю после установки плагина и геолокации ngCordova:ионную: Не удалось создать экземпляр модуля ngCordova

E/AndroidProtocolHandler: Unable to open asset URL: file:///android_asset/www/lib/ngCordova/dist/ng-cordova.js 
D/JsMessageQueue: Set native->JS mode to OnlineEventsBridgeMode 
E/ConnectivityManager.CallbackHandler: callback not found for RELEASED message 
I/chromium: [INFO:CONSOLE(17922)] "Uncaught Error: [$injector:modulerr] Failed to instantiate module restaurant due to: 
      Error: [$injector:modulerr] Failed to instantiate module ngCordova due to: 
      Error: [$injector:nomod] Module 'ngCordova' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument. 
      http://errors.angularjs.org/1.5.3/$injector/nomod?p0=ngCordova 

Я запустить следующие команды:

C:\Users\G\takeaway>ionic plugin add cordova-plugin-geolocation 
Fetching plugin "cordova-plugin-geolocation" via npm 
Installing "cordova-plugin-geolocation" for android 
Fetching plugin "cordova-plugin-compat" via npm 
Installing "cordova-plugin-compat" for android 

C:\Users\G\takeaway>bower install ngCordova 
bower      invalid-meta for:C:\Users\G\takeaway\bower.json 
bower      invalid-meta The "name" is recommended to be lowercase, can contain digits, dots, dashes 
bower ionic#1.3.2    cached https://github.com/driftyco/ionic-bower.git#1.3.2 
bower ionic#1.3.2    validate 1.3.2 against https://github.com/driftyco/ionic-bower.git#1.3.2 
bower ngCordova#*    cached https://github.com/driftyco/ng-cordova.git#0.1.27-alpha 
bower ngCordova#*    validate 0.1.27-alpha against https://github.com/driftyco/ng-cordova.git#* 
bower ionic#1.3.2    install ionic#1.3.2 
bower       skipped ionic was not installed because there is already a non-bower directory with that name in the components directory (www\lib\ionic). You can force installation with --force. 
ionic#1.3.2 ..\AppData\Local\bower\cache\packages\75785deacc09255f971c33542b04c50a\1.3.2 
├── angular#1.5.3 
├── angular-animate#1.5.3 
├── angular-sanitize#1.5.3 
└── angular-ui-router#0.2.13 

C:\Users\G\takeaway> 

Я включаю файл в соответствии с документами. Я также включает модуль в моем коде:

var app = angular.module('restaurant', ['ionic', 'ngCordova', 'firebase']); 

Файлы ngCordova присутствуют в этом месте:

C:\Users\G\takeaway\www\lib\ngCordova\dist 

Вот мой код: enter image description here

ответ

1

Я получил это исправлено. При копировании каталога ngCordova:

C:\Users\G\takeaway\platforms\android\assets\www\lib 
Смежные вопросы