starters: [ionic v4] ionic cordova run android fails (to load resources) with any fresh starter template

Starter Type: angular Starter Template: blank, side-menu & tabs

Description:

Running ionic cordova run android in a freshly generated starter template folder will show a blank page on any device.

Using chrome remote devices tool it appears it fails to load resources:

runtime.js:1 Failed to load resource: net::ERR_FILE_NOT_FOUND
12:47:54.936 styles.js:1 Failed to load resource: net::ERR_FILE_NOT_FOUND
12:47:54.936 polyfills.js:1 Failed to load resource: net::ERR_FILE_NOT_FOUND
12:47:54.938 vendor.js:1 Failed to load resource: net::ERR_FILE_NOT_FOUND
12:47:54.938 cordova.js:1 Failed to load resource: net::ERR_FILE_NOT_FOUND
12:47:54.940 main.js:1 Failed to load resource: net::ERR_FILE_NOT_FOUND
12:47:55.021 /assets/icon/favicon.png:1 Failed to load resource: net::ERR_FILE_NOT_FOUND

My ionic info:

$ ionic info
√ Gathering environment info - done!

Ionic:

   ionic (Ionic CLI)          : 4.1.2 (C:\Users\xxx\AppData\Roaming\npm\node_modules\ionic)
   Ionic Framework            : @ionic/angular 4.0.0-beta.8
   @angular-devkit/core       : 0.7.5
   @angular-devkit/schematics : 0.7.5
   @angular/cli               : 6.1.5
   @ionic/ng-toolkit          : 1.0.8
   @ionic/schematics-angular  : 1.0.6

Cordova:

   cordova (Cordova CLI) : 7.1.0
   Cordova Platforms     : android 6.3.0
   Cordova Plugins       : cordova-plugin-ionic-keyboard 2.1.2, cordova-plugin-ionic-webview 2.1.3, (and 4 other plugins)

System:

   NodeJS : v9.9.0 (C:\Program Files\nodejs\node.exe)
   npm    : 6.1.0
   OS     : Windows 7

How to reproduce:

ionic start i4-sidemenu sidemenu --type=angular
cd i4-sidemenu
ionic cordova prepare android
ionic cordova run android --verbose

Other Information:

A base path change fixes the issue but it seems to break angular router navigation. <base href="." />

Note: It works with --live-reload: the device is able to reach the files through the network.

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 3
  • Comments: 65 (3 by maintainers)

Most upvoted comments

my solution: 1 ionic cordova platform remove android 2 ionic cordova platform add android@7.1.0 3 ionic cordova plugin remove cordova-plugin-ionic-webview 4 ionic cordova plugin add cordova-plugin-ionic-webview@latest

my solution: 1 ionic cordova platform remove android 2 ionic cordova platform add android@7.1.0 3 ionic cordova plugin remove cordova-plugin-ionic-webview 4 ionic cordova plugin add cordova-plugin-ionic-webview@latest

this fixed the problem! Please save time eyeryone and do step 1 - 2… trying every solution here and only this fix it ! 😃 Ty!

Agree this should be addressed with high priority.

@coreyhub Changing base href=“/” to base href=“./” also doesn’t work. Icons stopped loading after that.

Fix: Update cordova webview plugin by using this command –

ionic cordova plugin add cordova-plugin-ionic-webview@https://github.com/ionic-team/cordova-plugin-ionic-webview.git#wip-set-web-root

I found a fix and it works my end. In the index.html, change base href=“/” to base href=“./”

This is what ionic info brings back:

Ionic:

ionic (Ionic CLI) : 4.6.0 (/usr/local/lib/node_modules/ionic) Ionic Framework : @ionic/angular 4.0.0-rc.0 @angular-devkit/build-angular : 0.11.4 @angular-devkit/schematics : 7.1.4 @angular/cli : 7.1.4 @ionic/angular-toolkit : 1.2.2

Cordova:

cordova (Cordova CLI) : 7.1.0 Cordova Platforms : android 6.3.0 Cordova Plugins : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 2.3.1, (and 4 other plugins)

System:

ios-deploy : 1.9.2 ios-sim : 5.0.3 NodeJS : v7.9.0 (/usr/local/Cellar/node/7.9.0/bin/node) npm : 5.8.0 OS : macOS Sierra Xcode : Xcode 9.2 Build version 9C40b

Hope it helps someone else. Corey.

After moths of development, and the first version of my app out I decided to write the version two of my application over the native language, this is just my opinion here, and I would like to share this with everyone, many ionic applications have problems visualizing so many functionalities of the native behaviors of the applications, what I can tell you is that in less than 1 month I reach a lot of objectives with the V2 of my application, in less than 1 month I achieve almost all the functionalities of the V1 of my application, I know that we write hybrid apps to get things done in various OS but this opens the door to so many problems just to figure out how to do things that native apps do in an easy way, in my experience at the end of the ionic app, I feel that was a Frankenstein-like app and that was not a good feeling for my team and for me, right now we formalize an Android team that have been working awesome and a iOS team that its learning but at the end they are reaching every goal.

As I said, this is my opinion, this is just the way that I performed the develop of my app right now.

Regards.

I had the same issues today when I plugged my android phone and run ionic cordova run android, it didn’t work on my galaxy s8 plus with android version 7.0. A blank page showed, nothing else happened. The error message varied each time:

  1. Failed to load resources error, basically all the js files not found.
  2. async function error in vendor.js.

I used cordova-android 6.0, It seems upgrade codova-android would work, at least it worked for me. No js files not found error, no blank screen forever, no error found in vendor.js.

`Ionic:

ionic (Ionic CLI) : 4.2.1 (/Users/yzhao/.nvm/versions/node/v10.9.0/lib/node_modules/ionic) Ionic Framework : @ionic/angular 4.0.0-beta.7 @angular-devkit/build-angular : 0.7.5 @angular-devkit/schematics : 0.7.5 @angular/cli : 6.1.5 @ionic/angular-toolkit : not installed

Cordova:

cordova (Cordova CLI) : 8.1.1 (cordova-lib@8.1.0) Cordova Platforms : android 7.1.0, browser 5.0.4, ios 4.5.5 Cordova Plugins : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 2.1.4, (and 9 other plugins)

System:

ios-sim : 5.0.6 NodeJS : v10.9.0 (/Users/yzhao/.nvm/versions/node/v10.9.0/bin/node) npm : 6.2.0 OS : macOS Sierra Xcode : Xcode 8.3.1 Build version 8E1000a`

I had tried android 8 and 7.0 I believe, @ChristianEGB. I’ll try again and report my findings.

I encountered this error on Friday, after spending a week and a half upgrading my biggest ionic 3 application.

The steps outlined here didn’t work.

@mhartington can you tell me why this was closed? Is there an official response here? Should I use ionic pro to build my application?

edit: FWIW, I attempted to build with ionic package, and that failed. I’m at a loss here.

@patryk-fuhrman as @pjc0247 said, update everything, that should work

@patryk-fuhrman Just update everything related with ionic/cordova and test with blank project.