question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ionic 4.0.0 icons for ios not working

See original GitHub issue

Description:

Hi,

i upgrate today my ionic libary from 4.0.0-beta19 to 4.0.0 and after i run ionic serve -l the icons are not working and show me:

Failed to load resource: the server responded with a status of 404 (Not Found) :8100/svg/ios-book.svg:1 Failed to load resource: the server responded with a status of 404 (Not Found) :8100/svg/ios-cube.svg:1 Failed to load resource: the server responded with a status of 404 (Not Found) :8100/svg/ios-cog.svg:1 Failed to load resource: the server responded with a status of 404 (Not Found) VM35:1 GET http://localhost:8100/svg/ios-log-out.svg 404 (Not Found)

My angular.json:

            "assets": [
              {
                "glob": "**/*",
                "input": "src/assets",
                "output": "assets"
              },
              {
                "glob": "**/*.svg",
                "input": "node_modules/ionicons/dist/ionicons/svg",
                "output": "./svg"
              }
            ],

My Package.json:

{
  "name": "app",
  "version": "1.0.8",
  "author": "Ionic Framework",
  "homepage": "http://ionicframework.com/",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e"
  },
  "private": true,
  "dependencies": {
    "@angular/animations": "~7.2.2",
    "@angular/common": "~7.2.2",
    "@angular/core": "~7.2.2",
    "@angular/forms": "~7.2.2",
    "@angular/http": "~7.2.2",
    "@angular/platform-browser": "~7.2.2",
    "@angular/platform-browser-dynamic": "~7.2.2",
    "@angular/router": "~7.2.2",
    "@ionic-native/app-version": "5.0.0",
    "@ionic-native/core": "5.0.0",
    "@ionic-native/local-notifications": "5.0.0",
    "@ionic-native/network": "5.0.0",
    "@ionic-native/splash-screen": "5.0.0",
    "@ionic-native/status-bar": "5.0.0",
    "@ionic/angular": "~4.0.0",
    "@ionic/storage": "2.2.0",
    "@types/axios": "^0.14.0",
    "axios": "^0.18.0",
    "cordova-android": "^7.1.4",
    "cordova-ios": "^4.5.5",
    "cordova-plugin-app-version": "0.1.9",
    "cordova-plugin-badge": "0.8.8",
    "cordova-plugin-device": "^2.0.2",
    "cordova-plugin-ionic-keyboard": "^2.1.3",
    "cordova-plugin-ionic-webview": "^3.1.1",
    "cordova-plugin-local-notification": "0.9.0-beta.2",
    "cordova-plugin-network-information": "2.0.1",
    "cordova-plugin-splashscreen": "^5.0.2",
    "cordova-plugin-statusbar": "^2.4.2",
    "cordova-plugin-whitelist": "^1.3.3",
    "core-js": "^2.6.3",
    "ngx-pagination": "^3.2.1",
    "rxjs": "~6.3.3",
    "videogular2": "^6.4.0",
    "zone.js": "~0.8.29"
  },
  "devDependencies": {
    "@angular-devkit/architect": "~0.12.3",
    "@angular-devkit/build-angular": "^0.12.3",
    "@angular-devkit/core": "~7.2.2",
    "@angular-devkit/schematics": "~7.2.2",
    "@angular/cli": "~7.2.2",
    "@angular/compiler": "~7.2.2",
    "@angular/compiler-cli": "~7.2.2",
    "@angular/language-service": "~7.2.2",
    "@ionic/angular-toolkit": "~1.2.2",
    "@ionic/lab": "~1.0.19",
    "@types/core-js": "^2.5.0",
    "@types/jasmine": "~3.3.7",
    "@types/jasminewd2": "~2.0.6",
    "@types/node": "~10.12.18",
    "codelyzer": "~4.5.0",
    "jasmine-core": "~3.3.0",
    "jasmine-spec-reporter": "~4.2.1",
    "karma": "~4.0.0",
    "karma-chrome-launcher": "~2.2.0",
    "karma-coverage-istanbul-reporter": "~2.0.4",
    "karma-jasmine": "~2.0.1",
    "karma-jasmine-html-reporter": "^1.4.0",
    "protractor": "~5.4.2",
    "ts-node": "~7.0.1",
    "tslint": "~5.12.1",
    "typescript": "~3.2.4"
  },
  "description": "An Ionic project",
  "cordova": {
    "plugins": {
      "cordova-plugin-whitelist": {},
      "cordova-plugin-statusbar": {},
      "cordova-plugin-device": {},
      "cordova-plugin-splashscreen": {},
      "cordova-plugin-ionic-webview": {},
      "cordova-plugin-ionic-keyboard": {},
      "cordova-plugin-streaming-media": {},
      "cordova-plugin-network-information": {},
      "cordova-plugin-local-notification": {},
      "cordova-plugin-app-version": {}
    },
    "platforms": [
      "android",
      "ios"
    ]
  }
}

