科尔多瓦3.0.0存储API错误 [英] Cordova 3.0.0 Storage API error

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

问题描述

我正在开发跨平台应用程序,使用科尔多瓦3.0.0。该项目采用科尔多瓦-CLI创建和内置的Andr​​oid平台。它成功地使用文件和文件传输的插件的时刻。尝试使用存储API时,问题就来了。据PhoneGap的文档,存储API 内置版本以来科尔多瓦3.0。问题是,当我试图通过Storage API交互

I'm developing crossplatform application, using cordova 3.0.0. The project is created using cordova-cli and built for android platform. It successfully using file and file-transfer plugins at the moment. The problem comes when attempting to use Storage API. According to PhoneGap documentation, Storage API is built into cordova since version 3.0. The problem is, when I'm trying to interact with Storage API

var db = window.openDatabase(name, "1.0", name, size);

科尔多瓦的插件管理日​​志错误:

Cordova's PluginManager logs error:

exec() call to unknown plugin: Storage

所以,问题是:为什么科尔多瓦尝试通过插件管理调用存储

另外张贴我的 config.xml中

<?xml version='1.0' encoding='utf-8'?>
<widget id="io.cordova.helloCordova" version="2.0.0" xmlns="http://www.w3.org/ns/widgets">
    <name>Hello Cordova</name>
    <description>
        A sample Apache Cordova application that responds to the deviceready event.
    </description>
    <author email="dev@cordova.apache.org" href="http://cordova.io">
        Apache Cordova Team
    </author>
    <content src="index.html" />
    <feature name="App">
        <param name="android-package" value="org.apache.cordova.App" />
    </feature>
    <feature name="File">
        <param name="android-package" value="org.apache.cordova.core.FileUtils" />
    </feature>
    <feature name="FileTransfer">
        <param name="android-package" value="org.apache.cordova.core.FileTransfer" />
    </feature>
    <access origin="*" />
    <preference name="useBrowserHistory" value="true" />
    <preference name="exit-on-suspend" value="false" />
    <preference name="fullscreen" value="true" />
    <preference name="webviewbounce" value="true" />
</widget>

的Andr​​oidManifest.xml

<?xml version='1.0' encoding='utf-8'?>
<manifest android:hardwareAccelerated="true" android:versionCode="1" android:versionName="0.0.1" android:windowSoftInputMode="adjustPan" package="com.isd.immersivereader" xmlns:android="http://schemas.android.com/apk/res/android">
    <supports-screens android:anyDensity="true" android:largeScreens="true" android:normalScreens="true" android:resizeable="true" android:smallScreens="true" android:xlargeScreens="true" />
    <uses-permission android:name="android.permission.INTERNET" />
    <application android:debuggable="true" android:hardwareAccelerated="true" android:icon="@drawable/icon" android:label="@string/app_name">
        <activity android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale" android:label="@string/app_name" android:name="ImmersiveReader" android:theme="@android:style/Theme.Black.NoTitleBar">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>
    <uses-sdk android:minSdkVersion="10" android:targetSdkVersion="17" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
</manifest>

cordova.js,我使用的版本是3.0.0-0,ge670de9(据我知道这是头修订版),它确实有存储defenition。

The version of cordova.js, I'm using is 3.0.0-0-ge670de9 (as far as I know it's a head revision) and it does have Storage defenition.

如果需要更多的信息 - 只要让我知道)

If more information is required - just let me know).

感谢您提前。

推荐答案

使用科尔多瓦> = 3.0.0,你需要存储功能添加到您的config.xml(应用程序/ RES / XML / config.xml中)。例如。

Using Cordova >=3.0.0, you need to add the storage feature to your config.xml (app/res/xml/config.xml). E.g.

<feature name="Storage">
    <param name="android-package" value="org.apache.cordova.Storage" />
</feature>

这篇关于科尔多瓦3.0.0存储API错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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