[ 
https://issues.apache.org/jira/browse/CB-4851?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13780606#comment-13780606
 ] 

Andrew Martin commented on CB-4851:
-----------------------------------

To tide people over in the meantime until it gets fixed the following ugly, 
ugly hack works for me...

In your android platform directory navigate through the plugins src package 
folders to...

src/org/apache/cordova

Create a text file and name it Storage.java

Copy and paste into that file the contents of here...
https://git-wip-us.apache.org/repos/asf?p=cordova-android.git;a=blob_plain;f=framework/src/org/apache/cordova/Storage.java;h=34ebf387d31a126b1e3b306eff164c4d0320488d;hb=df1536ea77e97b7d362a19582f8beddd168c5ec3

This is a 2.9.x Storage.java file, I couldn't find a newer one?

Next, change in the Storage.java you just created the following lines...

import org.apache.cordova.api.CallbackContext;
import org.apache.cordova.api.CordovaPlugin;

to...

import org.apache.cordova.CallbackContext;
import org.apache.cordova.CordovaPlugin;

Now, (making sure you have added the storage feature in your config.xml) the 
code will compile and work :)
                
> Android Storage API
> -------------------
>
>                 Key: CB-4851
>                 URL: https://issues.apache.org/jira/browse/CB-4851
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: Android
>    Affects Versions: 3.0.0
>            Reporter: Dick van den Brink
>            Assignee: Joe Bowser
>              Labels: android, storage
>
> According to the documentation the Storage API is provided in the core of 
> cordova, but it is removed from the Android Core.
> Documentation: 
> http://cordova.apache.org/docs/en/3.0.0/cordova_storage_storage.md.html#Storage
> {quote}As of version 3.0, access to Storage APIs is built into Cordova, and 
> does not require using the CLI to add plugins as described in The 
> Command-line Interface.
> {quote}
> I did add the xml to the config page but I get the following error:
> {quote}
> Error adding plugin org.apache.cordova.Storage.
> exec() call to unknown plugin: Storage
> java.lang.ClassNotFoundException: org.apache.cordova.Storage
> at java.lang.Class.classForName(Native Method)
> at java.lang.Class.forName(Class.java:217)
> at java.lang.Class.forName(Class.java:172)
> at org.apache.cordova.PluginEntry.getClassByName(PluginEntry.java:117)
> {quote}
> Is the documentation wrong or is the Storage class incorrectly deleted?
> Note: the storage code is still provided in cordova.js, but not in the jar. 
> Also the Java code is in the 2.9 branch. It is deleted in the commit with 
> sha1 id: adcbd879c846dd3f7a3db960a3c7af14acbbda41

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to