ошибка 404 Ioni c Deploy Impl http://localhost/plugins/cordova-plugin-ionic/dist/common.js - PullRequest
0 голосов
/ 04 февраля 2020

Я создал приложение Ioni c 4. Все работает, но я получаю следующую ошибку всякий раз, когда я запускаю приложение в окне отладки Chrome с моего устройства android:

Failed to load resource: the server responded with a status of 404 ()
polyfills.js:3040 Unhandled Promise rejection: Error Status 404: App not found ; Zone: <root> ; Task: Promise.then ; Value: Error: Error Status 404: App not found
    at IonicDeployImpl.<anonymous> (/plugins/cordova-plugin-ionic/dist/common.js:291)
    at step (/plugins/cordova-plugin-ionic/dist/common.js:37)
    at Object.next (/plugins/cordova-plugin-ionic/dist/common.js:18)
    at fulfilled (/plugins/cordova-plugin-ionic/dist/common.js:9)
    at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invoke (polyfills.js:2749)
    at Zone.push../node_modules/zone.js/dist/zone.js.Zone.run (polyfills.js:2508)
    at polyfills.js:3247
    at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (polyfills.js:2781)
    at Zone.push../node_modules/zone.js/dist/zone.js.Zone.runTask (polyfills.js:2553)
    at drainMicroTaskQueue (polyfills.js:2959) Error: Error Status 404: App not found
    at IonicDeployImpl.<anonymous> (http://localhost/plugins/cordova-plugin-ionic/dist/common.js:291:35)
    at step (http://localhost/plugins/cordova-plugin-ionic/dist/common.js:37:23)
    at Object.next (http://localhost/plugins/cordova-plugin-ionic/dist/common.js:18:53)
    at fulfilled (http://localhost/plugins/cordova-plugin-ionic/dist/common.js:9:58)
    at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invoke (http://localhost/polyfills.js:2749:26)
    at Zone.push../node_modules/zone.js/dist/zone.js.Zone.run (http://localhost/polyfills.js:2508:43)
    at http://localhost/polyfills.js:3247:34
    at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (http://localhost/polyfills.js:2781:31)
    at Zone.push../node_modules/zone.js/dist/zone.js.Zone.runTask (http://localhost/polyfills.js:2553:47)
    at drainMicroTaskQueue (http://localhost/polyfills.js:2959:35)
api.onUnhandledError @ polyfills.js:3040

Я даже не уверен, вызывает ли это какие-либо проблемы. Единственная реальная проблема, с которой я сталкиваюсь, - когда я использую аутентификацию Google, аутентификация пользователя занимает около 3 минут. Тем не менее, это нормальное время с Facebook.

Любая помощь будет принята с благодарностью. На данный момент я тщательно искал Google для помощи с этой проблемой.

Это мой app.component

  initializeApp() {
    if (!firebase.apps.length) {
      firebase.initializeApp(firebaseConfig);
      this.platform.ready().then(() => {
        const unsubscribe = firebase.auth().onAuthStateChanged( user => {
          if (!user) {
              this.router.navigateByUrl('login');
              this.statusBar.styleDefault();
              this.splashScreen.hide();
            unsubscribe();
           }  else {
              this.router.navigateByUrl('tabs/itinerary-feed');
              this.statusBar.styleDefault();
              this.splashScreen.hide();
            unsubscribe();
          }
        });

    });
    }
  }

Добавление дополнительной информации ... это выполняется до того, как я получаю сообщение об ошибке:

Angular is running in the development mode. Call enableProdMode() to enable the production mode.

/plugins/cordova-plugin-fcm-with-dependecy-updated/www/FCMPlugin.js:6 FCMPlugin.js: is created

/plugins/cordova-plugin-fcm-with-dependecy-updated/www/FCMPlugin.js:59 FCMPlugin Ready OK

vendor.js:114077 Ionic Native: deviceready event fired after 910 ms

api.ionicjs.com/apps/588dfcc3/channels/check-device:1 Failed to load resource: the server responded with a status of 404 ()

1 Ответ

0 голосов
/ 04 февраля 2020

Похоже, что сборка прошла успешно, но какой-то плагин вызывает ошибку.

Сначала установите последние скрипты приложения:

npm install @ionic/app-scripts@latest --save-dev

Скрипты приложения отвечают за выполнение реальных задач сборки, таких как:

  • Многоядерная обработка параллельные задачи для более быстрой сборки
  • Транспортировка и связывание файлов в памяти
  • Перенос исходного кода в ES5 JavaScript

Затем удалите папку node_modules & plugin и снова запустите команду "npm install".

Обновление

initializeApp() 
{
  this.platform.ready().then(() =>  //Fired when Ionic app is ready to listen to device specific events
  {
    this.statusBar.styleDefault();
    this.splashScreen.hide();

    if (!firebase.apps.length) 
    {
      firebase.initializeApp(firebaseConfig);
      const unsubscribe = firebase.auth().onAuthStateChanged( user => {
        if (!user) {
            this.router.navigateByUrl('login');
            //unsubscribe(); //I Can't understand this piece of code. It seems unnecessary here
         }  else {
            this.router.navigateByUrl('tabs/itinerary-feed');
             //unsubscribe();//I Can't understand this piece of code. It seems unnecessary here
        }
      });

    }


  });


}
...