Bug 56092 - NoClassDefFoundError
Summary: NoClassDefFoundError
Status: RESOLVED NORESPONSE
Alias: None
Product: Android
Classification: Xamarin
Component: Android+BCL Integration ()
Version: 7.1 (C9)
Hardware: Macintosh Mac OS
: Normal normal
Target Milestone: ---
Assignee: Marek Habersack
URL:
Depends on:
Blocks:
 
Reported: 2017-05-08 10:18 UTC by Alessandro
Modified: 2017-08-23 21:04 UTC (History)
2 users (show)

Tags: bb
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 Alessandro 2017-05-08 10:18:50 UTC
I am trying to use these two instructions.

int x = Settings.Global.GetInt(Forms.Context.ContentResolver, Settings.Global.AutoTime);
int x = Settings.Global.GetInt(Forms.Context.ContentResolver, Settings.Global.AutoTimeZone);


On a Samsung s2 GT-I9100 Android 4.1.2 I have an exception

> ex
{Java.Lang.NoClassDefFoundError: android/provider/Settings$Global ---> Java.Lang.ClassNotFoundException: android.provider.Settings$Global
   --- End of inner exception stack trace ---
  at Java.Interop.JniEnvironment+Types.FindClass (System.String classname) [0x00132] in /Users/builder/data/lanes/4009/9578cdcd/source/Java.Interop/src/Java.Interop/Java.Interop/JniEnvironment.Types.cs:66 
  at Java.Interop.JniType..ctor (System.String classname) [0x00008] in /Users/builder/data/lanes/4009/9578cdcd/source/Java.Interop/src/Java.Interop/Java.Interop/JniType.cs:30 
  at Java.Interop.JniType.GetCachedJniType (Java.Interop.JniType& cachedType, System.String classname) [0x00025] in /Users/builder/data/lanes/4009/9578cdcd/source/Java.Interop/src/Java.Interop/Java.Interop/JniType.cs:84 
  at Java.Interop.JniPeerMembers.get_JniPeerType () [0x0000d] in /Users/builder/data/lanes/4009/9578cdcd/source/Java.Interop/src/Java.Interop/Java.Interop/JniPeerMembers.cs:76 
  at Java.Interop.JniPeerMembers+JniStaticMethods.GetMethodInfo (System.String encodedMember) [0x00037] in /Users/builder/data/lanes/4009/9578cdcd/source/Java.Interop/src/Java.Interop/Java.Interop/JniPeerMembers.JniStaticMethods.cs:33 
  at Java.Interop.JniPeerMembers+JniStaticMethods.InvokeInt32Method (System.String encodedMember, Java.Interop.JniArgumentValue* parameters) [0x00003] in /Users/builder/data/lanes/4009/9578cdcd/source/Java.Interop/src/Java.Interop/Java.Interop/JniPeerMembers.JniStaticMethods.cs:72 
  at Android.Provider.Settings+Global.GetInt (Android.Content.ContentResolver cr, System.String name) [0x00046] in /Users/builder/data/lanes/4009/9578cdcd/source/monodroid/src/Mono.Android/platforms/android-25/src/generated/Android.Provider.Settings.cs:565 
  at IWapp.Droid.Network.FlagTimeZone () [0x00011] in /Users/alessandrocaliaro/Projects/Soluzione1/GeoBadge/Droid/Network.cs:30 
  --- End of managed Java.Lang.NoClassDefFoundError stack trace ---
java.lang.NoClassDefFoundError: android/provider/Settings$Global
	at md5b60ffeb829f638581ab2bb9b1a7f4f3f.ButtonRenderer_ButtonClickListener.n_onClick(Native Method)
	at md5b60ffeb829f638581ab2bb9b1a7f4f3f.ButtonRenderer_ButtonClickListener.onClick(ButtonRenderer_ButtonClickListener.java:30)
	at android.view.View.performClick(View.java:4232)
	at android.view.View$PerformClick.run(View.java:17298)
	at android.os.Handler.handleCallback(Handler.java:615)
	at android.os.Handler.dispatchMessage(Handler.java:92)
	at android.os.Looper.loop(Looper.java:137)
	at android.app.ActivityThread.main(ActivityThread.java:4921)
	at java.lang.reflect.Method.invokeNative(Native Method)
	at java.lang.reflect.Method.invoke(Method.java:511)
	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1027)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:794)
	at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.ClassNotFoundException: android.provider.Settings$Global
	at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:61)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
	... 13 more
}
	Cause: {Java.Lang.ClassNotFoundException: android.provider.Settings$Global
  --- End of managed Java.Lang.ClassNotFoundException stack trace ---
java.lang.ClassNotFoundException: android.provider.Settings$Global
	at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:61)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
	at md5b60ffeb829f638581ab2bb9b1a7f4f3f.ButtonRenderer_ButtonClickListener.n_onClick(Native Method)
	at md5b60ffeb829f638581ab2bb9b1a7f4f3f.ButtonRenderer_ButtonClickListener.onClick(ButtonRenderer_ButtonClickListener.java:30)
	at android.view.View.performClick(View.java:4232)
	at android.view.View$PerformClick.run(View.java:17298)
	at android.os.Handler.handleCallback(Handler.java:615)
	at android.os.Handler.dispatchMessage(Handler.java:92)
	at android.os.Looper.loop(Looper.java:137)
	at android.app.ActivityThread.main(ActivityThread.java:4921)
	at java.lang.reflect.Method.invokeNative(Native Method)
	at java.lang.reflect.Method.invoke(Method.java:511)
	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1027)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:794)
	at dalvik.system.NativeStart.main(Native Method)
}
	Class: {class java.lang.NoClassDefFoundError}
	Data: {System.Collections.ListDictionaryInternal}
	HResult: -2146233088
	Handle: 0x1d300c72
	HelpLink: (null)
	InnerException: {Java.Lang.ClassNotFoundException: android.provider.Settings$Global
  --- End of managed Java.Lang.ClassNotFoundException stack trace ---
java.lang.ClassNotFoundException: android.provider.Settings$Global
	at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:61)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
	at md5b60ffeb829f638581ab2bb9b1a7f4f3f.ButtonRenderer_ButtonClickListener.n_onClick(Native Method)
	at md5b60ffeb829f638581ab2bb9b1a7f4f3f.ButtonRenderer_ButtonClickListener.onClick(ButtonRenderer_ButtonClickListener.java:30)
	at android.view.View.performClick(View.java:4232)
	at android.view.View$PerformClick.run(View.java:17298)
	at android.os.Handler.handleCallback(Handler.java:615)
	at android.os.Handler.dispatchMessage(Handler.java:92)
	at android.os.Looper.loop(Looper.java:137)
	at android.app.ActivityThread.main(ActivityThread.java:4921)
	at java.lang.reflect.Method.invokeNative(Native Method)
	at java.lang.reflect.Method.invoke(Method.java:511)
	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1027)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:794)
	at dalvik.system.NativeStart.main(Native Method)
}
	IsProxy: false
	JniIdentityHashCode: 1110627160
	JniManagedPeerState: Java.Interop.JniManagedPeerStates.None
	JniPeerMembers (Java.Lang.NoClassDefFoundError): {Android.Runtime.XAPeerMembers}
	JniPeerMembers (Java.Lang.Throwable): {Android.Runtime.XAPeerMembers}
	JniPeerMembers (Java.Lang.Error): {Android.Runtime.XAPeerMembers}
	JniPeerMembers (Java.Lang.LinkageError): {Android.Runtime.XAPeerMembers}
	KeyHandle: 0x4232d358
	LocalizedMessage: "android/provider/Settings$Global"
	Message (System.Exception): "android/provider/Settings$Global"
	Message (Java.Lang.Throwable): "android/provider/Settings$Global"
	NeedsActivation: false
	PeerReference: {0x1d300c72/G}
	Source: "Java.Interop"
	StackTrace (Java.Lang.Throwable): "  at Java.Interop.JniEnvironment+Types.FindClass (System.String classname) [0x00132] in /Users/builder/data/lanes/4009/9578cdcd/source/Java.Interop/src/Java.Interop/Java.Interop/JniEnvironment.Types.cs:66 \n  at Java.Interop.JniType..ctor (System.String classname) [0x00008] in /Users/builder/data/lanes/4009/9578cdcd/source/Java.Interop/src/Java.Interop/Java.Interop/JniType.cs:30 \n  at Java.Interop.JniType.GetCachedJniType (Java.Interop.JniType& cachedType, System.String classname) [0x00025] in /Users/builder/data/lanes/4009/9578cdcd/source/Java.Interop/src/Java.Interop/Java.Interop/JniType.cs:84 \n  at Java.Interop.JniPeerMembers.get_JniPeerType () [0x0000d] in /Users/builder/data/lanes/4009/9578cdcd/source/Java.Interop/src/Java.Interop/Java.Interop/JniPeerMembers.cs:76 \n  at Java.Interop.JniPeerMembers+JniStaticMethods.GetMethodInfo (System.String encodedMember) [0x00037] in /Users/builder/data/lanes/4009/9578cdcd/source/Java.Interop/src/Java.Interop/Java.Interop/JniPeerMembers.JniStaticMethods.cs:33 \n  at Java.Interop.JniPeerMembers+JniStaticMethods.InvokeInt32Method (System.String encodedMember, Java.Interop.JniArgumentValue* parameters) [0x00003] in /Users/builder/data/lanes/4009/9578cdcd/source/Java.Interop/src/Java.Interop/Java.Interop/JniPeerMembers.JniStaticMethods.cs:72 \n  at Android.Provider.Settings+Global.GetInt (Android.Content.ContentResolver cr, System.String name) [0x00046] in /Users/builder/data/lanes/4009/9578cdcd/source/monodroid/src/Mono.Android/platforms/android-25/src/generated/Android.Provider.Settings.cs:565 \n  at IWapp.Droid.Network.FlagTimeZone () [0x00011] in /Users/alessandrocaliaro/Projects/Soluzione1/GeoBadge/Droid/Network.cs:30 \n  --- End of managed Java.Lang.NoClassDefFoundError stack trace ---\njava.lang.NoClassDefFoundError: android/provider/Settings$Global\n\tat md5b60ffeb829f638581ab2bb9b1a7f4f3f.ButtonRenderer_ButtonClickListener.n_onClick(Native Method)\n\tat md5b60ffeb829f638581ab2bb9b1a7f4f3f.ButtonRenderer_ButtonClickListener.onClick(ButtonRenderer_ButtonClickListener.java:30)\n\tat android.view.View.performClick(View.java:4232)\n\tat android.view.View$PerformClick.run(View.java:17298)\n\tat android.os.Handler.handleCallback(Handler.java:615)\n\tat android.os.Handler.dispatchMessage(Handler.java:92)\n\tat android.os.Looper.loop(Looper.java:137)\n\tat android.app.ActivityThread.main(ActivityThread.java:4921)\n\tat java.lang.reflect.Method.invokeNative(Native Method)\n\tat java.lang.reflect.Method.invoke(Method.java:511)\n\tat com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1027)\n\tat com.android.internal.os.ZygoteInit.main(ZygoteInit.java:794)\n\tat dalvik.system.NativeStart.main(Native Method)\nCaused by: java.lang.ClassNotFoundException: android.provider.Settings$Global\n\tat dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:61)\n\tat java.lang.ClassLoader.loadClass(ClassLoader.java:501)\n\tat java.lang.ClassLoader.loadClass(ClassLoader.java:461)\n\t... 13 more\n"
	StackTrace (System.Exception): "  at Java.Interop.JniEnvironment+Types.FindClass (System.String classname) [0x00132] in /Users/builder/data/lanes/4009/9578cdcd/source/Java.Interop/src/Java.Interop/Java.Interop/JniEnvironment.Types.cs:66 \n  at Java.Interop.JniType..ctor (System.String classname) [0x00008] in /Users/builder/data/lanes/4009/9578cdcd/source/Java.Interop/src/Java.Interop/Java.Interop/JniType.cs:30 \n  at Java.Interop.JniType.GetCachedJniType (Java.Interop.JniType& cachedType, System.String classname) [0x00025] in /Users/builder/data/lanes/4009/9578cdcd/source/Java.Interop/src/Java.Interop/Java.Interop/JniType.cs:84 \n  at Java.Interop.JniPeerMembers.get_JniPeerType () [0x0000d] in /Users/builder/data/lanes/4009/9578cdcd/source/Java.Interop/src/Java.Interop/Java.Interop/JniPeerMembers.cs:76 \n  at Java.Interop.JniPeerMembers+JniStaticMethods.GetMethodInfo (System.String encodedMember) [0x00037] in /Users/builder/data/lanes/4009/9578cdcd/source/Java.Interop/src/Java.Interop/Java.Interop/JniPeerMembers.JniStaticMethods.cs:33 \n  at Java.Interop.JniPeerMembers+JniStaticMethods.InvokeInt32Method (System.String encodedMember, Java.Interop.JniArgumentValue* parameters) [0x00003] in /Users/builder/data/lanes/4009/9578cdcd/source/Java.Interop/src/Java.Interop/Java.Interop/JniPeerMembers.JniStaticMethods.cs:72 \n  at Android.Provider.Settings+Global.GetInt (Android.Content.ContentResolver cr, System.String name) [0x00046] in /Users/builder/data/lanes/4009/9578cdcd/source/monodroid/src/Mono.Android/platforms/android-25/src/generated/Android.Provider.Settings.cs:565 \n  at IWapp.Droid.Network.FlagTimeZone () [0x00011] in /Users/alessandrocaliaro/Projects/Soluzione1/GeoBadge/Droid/Network.cs:30 \n  --- End of managed Java.Lang.NoClassDefFoundError stack trace ---\njava.lang.NoClassDefFoundError: android/provider/Settings$Global\n\tat md5b60ffeb829f638581ab2bb9b1a7f4f3f.ButtonRenderer_ButtonClickListener.n_onClick(Native Method)\n\tat md5b60ffeb829f638581ab2bb9b1a7f4f3f.ButtonRenderer_ButtonClickListener.onClick(ButtonRenderer_ButtonClickListener.java:30)\n\tat android.view.View.performClick(View.java:4232)\n\tat android.view.View$PerformClick.run(View.java:17298)\n\tat android.os.Handler.handleCallback(Handler.java:615)\n\tat android.os.Handler.dispatchMessage(Handler.java:92)\n\tat android.os.Looper.loop(Looper.java:137)\n\tat android.app.ActivityThread.main(ActivityThread.java:4921)\n\tat java.lang.reflect.Method.invokeNative(Native Method)\n\tat java.lang.reflect.Method.invoke(Method.java:511)\n\tat com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1027)\n\tat com.android.internal.os.ZygoteInit.main(ZygoteInit.java:794)\n\tat dalvik.system.NativeStart.main(Native Method)\nCaused by: java.lang.ClassNotFoundException: android.provider.Settings$Global\n\tat dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:61)\n\tat java.lang.ClassLoader.loadClass(ClassLoader.java:501)\n\tat java.lang.ClassLoader.loadClass(ClassLoader.java:461)\n\t... 13 more\n"
	TargetSite: {Java.Interop.JniObjectReference FindClass(System.String)}
	Static members: 
	Non-public members: 
>
Comment 1 Alessandro 2017-05-08 12:07:36 UTC
I think the problem is

Added in API level 17

and I use Android 4.1.X (should be API level 16). Is this the problem?

How can I check AutoTime and AutoTimeZone in API level 16?
Comment 2 Mark McLemore 2017-06-23 22:17:23 UTC
Thank you for taking the time to submit the bug. We are unable to reproduce this issue. Please attach a reproduction to the bug by starting with a clean project and adding just the code necessary to demonstrate the issue.

Also, the broader developer community is the best and quickest place for answers to questions such as how to check AutoTime and AutoTimeZone. Posting a question on Stack Overflow [0] or the Xamarin Forums [1] would be the best next step.

[0] http://stackoverflow.com/questions/tagged/xamarin
[1] https://forums.xamarin.com/
Comment 3 Cody Beyer (MSFT) 2017-08-23 21:04:09 UTC
Because we have not received a reply to our request for more information we are closing this issue. If you are still encountering this issue, please reopen the ticket with the requested information. Thanks!