Bug 45896 - No static method Android.Text.Html.FromHtml exception
Summary: No static method Android.Text.Html.FromHtml exception
Status: CONFIRMED
Alias: None
Product: Android
Classification: Xamarin
Component: General (show other bugs)
Version: 7.3 (15.2)
Hardware: PC Windows
: Normal normal
Target Milestone: ---
Assignee: Jonathan Pryor
URL:
Depends on:
Blocks:
 
Reported: 2016-10-25 17:20 UTC by John Miller [MSFT]
Modified: 2017-07-06 19:25 UTC (History)
2 users (show)

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


Attachments
Sample Project (11.20 KB, application/x-rar)
2016-10-25 17:20 UTC, John Miller [MSFT]
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 for Bug 45896 on Developer Community or GitHub if you have new information to add and do not yet see a matching new report.

If the latest results still closely match this report, you can use the original description:

  • Export the original title and description: Developer Community HTML or GitHub Markdown
  • Copy the title and description into the new report. Adjust them to be up-to-date if needed.
  • Add your new information.

In special cases on GitHub you might also want the comments: GitHub Markdown with public comments

Related Links:
Status:
CONFIRMED

Description John Miller [MSFT] 2016-10-25 17:20:31 UTC
Created attachment 18221 [details]
Sample Project

**Overview**:

Calling Html.FromHtml causes an exception with recent updates of Xamarin.Android.

**Steps to Reproduce**:

1. Run the attached sample on a simulator/device.

**Actual Results**:

>Java.Lang.NoSuchMethodError: no static method "Landroid/text/Html;.fromHtml(Ljava/lang/String;I)Landroid/text/Spanned;"
>  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in >/Users/builder/data/lanes/3819/96c7ba6c/source/mono/mcs/class/referencesource/mscorlib/system/runtime/exceptionservices/exceptionservicescommon.cs:143 
>  at Java.Interop.JniEnvironment+StaticMethods.GetStaticMethodID (Java.Interop.JniObjectReference type, System.String name, System.String signature) [0x00068] in >/Users/builder/data/lanes/3819/96c7ba6c/source/Java.Interop/src/Java.Interop/Java.Interop/JniEnvironment.g.cs:12606 
>  at Java.Interop.JniType.GetStaticMethod (System.String name, System.String signature) [0x0000f] in /Users/builder/data/lanes/3819/96c7ba6c/source/Java.Interop/src/Java.Interop/Java.Interop/JniType.cs:248 
>  at Java.Interop.JniPeerMembers+JniStaticMethods.GetMethodInfo (System.String encodedMember) [0x0003f] in >/Users/builder/data/lanes/3819/96c7ba6c/source/Java.Interop/src/Java.Interop/Java.Interop/JniPeerMembers.JniStaticMethods.cs:33 
>  at Java.Interop.JniPeerMembers+JniStaticMethods.InvokeObjectMethod (System.String encodedMember, Java.Interop.JniArgumentValue* parameters) [0x00003] in >/Users/builder/data/lanes/3819/96c7ba6c/source/Java.Interop/src/Java.Interop/Java.Interop/JniPeerMembers.JniStaticMethods.cs:96 
>  at Android.Text.Html.FromHtml (System.String source, Android.Text.FromHtmlOptions flags) [0x00031] in /Users/builder/data/lanes/3819/96c7ba6c/source/monodroid/src/Mono.Android/platforms/android->24/src/generated/Android.Text.Html.cs:351 
>  at HtmlTest.MainActivity.ConvertText (System.String value) [0x00002] in C:\Users\johmil\Downloads\HtmlTest\HtmlTest\MainActivity.cs:52

**Expected Results**:

No exception.

**Build Date & Platform**:

Microsoft Visual Studio Enterprise 2015
Version 14.0.25431.01 Update 3
Microsoft .NET Framework
Version 4.6.01586

Installed Version: Enterprise

Xamarin   4.2.0.703 (3b7df6f)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin.Android   7.0.1.3 (96c7ba6)
Visual Studio extension to enable development for Xamarin.Android.

Xamarin.iOS   10.0.1.10 (ad1cd42)
Visual Studio extension to enable development for Xamarin.iOS.
Comment 1 Luigi Maestrelli 2017-01-16 11:17:36 UTC
I'm having the same problem.

Calling the FromHtml method without the flags works, but it it deprecated.

Xamarin 4.2.2.11
Xamarin.Android 7.0.2.42
Xamarin.iOS 10.3.1.8
Xamarin.Forms 2.3.3.180
Comment 2 Luigi Maestrelli 2017-02-10 18:32:25 UTC
Any news on this?
Comment 3 John Miller [MSFT] 2017-07-06 19:25:09 UTC
I am still able to reproduce using the sample project and the following version:

Microsoft Visual Studio Enterprise 2017 
Version 15.2 (26430.12) Release
VisualStudio.15.Release/15.2.0+26430.12
Microsoft .NET Framework
Version 4.7.02046

Installed Version: Enterprise

Xamarin   4.5.0.476 (1be4f0c)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin.Android SDK   7.3.1.2 (9dbc4c5)
Xamarin.Android Reference Assemblies and MSBuild support.

Xamarin.iOS and Xamarin.Mac SDK   10.10.0.35 (4cffddf)
Xamarin.iOS and Xamarin.Mac Reference Assemblies and MSBuild support.