apla / me.apla.cordova.app-preferences

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

Settings.bundle file for Android? #55

Closed shredmer closed 8 years ago

shredmer commented 8 years ago

For starters, I do not have the dev experience most of you have posting here but I am having trouble getting this plugin to work for Android and figured this is where I would get the most informative response.

Yesterday I installed the plugin and was able to read from my Root.plist file in the Settings.bundle file for iOS. To do so required copying the Settings.bundle into my Xcode project.

Is there a similar step or file to copy over for Android? I have not defined a key or value for android so I assume this is the issue. Also, I receive the following error while trying to emulate for Android:

Error Code:
    1
  Output:
    /Users/shredmer/Applications/NoHarm_Basic2/platforms/android/build/intermediates/res/debug/xml/apppreferences.xml:2: error: Error: No resource found that matches the given name (at 'entries' with value '@array/apppreferences_lang').

    /Users/shredmer/Applications/NoHarm_Basic2/platforms/android/build/intermediates/res/debug/xml/apppreferences.xml:2: error: Error: No resource found that matches the given name (at 'entryValues' with value '@array/apppreferences_langValues').

Thank you for your help.

lakano commented 8 years ago

Hello,

I have the same error too :( Regards,

lakano commented 8 years ago

@shredmer To not be blocked, you can get an old version:

git clone --single-branch -b "version/0.6.1" https://github.com/apla/me.apla.cordova.app-preferences.git path/where/you/want/cordova-app-preferences-0.6.1

and then in your project path:

ionic plugin add /where/you/want/cordova-app-preferences-0.6.1

Regards,

shredmer commented 8 years ago

Thanks, that fixed the build error. However, I am still having difficulty reading the settings value for Android. Which file are you using for the settings? Is it android/res/xml/apppreferences.xml ? If so how did you get it to read from the file correctly? I have been trying to read the value by using the key identity but could only get it to work in iOS still.

LightZam commented 8 years ago

i used this workaround

cordova plugin add cordova-plugin-app-preferences@0.7.1

bitflower commented 8 years ago

@LightZam thanks, confirmed. Got it running with 0.7.1

Be sure to ionic plugin rm cordova-plugin-app-preferences ionic platform rm YOUR-OS

and re-add both afterwards

UPDATE: Not true, @shredmer is right, the build will work but then the XML will be missing and therefore Android will not create any OS preferences.

bitflower commented 8 years ago

I can confirm that this works as of v0.7.4.

apla commented 8 years ago

@shredmer have you tried 0.7.4?

shredmer commented 8 years ago

Yes, 0.7.4 builds fine. Thank you

sylfree9999 commented 8 years ago

@shredmer Hi, I have found your problem in [stackoverflow()] about the app integration with Airwatch. I don't have enough reputation so I have no choice but to ask here. sorry ! I am wondering if you have successfully solve this issue? Do you use Airwatch App Wrapping or SDK or ACE?(http://stackoverflow.com/questions/33400087/retrieving-username-through-mdm-by-configuring-enterprise-app-preferences-airwa)