Bug 12049 - LayoutChange and View.OnLayoutChangeListener give problems
Summary: LayoutChange and View.OnLayoutChangeListener give problems
Status: RESOLVED DUPLICATE of bug 12254
Alias: None
Product: Android
Classification: Xamarin
Component: BCL Class Libraries ()
Version: 4.8.x
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2013-05-01 05:07 UTC by Hugo Logmans
Modified: 2013-05-23 14:10 UTC (History)
2 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 DUPLICATE of bug 12254

Description Hugo Logmans 2013-05-01 05:07:42 UTC
This code (itemLijst is a linearlayout):
ItemLijst.LayoutChange += (object sender, View.LayoutChangeEventArgs e) => {
	Console.WriteLine("**** LayoutChange "+e.Top.ToString());
};

Gives this runtime error (more comments below stack trace):


Java.Lang.NoClassDefFoundError: mono.android.view.View_OnLayoutChangeListenerImplementor

  at Android.Runtime.JNIEnv.FindClass (string) [0x00087] in /Users/builder/data/lanes/monodroid-lion-bs1/03814ac5/source/monodroid/src/Mono.Android/src/Runtime/JNIEnv.cs:287

  at Android.Runtime.JNIEnv.CreateInstance (string,string,Android.Runtime.JValue[]) [0x00000] in /Users/builder/data/lanes/monodroid-lion-bs1/03814ac5/source/monodroid/src/Mono.Android/src/Runtime/JNIEnv.cs:215

  at at Android.Views.View/IOnLayoutChangeListenerImplementor..ctor () <IL 0x00011, 0x00057>

  at Android.Views.View.__CreateIOnLayoutChangeListenerImplementor () [0x00000] in /Users/builder/data/lanes/monodroid-lion-bs1/03814ac5/source/monodroid/src/Mono.Android/platforms/android-12/src/generated/Android.Views.View.cs:11974

  at at Java.Interop.AndroidEventHelper.AddEventHandler<Android.Views.View/IOnLayoutChangeListener, Android.Views.View/IOnLayoutChangeListenerImplementor> (System.WeakReference&,System.Func`1<Android.Views.View/IOnLayoutChangeListenerImplementor>,System.Action`1<Android.Views.View/IOnLayoutChangeListener>,System.Action`1<Android.Views.View/IOnLayoutChangeListenerImplementor>) <0x000d3>

  at Android.Views.View.add_LayoutChange (System.EventHandler`1<Android.Views.View/LayoutChangeEventArgs>) [0x0000d] in /Users/builder/data/lanes/monodroid-lion-bs1/03814ac5/source/monodroid/src/Mono.Android/platforms/android-12/src/generated/Android.Views.View.cs:11955

  at kluwermemoapp_android.ParagraafReader.OnCreate (Android.OS.Bundle) [0x000e6] in x:\kluwermemo\kluwermemoapp_android\kluwermemoapp_android\ParagraafReader.cs:71

  at Android.App.Activity.n_OnCreate_Landroid_os_Bundle_ (intptr,intptr,intptr) [0x00010] in /Users/builder/data/lanes/monodroid-lion-bs1/03814ac5/source/monodroid/src/Mono.Android/platforms/android-12/src/generated/Android.App.Activity.cs:1837

  at at (wrapper dynamic-method) object.aa41788f-9dce-4022-8170-fe92f21b1019 (intptr,intptr,intptr) <IL 0x00017, 0x0001f>

  at 

  at --- End of managed exception stack trace ---

  at java.lang.NoClassDefFoundError: mono.android.view.View_OnLayoutChangeListenerImplementor

  at 	at kluwermemoapp_android.ParagraafReader.n_onCreate(Native Method)

  at 	at kluwermemoapp_android.ParagraafReader.onCreate(ParagraafReader.java:29)

  at 	at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)

  at 	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1611)

  at 	at android.app.ActivityThread.startActivityNow(ActivityThread.java:1487)

  at 	at android.app.LocalActivityManager.moveToState(LocalActivityManager.java:127)

  at 	at android.app.LocalActivityManager.startActivity(LocalActivityManager.java:339)

  at 	at android.widget.TabHost$IntentContentStrategy.getContentView(TabHost.java:654)

  at 	at android.widget.TabHost.setCurrentTab(TabHost.java:326)

  at 	at android.widget.TabHost.setCurrentTabByTag(TabHost.java:263)

  at 	at mono.android.view.View_OnClickListenerImplementor.n_onClick(Native Method)

  at 	at mono.android.view.View_OnClickListenerImplementor.onClick(View_OnClickListenerImplementor.java:29)

  at 	at android.view.View.performClick(View.java:2485)

  at 	at android.view.View$PerformClick.run(View.java:9080)

  at 	at android.os.Handler.handleCallback(Handler.java:587)

  at 	at android.os.Handler.dispatchMessage(Handler.java:92)

  at 	at android.os.Looper.loop(Looper.java:130)

  at 	at android.app.ActivityThread.main(ActivityThread.java:3683)

  at 	at java.lang.reflect.Method.invokeNative(Native Method)

  at 	at java.lang.reflect.Method.invoke(Method.java:507)

  at 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)

  at 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)

  at 	at dalvik.system.NativeStart.main(Native Method)

  at Caused by: java.lang.ClassNotFoundException: mono.android.view.View_OnLayoutChangeListenerImplementor in loader dalvik.system.PathClassLoader[/data/app/nl.edb.kluwermemoapp_android-1.apk]

  at 	at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:240)

  at 	at java.lang.ClassLoader.loadClass(ClassLoader.java:551)

  at 	at java.lang.ClassLoader.loadClass(ClassLoader.java:511)

  at 	... 23 more

  at 


I also tried to add a event listener manually (by adding the View.IOnlayoutChangeListener to the class definition and adding the event), but that generates a compiler error (in the generated Java file!):

obj\Debug\android\src\kluwermemoapp_android\ParagraafReader.java(8,20): error :  error: cannot find symbol

obj\Debug\android\src\kluwermemoapp_android\ParagraafReader.java(8,20): error : 		android.view.View.OnLayoutChangeListener

obj\Debug\android\src\kluwermemoapp_android\ParagraafReader.java(8,20): error :   symbol:   class OnLayoutChangeListener

obj\Debug\android\src\kluwermemoapp_android\ParagraafReader.java(8,20): error :   location: class View

obj\Debug\android\src\kluwermemoapp_android\ParagraafReader.java(8,20): error :
Comment 1 Jonathan Pryor 2013-05-23 14:10:10 UTC

*** This bug has been marked as a duplicate of bug 12254 ***