My ionic info:

Ionic:

   ionic (Ionic CLI)             : 4.3.1 (/usr/local/lib/node_modules/ionic)
   Ionic Framework               : @ionic/angular 4.0.0
   @angular-devkit/build-angular : 0.12.3
   @angular-devkit/schematics    : 7.2.3
   @angular/cli                  : 7.2.3
   @ionic/angular-toolkit        : 1.2.2

Cordova:

   cordova (Cordova CLI) : 8.1.2 (cordova-lib@8.1.1)
   Cordova Platforms     : android 7.1.4, ios 4.5.5
   Cordova Plugins       : cordova-plugin-ionic 5.2.7, cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 2.2.5, (and 11 other plugins)

Thanks

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:13 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
torgnywalincommented, Jan 24, 2019

@jboarder Thanks for pointing me in the right direction. This was in my old angular.json file:

"assets": [
  {
    "glob": "**/*",
    "input": "src/assets",
    "output": "assets"
  }
]

Changed it to:

"assets": [
    {
      "glob": "**/*",
      "input": "src/assets",
      "output": "assets"
    },
    {
      "glob": "**/*.svg",
      "input": "node_modules/ionicons/dist/ionicons/svg",
      "output": "./svg"
    }
]

Then icons show up. This should really be part of the documentation on how to upgrade.

2reactions
jboardercommented, Jan 24, 2019

It looks like Ionicons are packaged a little bit different now. If you are upgrading an existing project, check your angular.json file.

Following worked for me: changing

"assets": [
    {
      "glob": "**/*.svg",
      "input": "node_modules/@ionic/angular/dist/ionic/svg",
      "output": "./svg"
    }
  ]

to

  "assets": [
    {
      "glob": "**/*.svg",
      "input": "node_modules/ionicons/dist/ionicons/svg",
      "output": "./svg"
    }
  ]
Read more comments on GitHub >

github_iconTop Results From Across the Web

ionic 4.0.0 icons for ios not working · Issue #17245 - GitHub
Description: Hi, i upgrate today my ionic libary from 4.0.0-beta19 to 4.0.0 and after i run ionic serve -l the icons are not...
Read more >
Can't load ion-icons on macbook (ionic 4.0.0)
Description: Hi, i upgrate today my ionic libary from 4.0.0-beta19 to 4.0.0 and after i run ionic serve -l the icons are not...
Read more >
Blog - Apache Cordova
Cordova has increased the Gradle Plugin to version 4.0.0. Please report any issues you find at issues.cordova.io!
Read more >
Ionic application is not working on 4.4 and 5.1 - Stack Overflow
Ionic 4/3 application is showing white screen on Android Kitkat 4.4 and lolipop 5.1. My application is not working on kitkat and lolipop....
Read more >
Ionicons: The premium icon pack for Ionic Framework
Beautifully crafted open source icons. Premium designed icons for use in web, iOS, Android, and desktop apps. Support for SVG and web font....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found