MobileChromeApps / mobile-chrome-apps

Chrome apps on Android and iOS
BSD 3-Clause "New" or "Revised" License
2.5k stars 348 forks source link

syncfilesystem permission not recognized #597

Open komacke opened 8 years ago

komacke commented 8 years ago

Using cca 0.7.4 and node-js 0.10.36, I'm getting at 'cca prepare':

Permission not recognized by cca: syncFileSystem (ignoring)

In case there is an issue with my manifest I tried syncDemo from here: https://github.com/MobileChromeApps/mobile-chrome-app-samples/tree/master/syncDemo

and got the same error.

Here's the full output:

$ cca prepare
cca v0.7.4
## Updating plugins based on manifest.json
Permission not recognized by cca: syncFileSystem (ignoring)
## Running Cordova Command: plugin add cordova-plugin-whitelist@1.0.0
Fetching plugin "cordova-plugin-whitelist@1.0.0" via npm
Plugin "cordova-plugin-whitelist" already installed on android.
Running command: /android/syncDemo/syncDemo/hooks/before_prepare/cca-check.js /android/syncDemo/syncDemo
## Inject CSP for android

I tried forcing the plugin install with cca but it said don't do that:

$ cca plugin add org.chromium.syncfilesystem
cca v0.7.4
Error: The following plugin(s) cannot be explicitly installed:
* org.chromium.syncfilesystem
Instead, add the proper manifest.json permissions.
See: https://developer.chrome.com/apps/manifest
Error: Abort plugin add

What am I missing from the manifest? How to debug?

Thanks,

Dave

agrieve commented 8 years ago

Sounds like a bug, but one that won't be getting fixed :(.

syncFileSystem is a super-powerful API, but turns out not one that can be efficiently implemented in Cordova.

komacke commented 8 years ago

Hmmm... What are the limitations? I came across one note that syncFileSystem doesn't sync when the app isn't open, which seems like a reasonable limitation for many use cases. Of course I haven't been able to explore the limitations since I don't have it running.

Would you have any guesses what version of cca it was working?

With great optimism, I'll see if I can figure out the "cca prepare" issue. Maybe it will just work after that. =8-|

komacke commented 8 years ago

I'm continuing to explore. I can't really find a good alternative to syncfilesystem. It may be infeasible for the general case but it seems like it will work for my use case.

I took it out of the "STALE" list in the cca plugins list and compiled. Running on android gave me an error with ChromeStorage. I suspect this version dates prior to the refactor into individual repos on MobileChromeApps and needs some work.

I found the syncFileSystem code back on Feb 10 in this repo: https://github.com/MobileChromeApps/mobile-chrome-apps/tree/master/chrome-cordova/plugins/chrome.syncFileSystem. Supposedly it was moved on Feb 11 into it's own repo.

Would you be willing/able to provide the source (let me branch) from after the migration to its own repo? It would give me a starting point that presumably is further along than the Feb 10 version.

Thanks so much.

Dave

agrieve commented 8 years ago

It doesn't look like there's a way to get it back, but I don't believe there were any commits to it after it was split out.

agrieve commented 8 years ago

Good luck!

komacke commented 8 years ago

Thanks for your quick response and confirming.

For anyone interested in contributing to, following, or attempting to use a "branch" of syncFileSystem, I've started it here as its own cordova plugin: https://github.com/komacke/cordova-syncFileSystem.git

Please use that issue list to communicate about it: https://github.com/komacke/cordova-syncFileSystem/issues

Note that it doesn't compile yet - cordova Filesystem interfaces have changed. But hopefully I'll find enough time to get it going quickly so I can get back to my project. :)