PhoneGap的Andr​​oid版本:未知铬错误:-6 [英] Phonegap Android: Unknown chromium error: -6

查看:176
本文介绍了PhoneGap的Andr​​oid版本:未知铬错误:-6的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建一个PhoneGap的Andr​​oid应用程序,我添加一个插件,它的时候遇到了麻烦。科尔多瓦的版本是2.2.0。我不使用JQM或煎茶触摸。我测试在Android 4.0的应用程序。

I'm creating a Phonegap Android app and I'm having trouble when adding a plugin to it. Cordova version is 2.2.0. I'm not using jQM or Sencha Touch. I test the app on Android 4.0.

我指的是插件的Andr​​oid PhoneGap的插件。这是我的 index.html的文件:

The plugin I refer to is Android Phonegap plugin. This is my index.html file:

<!DOCTYPE html>
<html>
  <head>
    ...
  </head>
  <body>
    <div class="wrapper">
      ...
    </div>

    <script type="text/javascript" src="vendor/cordova-2.2.0.js"></script>
    <script type="text/javascript" src="assets/application.js"></script>
    <script type="text/javascript" src="js/index.js"></script>
    <script type="text/javascript" src="js/datePickerPlugin.js"></script>
  </body>
</html>

这是我主要的Java文件:

This is my main Java file:

import android.app.Activity;
import android.os.Bundle;
import org.apache.cordova.*;

public class looker extends DroidGap
    {
        @Override
        public void onCreate(Bundle savedInstanceState)
            {
                super.onCreate(savedInstanceState);
                super.setIntegerProperty("splashscreen", R.drawable.splash);
                super.loadUrl("file:///android_asset/www/index.html", 7000);
            }
    }

因此​​,为了了解这个问题是在插件中,我的最小 <一个href="https://github.com/phonegap/phonegap-plugins/blob/master/Android/DatePicker/datePickerPlugin.js">this在资产/ application.js文件中写 ,我用我所有的最小化脚本。我删除了脚本标记插件从 index.html的和插件是工作就好了!因此,它得到的东西做与URL的可能?

So in order to understand if the problem is within the plugin, I minimized this file in assets/application.js where all my minimized scripts I use are. I removed the script tag for the plugin from index.html and the plugin was working just fine! So it's got something to do with the URL's maybe?

有什么我想这么远吗?

我研究了很多,尝试了几种解决方案,其他类似的问题。

I was researching a lot and tried several solutions to other similar problems.

  1. 确信我有3 /的为使用loadURL 在我的主类:

public void onCreate(Bundle savedInstanceState)
    {
      super.onCreate(savedInstanceState);
      super.setIntegerProperty("splashscreen", R.drawable.splash);
      super.loadUrl("file:///android_asset/www/index.html", 7000);
    }

假如说从一开始,没有任何区别

打过电话super.init()super.loadUrl()之前。 没有工作,以及

Tried calling super.init() before super.loadUrl(). Didn't work as well.

试过这样的:

public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    super.init();
    super.setIntegerProperty("loadUrlTimeoutValue", 6000);
    super.loadUrl("file:///android_asset/www/index.html");
}

仍然没有解决问题。

选中如果文件被加载到应用程序,通过添加警报(); 它加载

Checked if the file is loaded in the app, by adding an alert();. It loads.

这是一般。会很高兴,如果需要,为了解决这个问题,为您提供更多的信息。在此先感谢!

That's in general. Will be glad to provide you with additional info if needed in order to resolve this issue. Thanks in advance!

推荐答案

我也跟着指导,能得到该插件工作得很好。

I followed the guide and was able to get the plugin working just fine.

不过,我可以复制未知铬错误:-6当我有这个在我的config.xml:

However, I was able to replicate the "Unknown chromium error: -6" when I had this in my config.xml:

&LT;插件名称=DatePickerPlugin1值=com.phonegap.plugin.DatePickerPlugin/&GT;

请确保名称中的XML属性DatePickerPlugin,因为这是JavaScript code使用的插件的名称:<一href="https://github.com/phonegap/phonegap-plugins/blob/master/Android/DatePicker/datePickerPlugin.js#L33" rel="nofollow">https://github.com/phonegap/phonegap-plugins/blob/master/Android/DatePicker/datePickerPlugin.js#L33

Make sure that the "name" attribute in the XML is DatePickerPlugin, since that is the name that the JavaScript code uses for the plugin: https://github.com/phonegap/phonegap-plugins/blob/master/Android/DatePicker/datePickerPlugin.js#L33

可能有其他的方式来,虽然产生同样的错误。如果这没有帮助,你可以发布或链接到HTML文件实际上是调用了这个插件,以及您的config.xml? (请确保您使用的是RES / XML / config.xml文件,而不是RES / XML / plugins.xml已经去$ P $这里pcated:<一href="http://cordova.apache.org/docs/en/2.0.0/guide_upgrading_android_index.md.html#Upgrading%20Cordova%20Android" rel="nofollow">http://cordova.apache.org/docs/en/2.0.0/guide_upgrading_android_index.md.html#Upgrading%20Cordova%20Android

There may be other ways to generate the same error though. If this doesn't help, can you post or link to your HTML file that actually calls out to this plugin, as well as your config.xml? (Make sure you are using a res/xml/config.xml and not res/xml/plugins.xml which has been deprecated here: http://cordova.apache.org/docs/en/2.0.0/guide_upgrading_android_index.md.html#Upgrading%20Cordova%20Android

这篇关于PhoneGap的Andr​​oid版本:未知铬错误:-6的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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