apla / me.apla.cordova.app-preferences

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

Android preferences not being created #22

Closed ghost closed 9 years ago

ghost commented 9 years ago

Hi I've recently pulled this module to my project from git repo,and noticed that the template given app-settings.js does not render more than just simple

<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"/>

I've localized the source of said issue, the aData object variable is loosing it's contents few lines above being used for android preferenceScreen rendering code.

Quick fix follows: either clone the iosData or do this on line 129

var iosData = JSON.parse(data);
var aData = JSON.parse(data);

instead of

var iosData = JSON.parse(data);
var aData = iosData;

as the iosData is being shifted,unshifted few lines below and for some reason it makes only (aData to iosData) reference to the same array/object so both loose content one ios Setting.bundle is done rendering.

This solution fixes android preferencesScreen from being rendered empty while ios Settings.bundle is rendered correctly.

Thanks, Lukas

apla commented 9 years ago

please update plugin and recheck