Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/joomla/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
找不到请求的文件。/android_assets/www/pica.html_Android - Fatal编程技术网

找不到请求的文件。/android_assets/www/pica.html

找不到请求的文件。/android_assets/www/pica.html,android,Android,我对这个领域比较熟悉,当我尝试在eclipse中添加html页面并在AVD上运行它时,它在AVD上显示错误“找不到请求的文件。/android_assets/www/pica.html(没有这样的文件或目录)(file:///android_assets/www/pica.html)" 我的代码如下 import org.apache.cordova.DroidGap; import android.os.Bundle; import android.view.Menu; public cl

我对这个领域比较熟悉,当我尝试在eclipse中添加html页面并在AVD上运行它时,它在AVD上显示错误“找不到请求的文件。/android_assets/www/pica.html(没有这样的文件或目录)(file:///android_assets/www/pica.html)"

我的代码如下

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");
    }
这是一个明显的错误

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.

您链接到的文件似乎位于不同的位置或具有不同的名称

您的项目结构应该如下所示:

- Project Root Folder  
          - src    
            ... java source files  
          - res    
            ... resources  
          - assets    
             - www  
               - pica.html 

至于plugin.xml的第二个问题:只需在res/xml文件夹中手动创建xml。

使用
android_资产
,而不是URI中的
android_资产
(注意缺少的
s
):


谢谢,但我的项目结构像-src。。。java源文件-资产-www-pica.html-res。。。资源:那么我需要做哪些更改??我需要给出整个路径吗??你能给我一个关于如何写路径的例子吗?你能详细说明你的答案吗,因为这对我来说真的很新鲜。请在你的问题中加入你的项目结构,一般来说,如果你的结构有点不同,也可以。重要的部分是资产,它必须是资产-www-pica.html
super.loadUrl("file:///android_asset/www/pica.html");