ionic-team / ionicons

Premium hand-crafted icons built by Ionic, for Ionic apps and web apps everywhere 🌎
http://ionicons.com
MIT License
17.58k stars 2.07k forks source link

bug: E/Capacitor/Plugin: MalformedURLException java.net.MalformedURLException: no protocol: /svg/newspaper.svg #1132

Closed JoseCarlosBran closed 2 years ago

JoseCarlosBran commented 2 years ago

Current Behavior

The icons of my application are rendered correctly in the browser, however when initializing the app on my android device, it throws the following error:

D/Capacitor: Sending plugin error: {"save":false,"callbackId":"126273950","pluginId":"CapacitorHttp","methodName":"request","success":false,"error":{"message":"MalformedURLException"}} E/Capacitor/Plugin: MalformedURLException java.net.MalformedURLException: no protocol: /svg/newspaper.svg at java.net.URL.(URL.java:601) at java.net.URL.(URL.java:498) at java.net.URL.(URL.java:447) at com.getcapacitor.plugin.util.HttpRequestHandler.request(HttpRequestHandler.java:379) at com.getcapacitor.plugin.CapacitorHttp$1.run(CapacitorHttp.java:34)

Initializes the app, but the icons are not displayed.

Expected Behavior

I only hoped they could be displayed, as they do in the browser

Steps to Reproduce

Ionic Version: 6.20.1

 _                      _                 ____ _     ___ 
/ \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|

/ △ \ | ' \ / | | | | |/ _ | '| | | | | | | / _ | | | | (| | || | | (| | | | || |_ | | // __| ||_, |_,||_,|| __|__|| |/

Angular CLI: 14.2.2 Node: 16.17.0 Package Manager: npm 8.19.1 OS: win32 x64

Angular: 14.2.1 ... common, compiler, compiler-cli, core, forms ... language-service, platform-browser, platform-browser-dynamic ... router

Package Version


@angular-devkit/architect 0.1402.2 @angular-devkit/build-angular 14.2.2 @angular-devkit/core 14.2.2 @angular-devkit/schematics 14.2.2 @angular/cli 14.2.2 @schematics/angular 14.2.2 rxjs 6.6.7 typescript 4.7.4

Code Reproduction URL

https://github.com/Rnando1011/register-daps.git

Additional Information

I am new to Ionic, I will greatly appreciate the support you can give me

Here I share my angular.json

{ "$schema": "./node_modules/@angular/cli/lib/config/schema.json", "version": 1, "newProjectRoot": "projects", "projects": { "app": { "root": "", "sourceRoot": "src", "projectType": "application", "prefix": "app", "schematics": {}, "architect": { "build": { "builder": "@angular-devkit/build-angular:browser", "options": { "outputPath": "www", "index": "src/index.html", "main": "src/main.ts", "polyfills": "src/polyfills.ts", "tsConfig": "tsconfig.app.json", "assets": [ { "glob": "/*", "input": "src/assets", "output": "assets" }, { "glob": "*/.svg", "input": "node_modules/ionicons/dist/ionicons/svg", "output": "./svg" } ], "styles": ["src/theme/variables.scss", "src/global.scss"], "scripts": [], "aot": false, "vendorChunk": true, "extractLicenses": false, "buildOptimizer": false, "sourceMap": true, "optimization": false, "namedChunks": true }, "configurations": { "production": { "fileReplacements": [ { "replace": "src/environments/environment.ts", "with": "src/environments/environment.prod.ts" } ], "optimization": true, "outputHashing": "all", "sourceMap": false, "namedChunks": false, "aot": true, "extractLicenses": true, "vendorChunk": false, "buildOptimizer": true, "budgets": [ { "type": "initial", "maximumWarning": "2mb", "maximumError": "5mb" } ] }, "ci": { "progress": false } } }, "serve": { "builder": "@angular-devkit/build-angular:dev-server", "options": { "browserTarget": "app:build" }, "configurations": { "production": { "browserTarget": "app:build:production" }, "ci": { "progress": false } } }, "extract-i18n": { "builder": "@angular-devkit/build-angular:extract-i18n", "options": { "browserTarget": "app:build" } }, "test": { "builder": "@angular-devkit/build-angular:karma", "options": { "main": "src/test.ts", "polyfills": "src/polyfills.ts", "tsConfig": "tsconfig.spec.json", "karmaConfig": "karma.conf.js", "styles": [], "scripts": [], "assets": [ { "glob": "favicon.ico", "input": "src/", "output": "/" }, { "glob": "/*", "input": "src/assets", "output": "/assets" } ] }, "configurations": { "ci": { "progress": false, "watch": false } } }, "lint": { "builder": "@angular-eslint/builder:lint", "options": { "lintFilePatterns": [ "src/*/.ts", "src/*/.html" ] } }, "e2e": { "builder": "@angular-devkit/build-angular:protractor", "options": { "protractorConfig": "e2e/protractor.conf.js", "devServerTarget": "app:serve" }, "configurations": { "production": { "devServerTarget": "app:serve:production" }, "ci": { "devServerTarget": "app:serve:ci" } } } } } }, "cli": { "schematicCollections": [ "@ionic/angular-toolkit" ], "analytics": "a889445f-aca0-4a35-95f2-935f2e68b00f" }, "schematics": { "@ionic/angular-toolkit:component": { "styleext": "scss" }, "@ionic/angular-toolkit:page": { "styleext": "scss" } } }

liamdebeasi commented 2 years ago

Thanks for the report. This is a Capacitor bug that the team is working on fixing. Please follow https://github.com/ionic-team/capacitor/issues/5947 for updates. I am going to close this as this is not a bug in Ionicons.