Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
154 views
in Technique[技术] by (71.8m points)

android getSharedPreferences error: Map value without name attribute: boolean

I am trying to figure out the cause of this error it occurs on startup when i try to get the shared preferences for the app. the code is just:

settings = this.getSharedPreferences(Globals.PREFS_NAME, 0)

Seems like a corruption, but the bug is in the app as i have installed it on multiple devices and the same error occurs. I have uninstalled the app and re-installed it to no avail. also did a fully clean build. I googled the error and dont seem to be able to find anything on it.

I was previously working fine. so I am a rather stumped. Any leads would be very highly appreciated ...

regards,

rob

W/ApplicationContext( 1541): getSharedPreferences
W/ApplicationContext( 1541): org.xmlpull.v1.XmlPullParserException: Map value without name attribute: boolean
W/ApplicationContext( 1541):    at com.android.internal.util.XmlUtils.readThisMapXml(XmlUtils.java:521)
W/ApplicationContext( 1541):    at com.android.internal.util.XmlUtils.readThisValueXml(XmlUtils.java:733)
W/ApplicationContext( 1541):    at com.android.internal.util.XmlUtils.readValueXml(XmlUtils.java:667)
W/ApplicationContext( 1541):    at com.android.internal.util.XmlUtils.readMapXml(XmlUtils.java:470)
W/ApplicationContext( 1541):    at android.app.ContextImpl.getSharedPreferences(ContextImpl.java:376)
W/ApplicationContext( 1541):    at android.content.ContextWrapper.getSharedPreferences(ContextWrapper.java:146)
W/ApplicationContext( 1541):    at net.robmunro.mypod.WelcomeActivity.onEWCreate(WelcomeActivity.java:160)
W/ApplicationContext( 1541):    at net.robmunro.mypod.AbstractEWActivity.onCreate(AbstractEWActivity.java:25)
W/ApplicationContext( 1541):    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
W/ApplicationContext( 1541):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1611)
W/ApplicationContext( 1541):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663)
W/ApplicationContext( 1541):    at android.app.ActivityThread.access$1500(ActivityThread.java:117)
W/ApplicationContext( 1541):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
W/ApplicationContext( 1541):    at android.os.Handler.dispatchMessage(Handler.java:99)
W/ApplicationContext( 1541):    at android.os.Looper.loop(Looper.java:123)
W/ApplicationContext( 1541):    at android.app.ActivityThread.main(ActivityThread.java:3683)
W/ApplicationContext( 1541):    at java.lang.reflect.Method.invokeNative(Native Method)
W/ApplicationContext( 1541):    at java.lang.reflect.Method.invoke(Method.java:507)
W/ApplicationContext( 1541):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
W/ApplicationContext( 1541):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
W/ApplicationContext( 1541):    at dalvik.system.NativeStart.main(Native Method)
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Are you able to reproduce this on emulator? If yes, then you could extract the prefs file using Eclipse DDMS tools to investigate the contents of the prefs file.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...