Bug 17215 - Java.Lang.ClassNotFoundException IInputFilters
Summary: Java.Lang.ClassNotFoundException IInputFilters
Status: RESOLVED FIXED
Alias: None
Product: Visual Studio Extensions
Classification: Xamarin
Component: Android ()
Version: 3.1
Hardware: PC Windows
: Normal normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2014-01-14 00:16 UTC by pierre
Modified: 2016-12-22 17:37 UTC (History)
6 users (show)

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


Attachments
Sample for the crash (67.81 KB, application/octet-stream)
2014-07-02 01:38 UTC, pierre
Details


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 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 FIXED

Description pierre 2014-01-14 00:16:25 UTC
Hi,

The following line systematically throws me a "Java.Lang.ClassNotFoundException IInputFilters":

var androidEditText= new EditText(context);
androidEditText.SetFilters(new IInputFilter[] { new InputFilterLengthFilter(MaxLength) });

I am missing something or is it a problem from your side?

Thank you.
Comment 1 pierre 2014-07-01 21:58:32 UTC
Sorry is there any news for this bug??
Comment 2 Jonathan Pryor 2014-07-01 22:30:11 UTC
I'm unable to reproduce:

  using System;

  using Android.App;
  using Android.Content;
  using Android.Runtime;
  using Android.Views;
  using Android.Widget;
  using Android.OS;
  using Android.Text;

  namespace Scratch.Bxc17215 {
    [Activity (Label = "Scratch.Bxc17215",
        MainLauncher = true,
        Icon = "@drawable/icon")]
    public class MainActivity : Activity {
      int count = 1;

      protected override void OnCreate (Bundle bundle)
      {
        base.OnCreate (bundle);

        var androidEditText= new EditText(this);
        androidEditText.SetFilters(new IInputFilter[] {
          new InputFilterLengthFilter(100),
        });
        SetContentView (androidEditText);
      }
    }
  }

The above executes without any runtime error, in both Debug and Release configurations.

This resembles a bug in Mono for Android 4.0, which should have been fixed ~2.5 years ago:

http://lists.ximian.com/pipermail/monodroid/2011-December/007593.html
Comment 3 pierre 2014-07-02 01:38:03 UTC
After searching quite a bit, I could identify the element causing the problem. It was actually a side effect of the Visual Studio ".suo" file. After clearing it, it seems to work normally.

I will join a solution crashing at runtime. 

Please fix this issue for future.
Comment 4 pierre 2014-07-02 01:38:44 UTC
Created attachment 7259 [details]
Sample for the crash
Comment 5 pierre 2014-07-02 02:04:31 UTC
Actually with current mono version, it is not possible for us to use IInputFilter interface, because every time close the solution an invalid .suo file regenerated and we need to re-delete it by hand again and again.
Comment 6 Jose Gallardo 2016-12-22 17:37:28 UTC
Marking as resolved fixed.
Please feel free to reopen the issue if you can still reproduce it with current bits.
Thanks!