Bug 2466 - ListPreference SetEntries and SetEntryValues not working in RELEASE mode
Summary: ListPreference SetEntries and SetEntryValues not working in RELEASE mode
Status: RESOLVED NORESPONSE
Alias: None
Product: Android
Classification: Xamarin
Component: BCL Class Libraries ()
Version: 4.0
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2011-12-12 14:56 UTC by Neal
Modified: 2013-11-20 09:21 UTC (History)
4 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED NORESPONSE

Description Neal 2011-12-12 14:56:09 UTC
Hello,

I have code that worked in prior MD versions but now in MD 4 in RELEASE (linking enabled) mode it's broke!  I have a simple List<string> that I assign to a ListPreference via the SetEntries and SetEntryValues:

MyListPref.SetEntryValues(Mylist.ToArray());

It works in DEBUG but in RELEASE it's not happening! Linker issue?

thanks.
Comment 1 Neal 2011-12-12 15:44:13 UTC
47.897 29551 29551 I LOGBOOK PRO: 12/12/2011 3:41:47 PM	Message: Exception of type 'Java.Lang.NoClassDefFoundError' was thrown.
12-12 15:41:47.897 29551 29551 I LOGBOOK PRO: Exception: Java.Lang.NoClassDefFoundError: Exception of type 'Java.Lang.NoClassDefFoundError' was thrown.
12-12 15:41:47.897 29551 29551 I LOGBOOK PRO:   at Android.Runtime.JNIEnv.FindClass (System.String classname) [0x00000] in <filename unknown>:0 
12-12 15:41:47.897 29551 29551 I LOGBOOK PRO:   at Android.Runtime.JNIEnv.FindClass (System.Type type) [0x00000] in <filename unknown>:0 
12-12 15:41:47.897 29551 29551 I LOGBOOK PRO:   --- End of managed exception stack trace ---
12-12 15:41:47.897 29551 29551 I LOGBOOK PRO: java.lang.NoClassDefFoundError: java.lang.ICharSequence
12-12 15:41:47.897 29551 29551 I LOGBOOK PRO: 	at logbookpro.PreferencesSI.n_onCreate(Native Method)
12-12 15:41:47.897 29551 29551 I LOGBOOK PRO: 	at logbookpro.PreferencesSI.onCreate(PreferencesSI.java:30)
12-12 15:41:47.897 29551 29551 I LOGBOOK PRO: 	at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
12-12 15:41:47.897 29551 29551 I LOGBOOK PRO: 	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1660)
12-12 15:41:47.897 29551 29551 I LOGBOOK PRO: 	at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1716)
12-12 15:41:47.897 29551 29551 I LOGBOOK PRO: 	at android.app.ActivityThread.access$1500(ActivityThread.java:124)
12-12 15:41:47.897 29551 29551 I LOGBOOK PRO: 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:968)
12-12 15:41:47.897 29551 29551 I LOGBOOK PRO: 	at android.os.Handler.dispatchMessage(Handler.java:99)
12-12 15:41:47.897 29551 29551 I LOGBOOK PRO: 	at android.os.Looper.loop(Looper.java:123)
12-12 15:41:47.897 29551 29551 I LOGBOOK PRO: 	at android.app.ActivityThread.main(ActivityThread.java:3806)
12-12 15:41:47.897 29551 29551 I LOGBOOK PRO: 	at java.lang.reflect.Method.invokeNative(Native Method)
12-12 15:41:47.897 29551 29551 I LOGBOOK PRO: 	at java.lang.reflect.Method.invoke(Method.java:507)
12-12 15:41:47.897 29551 29551 I LOGBOOK PRO: 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
12-12 15:41:47.897 29551 29551 I LOGBOOK PRO: 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
12-12 15:41:47.897 29551 29551 I LOGBOOK PRO: 	at dalvik.system.NativeStart.main(Native Method)
12-12 15:41:47.897 29551 29551 I LOGBOOK PRO: Caused by: java.lang.ClassNotFoundException: java.lang.ICharSequence in loader dalvik.system.PathClassLoader[/data/app/com.logbookpro.android-2.apk]
12-12 15:41:47.897 29551 29551 I LOGBOOK PRO: 	at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:240)
12-12 15:41:47.897 29551 29551 I LOGBOOK PRO: 	at java.lang.ClassLoader.loadClass(ClassLoader.java:551)
12-12 15:41:47.897 29551 29551 I LOGBOOK PRO: 	at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
12-12 15:41:47.897 29551 29551 I LOGBOOK PRO: 	... 15 more
12-12 15:41:47.897 29551 29551 I LOGBOOK PRO: 
12-12 15:41:47.897 29551 29551 I LOGBOOK PRO: Method: PreferencesSI
12-12 15:41:47.952  1397  1397 D RadioSignalLevel: evdo dbmLevel: 4, snrLevel: 4
12-12 15:41:48.460  1321  1352 I ActivityManager: Displayed com.logbookpro.android/logbookpro.PreferencesSI: +778ms
12-12 15:41:49.936 29551 29551 D AndroidRuntime: Shutting down VM
12-12 15:41:49.936 29551 29551 W dalvikvm: threadid=1: thread exiting with uncaught exception (group=0x40018560)
12-12 15:41:49.952 29551 29551 E AndroidRuntime: FATAL EXCEPTION: main
12-12 15:41:49.952 29551 29551 E AndroidRuntime: java.lang.IllegalStateException: ListPreference requires an entries array and an entryValues array.
12-12 15:41:49.952 29551 29551 E AndroidRuntime: 	at android.preference.ListPreference.onPrepareDialogBuilder(ListPreference.java:186)
12-12 15:41:49.952 29551 29551 E AndroidRuntime: 	at android.preference.DialogPreference.showDialog(DialogPreference.java:293)
12-12 15:41:49.952 29551 29551 E AndroidRuntime: 	at android.preference.DialogPreference.onClick(DialogPreference.java:264)
12-12 15:41:49.952 29551 29551 E AndroidRuntime: 	at android.preference.Preference.performClick(Preference.java:810)
12-12 15:41:49.952 29551 29551 E AndroidRuntime: 	at android.preference.PreferenceScreen.onItemClick(PreferenceScreen.java:236)
12-12 15:41:49.952 29551 29551 E AndroidRuntime: 	at android.widget.AdapterView.performItemClick(AdapterView.java:290)
12-12 15:41:49.952 29551 29551 E AndroidRuntime: 	at android.widget.ListView.performItemClick(ListView.java:3597)
12-12 15:41:49.952 29551 29551 E AndroidRuntime: 	at android.widget.AbsListView$PerformClick.run(AbsListView.java:1838)
12-12 15:41:49.952 29551 29551 E AndroidRuntime: 	at android.os.Handler.handleCallback(Handler.java:587)
12-12 15:41:49.952 29551 29551 E AndroidRuntime: 	at android.os.Handler.dispatchMessage(Handler.java:92)
12-12 15:41:49.952 29551 29551 E AndroidRuntime: 	at android.os.Looper.loop(Looper.java:123)
12-12 15:41:49.952 29551 29551 E AndroidRuntime: 	at android.app.ActivityThread.main(ActivityThread.java:3806)
12-12 15:41:49.952 29551 29551 E AndroidRuntime: 	at java.lang.reflect.Method.invokeNative(Native Method)
12-12 15:41:49.952 29551 29551 E AndroidRuntime: 	at java.lang.reflect.Method.invoke(Method.java:507)
12-12 15:41:49.952 29551 29551 E AndroidRuntime: 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
12-12 15:41:49.952 29551 29551 E AndroidRuntime: 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
12-12 15:41:49.952 29551 29551 E AndroidRuntime: 	at dalvik.system.NativeStart.main(Native Method)
12-12 15:41:49.967  1321  1321 W ActivityManager:   Force finishing activity com.logbookpro.android/logbookpro.PreferencesSI
Comment 3 Atsushi Eno 2012-04-18 05:15:25 UTC
Setting as NEEDINFO.
Comment 4 Jeremy Kolb 2013-06-06 11:50:09 UTC
I just hit this running 4.6.8 on VS 2012 on a debug build.

