错误初始化科尔多瓦:类未找到 [英] Error initializing Cordova: Class not found

查看:111
本文介绍了错误初始化科尔多瓦:类未找到的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我跟着的PhoneGap从官方Phonegap.com网站(入门安卓)的教程。

I followed the tutorial of Phonegap from the official Phonegap.com site (getting started with Android).

我已经创建项目,以下所有步骤。

I have created project with following all the steps.

  1. 创建活动和DroidGap扩展和的onCreate()添加使用loadURL方法。
  2. 新增科尔多瓦-2.0.0.js和科尔多瓦-2.0.0.jar上的相应文件夹中。
  3. 添加jar文件添加到构建路径
  4. 从html标记加载的js文件
  5. 从AndroidMainfeast.xml添加权限
  6. 复制包含configs.xml的XML文件夹

现在我不明白的地方就是问题所在。它显示的屏幕截图所示下面的错误

Now I don't understand where's the problem. It is showing the below error as shown in the screenshot

下面是我的HTML文件

Here is my HTML file

<!DOCTYPE html>
<html>
  <head>
    <title>Notification Example</title>

    <script type="text/javascript" charset="utf-8" src="cordova-2.0.0.js"></script>
    <script type="text/javascript" charset="utf-8">

    // Wait for Cordova to load
    //
    document.addEventListener("deviceready", onDeviceReady, false);

    // Cordova is ready
    //
    function onDeviceReady() {
        // Empty
    }

    // Show a custom alert
    //
    function showAlert() {
        navigator.notification.alert(
            'You are the winner!',  // message
            'Game Over',            // title
            'Done'                  // buttonName
        );
    }

    // Beep three times
    //
    function playBeep() {
        navigator.notification.beep(3);
    }

    // Vibrate for 2 seconds
    //
    function vibrate() {
        navigator.notification.vibrate(2000);
    }

    </script>
  </head>
  <body>
    <p><a href="#" onclick="showAlert()">Show Alert</a></p>
    <p><a href="#" onclick="playBeep()">Play Beep</a></p>
    <p><a href="#" onclick="vibrate()">Vibrate</a></p>
  </body>
</html>

有什么建议?谢谢!

推荐答案

的config.xml 不是 configs.xml

根据我看到你缺少你的应用 RES / XML 目录此文件中的日志。它是作为分发的一部分,在的lib /安卓/ RES / XML / config.xml中使文件复制到你的 RES / XML 目录,你应该准备就绪。

Based on the logs I'm seeing you are missing this file in your apps res/xml directory. It is included as part of the distribution at lib/android/res/xml/config.xml so copy that file into your res/xml directory and you should be all set.

这篇关于错误初始化科尔多瓦:类未找到的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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