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 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.
My layout originally had a ScrollView as the root element defined in the axml file. I needed to make alterations to it's behaviour so created a new class that inherited from ScrollView called CusotmScrollView. I then replaced the ScrollView with a fully qualified reference to the CustomScrollView in the axml file i.e:
This resulted in a runtime error when the view was inflated with Java.Lang.ClassNotFoundException for the CustomScrollView.
My workaround was to add a FrameLayout as the root of the view wrapping my custom view:
This removed the error.
Created attachment 6488 [details]
One interesting thing is that Xamarin.Android has "fixup" logic to convert C# names within .axml files into the corresponding java ACW names, so that <Scratch.CustomRootView.MyScrollView/> becomes <scratch.customrootview.MyScrollView>.
That isn't happening if <Scratch.CustomRootView.MyScrollView/> is the root element. :-/
If I manually "fix" Resources\Layout\Main.axml file to use <scratch.customrootview.MyScrollView/> instead of <Scratch.CustomRootView.MyScrollView/>, then the sample works as expected.
It is because the root element isn't "fixed" that the ClassNotFoundException is generated.
Fixed. Thanks for the report.
Today, I have checked this issue with attached project in comment 1. Now this issue is not exists sample is runnig successfully, without any error.
Hence closing this issue.
=== Xamarin Studio ===
Version 5.3 (build 412)
Installation UUID: 3dbf10c4-ed30-4e55-8a8b-1704777c7b5f
Mono 3.8.0 ((no/9ffca33)
GTK+ 2.24.23 (Raleigh theme)
Package version: 308000002
=== Apple Developer Tools ===
Xcode 5.1 (5084)
=== Xamarin.Mac ===
Version: 220.127.116.11 (Enterprise Edition)
=== Xamarin.iOS ===
Version: 18.104.22.168 (Enterprise Edition)
Build date: 2014-08-01 15:27:48-0400
=== Xamarin.Android ===
Version: 4.16.0 (Enterprise Edition)
Android SDK: /Users/apprpject/Desktop/android-sdk-macosx
Supported Android versions:
2.1 (API level 7)
2.2 (API level 8)
2.3 (API level 10)
3.1 (API level 12)
3.2 (API level 13)
4.0 (API level 14)
4.0.3 (API level 15)
4.1 (API level 16)
4.2 (API level 17)
4.3 (API level 18)
4.4 (API level 19)
Java SDK: /usr
java version "1.6.0_65"
Java(TM) SE Runtime Environment (build 1.6.0_65-b14-462-11M4609)
Java HotSpot(TM) 64-Bit Server VM (build 20.65-b04-462, mixed mode)
=== Build Information ===
Release ID: 503000412
Git revision: 77e042831804079a649ee83092ed36c7c10773a2
Build date: 2014-08-01 06:32:22-04
Xamarin addins: 57e379e6a9454a1c0d97aa3f770e7ae7cc16c522
=== Operating System ===
Mac OS X 10.8.5
Darwin localhost 12.5.0 Darwin Kernel Version 12.5.0
Sun Sep 29 13:33:47 PDT 2013