Java.Lang.ClassNotFoundException: 
Exception:

Java.Lang.NoClassDefFoundError: java/lang/ICharSequence


 	0x8D in Android.Runtime.JNIEnv.FindClass at /Users/builder/data/lanes/monodroid-lion-bs1/0cc7ae3b/source/monodroid/src/Mono.Android/src/Runtime/JNIEnv.cs:287	C#
 	0x15 in Android.Runtime.JNIEnv.FindClass at /Users/builder/data/lanes/monodroid-lion-bs1/0cc7ae3b/source/monodroid/src/Mono.Android/src/Runtime/JNIEnv.cs:245	C#
 	0x17 in Android.Runtime.JNIEnv.NewArray at /Users/builder/data/lanes/monodroid-lion-bs1/0cc7ae3b/source/monodroid/src/Mono.Android/src/Runtime/JNIEnv.cs:1150	C#
 	0x6 in Android.Runtime.JNIEnv.AnonymousMethod__B1 at /Users/builder/data/lanes/monodroid-lion-bs1/0cc7ae3b/source/monodroid/src/Mono.Android/src/Runtime/JNIEnv.cs:1186	C#
 	0x4D in Android.Runtime.JNIEnv.NewArray at /Users/builder/data/lanes/monodroid-lion-bs1/0cc7ae3b/source/monodroid/src/Mono.Android/src/Runtime/JNIEnv.cs:1234	C#
 	0x2E in Android.App.AlertDialog.Builder.SetMultiChoiceItems at /Users/builder/data/lanes/monodroid-lion-bs1/0cc7ae3b/source/monodroid/src/Mono.Android/platforms/android-14/src/generated/Android.App.AlertDialog.cs:656	C#
 	0xB in Android.App.AlertDialog.Builder.SetMultiChoiceItems at /Users/builder/data/lanes/monodroid-lion-bs1/0cc7ae3b/source/monodroid/src/Mono.Android/platforms/android-14/src/generated/Android.App.AlertDialog.cs:678	C#
 	0x11 in Android.App.AlertDialog.Builder.SetMultiChoiceItems at /Users/builder/data/lanes/monodroid-lion-bs1/0cc7ae3b/source/monodroid/src/Mono.Android/src/Android.App/AlertDialog.cs:122	C#
>	0x8B in InstantNotification.Android.Activities.CommonOptionsActivity.ConfigListItemClicked at c:\Projects\INS_Android_Mono_git\InstantNotification.Android\Activities\CommonOptionsActivity.cs:167	C#
Comment 5 Jonathan Pryor 2013-06-19 16:31:36 UTC
@jkolb: Please attach a reproducible test case with instructions on how to generate the ClassNotFoundException.

Are you Debugging the app? Are you catching all exceptions? Please note that it is normal for some exceptions to be generated; they will be caught and handled internally.
Comment 6 PJ 2013-11-19 17:05:02 UTC
This bug has been in the NEEDINFO state with no changes for the last 90 days. Can we put this back into the NEW or CONFIRMED state, or are we still awaiting response?

If there is no change in the status of this bug over the next two weeks, this bug will be marked as NORESPONSE.
Comment 7 Neal 2013-11-20 09:21:19 UTC
It's been a long time since I posted this, nearly two years, I'm not sure if it's an issue or not.  I'll just close it and reopen again if it ever comes up again.  I've obviously worked around it if it is an issue, it probably isn't in what has transpired over two years now.