简体   繁体   English

无法加载位于 file:///android_asset/file.html 的网页,因为:net::ERR_FILE_NOT_FOUND

[英]The webpage at file:///android_asset/file.html could not be loaded because: net::ERR_FILE_NOT_FOUND

I don't why I'm getting an error:-我不知道为什么我会收到错误:-

The webpage at file:///android_asset/file.html could not be loaded because: net::ERR_FILE_NOT_FOUND无法加载位于 file:///android_asset/file.html 的网页,因为:net::ERR_FILE_NOT_FOUND

WebSettings mysettings = myweb.getSettings();
        
        mysettings.setJavaScriptEnabled(true);
        mysettings.setDomStorageEnabled(true);
        
        myweb.loadUrl("file:///android_asset/www/file.html");
        
        myweb.setWebViewClient(new WebViewClient());
        

Here Is my file这是我的文件

/RandomPasswordGenerator/app/src/main/assets/www/file.html /RandomPasswordGenerator/app/src/main/assets/www/file.html

Ensure that you have not created another folder called android_asset .确保您没有创建另一个名为android_asset的文件夹。 Since you've not shown your assets directory, let the www folder be inside the assets folder (app > src > main >assets) .由于您没有显示资产目录,因此将www文件夹放在资产文件夹中(app > src > main >assets) The matter is, what you must give as 'android_asset' is actually shown as 'assets' in the directory listing.问题是,您必须作为“android_asset”提供的内容实际上在目录列表中显示为“assets”。 With this, you can find yourself a solution by rightly targeting your files.有了这个,您可以通过正确定位您的文件来找到自己的解决方案。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 无法加载资源:net::ERR_FILE_NOT_FOUND 但数据已加载 - Failed to load resource: net::ERR_FILE_NOT_FOUND but data is loaded Android Studio(网页帮助)网:ERR_FILE_NOT_FOUND - Android Studio (Web page help) net : ERR_FILE_NOT_FOUND 路径“file:/// android_asset /”记录在哪里? - Where is the path “file:///android_asset/” documented? “初始化网络连接时出错:找不到类”,来源:file:///android_asset/www/cordova.js - “Error initializing Network Connection: Class not found”, source: file:///android_asset/www/cordova.js Android Studio 中的 webview 出现错误“”网页无法加载,因为 net::ERR_ACCESS_DENIED“” - webview in Android Studio with error “”webpage could not be loaded because net:: ERR_ACCESS_DENIED“” 如何在Java中使用jsoup解析file.html - how to parse a file.html with jsoup in java Phonegap:对象xx在文件中没有方法'exec':///android_asset/www/cordova.js - Phonegap: Object xx has no method 'exec' at file:///android_asset/www/cordova.js Java SE file.txt转换为file.html - Java se file.txt convert to file.html 无法在文件:///android_asset/www/apis/camera.js:45读取未定义类型的属性“ DATA_URL” - Can not read propery 'DATA_URL' of undefined type at file:///android_asset/www/apis/camera.js:45 file.html beeing正确显示在localhost上,但不在服务器上 - file.html beeing correctly displayed on localhost but not on server
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM