@ ionic/angular 4.0.0-beta.13:不允许加载本地资源:使用Webview 2.2.3-Ionic CLI 4.3.1 [英] @ionic/angular 4.0.0-beta.13 : Not allowed to load local resource : with webview 2.2.3 - Ionic CLI 4.3.1

查看:173
本文介绍了@ ionic/angular 4.0.0-beta.13:不允许加载本地资源:使用Webview 2.2.3-Ionic CLI 4.3.1的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

从相机拍摄照片后,这些路径就会出现.

After taking the photo from camera, these paths come.

file:///data/data/xxx.xxx.xxx.xxx/files/1542782360167.jpg

我使用的是WebView为2.2.3的Ionic 4,通过应用观察到了所有类型的答复,但没有效果.

I use Ionic 4 in which WebView is 2.2.3, all types of replies have been observed by applying but no effects came.

"cordova-plugin-ionic-webview": "2.2.3"

我曾经回答过这个

不允许加载本地资源: ionic 3 android

所以我没有在设备上显示该应用程序,而这个应用程序也不相同.

So I do not show the application on the device and this one is not the same.

Failed to load resource: net::ERR_FILE_NOT_FOUND

推荐答案

我已经找到了解决问题的方法.

I have found the solution of my problem.

我已经完成了此链接,该链接非常正常.

I have done this link which is working perfectly.

https://devdactic.com/ionic-4-image-upload-存储/

在我的config.xml中,extra没有写任何东西.

And in my config.xml, extra did not write anything.

简而言之: 新的Webview插件不支持file:/// url

inshort : new webview plugin are not support file:/// url

首先将url转换为http://localhost:<post>/url 使用此功能this.webview.convertFileSrc(img);

first convert url into http://localhost:<post>/url using this function this.webview.convertFileSrc(img);

像这样http://localhost:8080/_file_/data/data/xxx.xxx.xxx.xxx/files/1542782360167.jpg

我的建议将以上链接用于同类问题...

my suggestion use above link for same kind of problem...

这篇关于@ ionic/angular 4.0.0-beta.13:不允许加载本地资源:使用Webview 2.2.3-Ionic CLI 4.3.1的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