Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
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
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 17342 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
In special cases on GitHub you might also want the comments:
GitHub Markdown with public comments
Created attachment 5877 [details]
I wouldn't be surprised if this has come up before, but I haven't found another bug report for it. Feel free to mark as a duplicate, or WONTFIX.
When a class has an Android Callable Wrapper, it is accessible from .axml layout files using _either_ the fully qualified Java name, or the fully qualified C# name.
When a class does _not_ have an ACW (for example, a bound type from an Android binding project), it is only accessible from .axml files by using the fully qualified Java name.
## Steps to reproduce
1. Build and run the attached test case.
### Result: error
> Android.Views.InflateException: Binary XML file line #1: Error inflating class TestAndroidLib.MyJavaView
... and in the Java stack trace:
> Caused by: java.lang.ClassNotFoundException: TestAndroidLib.MyJavaView
2. Replace "TestAndroidLib.MyJavaView" in Main.axml with each of the following values. In each case, rebuild and run the the app to test.
### Result: success
In all three cases, the app builds and runs without error. Note that the MyView class is a C# subclass of the Android.Views.View class. As a result, the user may refer to MyView in Main.axml using either the fully qualified C# name or the fully qualified Java name.
## Possible improvements
Perhaps some extra trick could be added to allow the use of fully qualified C# names in .axml files for types that lack Android Callable Wrappers?
Cannot reproduce with the latest alpha (4.12) on Mac or Windows. I don't think we have changed the resource builds so I doubt in general but could you please try the latest alpha and see if it reproduces?
XamarinVS.Android 4.12.00022 on Windows
Xamarin.Android 4.12.0-22 on Mac
Xamarin.Android 4.12.0-12 on Mac
Checked with 4.12.0-22 on both and Android 4.1.2 device, and Android 4.4 device. Note that the error only happens at run time. I wasn't too clear about that before.
I forgot to set this to "NEW" after replying with the extra information.
To give another small update, I've just checked that the behavior is still the same on Xamarin.Android 4.13.0-180 on Mac, on both an Android 4.3 emulator and an Android 4.1.2 device.
This looks like a dupe of Bug #2257, and may be fixed in 4.16.
Thank you for taking the time to submit this report. After reviewing the description of this bug, we believe it no longer affects the current version of Xamarin.Android. If you are still experiencing the issue after updating your packages, please reopen this report with an attached reproduction.
## Verification status: this enhancement is not currently implemented
> "BAD": Xamarin.Android 18.104.22.168 (5f3167a) (unpublished candidate for the next "15.3 release" Beta version)
## "BAD" results when using "TestAndroidLib.MyJavaView" in Main.axml
Excerpt from the stack trace:
[MonoDroid] Android.Views.InflateException: Binary XML file line #1: Binary XML file line #1: Error inflating class TestAndroidLib.MyJavaView ---> Android.Views.InflateException: Binary XML file line #1: Error inflating class TestAndroidLib.MyJavaView ---> Java.Lang.ClassNotFoundException: Didn't find class "TestAndroidLib.MyJavaView" on path: DexPathList[[zip file "/data/app/RegisterLayoutTest.RegisterLayoutTest-1/base.apk"],nativeLibraryDirectories=[/data/app/RegisterLayoutTest.RegisterLayoutTest-1/lib/x86, /data/app/RegisterLayoutTest.RegisterLayoutTest-1/base.apk!/lib/x86, /vendor/lib, /system/lib]]
## GOOD results when using each of the options A-C from Comment 0
The app builds and runs without error.
## Additional testing environment info
Mono 22.214.171.124 (2017-04/4498dc4) (64-bit)
Android SDK Tools Version: 25.2.5
Android SDK Platform Tools Version: 25.0.3
Android SDK Build Tools Version: 25
Java JDK 8u65 (1.8.0_65), 64-bit
Google Android API 23 x86 emulator