[英]The requested file was not found./android_assets/www/pica.html
I am fresher in this field and while trying to add html page in eclipse and run it on AVD its showing error on AVD "the requested file was not found./android_assets/www/pica.html(no such file or directory)(file:///android_assets/www/pica.html)" 我在这个领域更新鲜,在尝试在eclipse中添加html页面并在AVD上运行它在AVD上显示错误“找不到所请求的文件./android_assets/www/pica.html(no此类文件或目录)(文件) :///android_assets/www/pica.html)”
my code is as below 我的代码如下
import org.apache.cordova.DroidGap;
import android.os.Bundle;
import android.view.Menu;
public class MainActivity extends DroidGap {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
super.loadUrl("file:///android_assets/www/pica.html");
}
Its showing error, 它显示错误,
ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.example.projectexample/.MainActivity }
ActivityManager: Warning: Activity not started, its current task has been brought to the front
and ERROR: Plugin.xml is missing. Add res/xml/plugins.xml to your program.
Well it would seem the file you are linking to is in a different location or has a different name. 好吧,您链接的文件似乎位于不同的位置或具有不同的名称。
Your project structure should be something like this: 您的项目结构应该是这样的:
- Project Root Folder
- src
... java source files
- res
... resources
- assets
- www
- pica.html
And as for the second problem with the plugin.xml: Just create the xml manually in the folder res/xml. 至于plugin.xml的第二个问题:只需在文件夹res / xml中手动创建xml。
在URI中使用android_asset
而不是android_assets
(注意缺少的s
):
super.loadUrl("file:///android_asset/www/pica.html");
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.