apla / me.apla.cordova.app-preferences

App preferences plugin for cordova
Apache License 2.0
201 stars 209 forks source link

before_build hook issue #53

Closed mohitmayank closed 8 years ago

mohitmayank commented 8 years ago

facing a small issue cause after https://github.com/apla/me.apla.cordova.app-preferences/pull/50 if i remove and re-add android platform getting following error -

Error: ENOENT, open 'platforms/android/src/me/apla/cordova/AppPreferencesActivity.java'
    at Error (native)

perhaps moving the hook to before_build might help?

I don't add platform directory to version control. I also do customization on plugins and sometimes need to reset platform directory.

Treer commented 8 years ago

There are even similiar errors during operations on unrelated plugins — any plugin:

> cordova plugin rm cordova-plugin-vibration                                                                      
Error: ENOENT, unlink 'D:\Projects\Mobile\cordova\<appname>\source\platforms\android\res\xml\apppreferences.xml'                                                                                                                 

↑ that plugin remains installed in every platform.

These issues are bad, nearly every type of cordova operation seems to be broken or get aborted mid-way through without unrolling because of errors that trace back to app-preferences. Even if I start a new project fresh and get to a point where I can get these files to exist, the project has already been borked by things being half installed in unobvious ways (json files not updated etc). Infact, if your project is already set up then nothing seems wrong, it's only when you try to get it building on a new machine etc.

I thought I could work around it - just be careful and find a working order to add platforms and plugins, but after 3 days of whacking moles caused by one plugin, I think the options are:

(I'm going to try switching to localStorage as I can't spend any more time on this, but I know that's not a helpful suggestion)

apla commented 8 years ago

@mohitmayank @Treer latest version should work