-
Notifications
You must be signed in to change notification settings - Fork 528
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to inflate a layout which has custom controls with mixed naming casing and is included through a library project reference #1711
Comments
Seemingly related, the regression test for https://bugzilla.xamarin.com/show_bug.cgi?id=23167 is also now failing against d15-8. The Library project XML in this test case is not updated after building: Expected: <md550ea669608a313e95b5e9acf6457423f.MyView android:id="@+id/myView" android:layout_width="fill_parent" android:layout_height="wrap_content" /></LinearLayout> Actual: <Scratch.Views.MyView android:id="@+id/myView" android:layout_width="fill_parent" android:layout_height="wrap_content" /> |
What'd odd to me is my diagnostic build output:
I find this odd because I don't have a $ find obj -name custom_te\*
obj/Debug/lp/0/jl/res/layout/custom_text.xml Additionally, the above file is "badly formatted" -- implying it's been hit by a tool, as everything is on one line -- but the elements haven't been properly fixed up: <LinearLayout android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" xmlns:android="http://schemas.android.com/apk/res/android"><classlibrary1.CustomTextView android:id="@+id/myText1" android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="namespace_lower" /><ClassLibrary1.CustomTextView android:id="@+id/myText2" android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="namespace_proper" /></LinearLayout> Manually formatting that: <LinearLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
xmlns:android="http://schemas.android.com/apk/res/android">
<classlibrary1.CustomTextView
android:id="@+id/myText1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="namespace_lower"
/>
<ClassLibrary1.CustomTextView
android:id="@+id/myText2"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="namespace_proper"
/>
</LinearLayout> This is messed up. :-(
|
PR is up #1718. |
…e fixed up. Context dotnet#1711 When using a custom view within a layout file we replace the `namespace.classname` with an `md5hash.classname`. We do this by using the `acwmap.txt` file to make known types onto the `md5` hashed ones. We do this in a case sensitive manner. We also only support Camel case and lower case type names. ClassLibrary1.CustomView=md5d6f7135293df7527c983d45d07471c5e.CustomTextView classlibrary1.CustomView=md5d6f7135293df7527c983d45d07471c5e.CustomTextView Given that a user is able to type these manually it is highly probable that typo's will occur. If for example a user types Classlibrary1.CustomView this will NOT be fixed up. Instead the user will recieve the following error at runtime. FATAL UNHANDLED EXCEPTION: Android.Views.InflateException: Binary XML file line #1: Binary XML file line #1: Error inflating class Classlibrary1.CustomTextView ---> Android.Views.InflateException: Binary XML file line #1: Error inflating class Classlibrary1.CustomTextView ---> Java.Lang.ClassNotFoundException: Didn't find class "Classlibrary1.CustomTextView" if you are using the control in a number of places this runtime error does nothing to help track down the problem. Instead what we should be doing is detecting these issues and emitting a build error. This will provide the user not only the problem but also a link to the file causing the probem. TODO ---- [ ] Fix up the name so it points to the file in `Resources` not `res` [ ] Add a Unit test. [ ] Add Error code and document.
…e fixed up. Context dotnet#1711 When using a custom view within a layout file we replace the `namespace.classname` with an `md5hash.classname`. We do this by using the `acwmap.txt` file to make known types onto the `md5` hashed ones. We do this in a case sensitive manner. We also only support Camel case and lower case type names. ClassLibrary1.CustomView=md5d6f7135293df7527c983d45d07471c5e.CustomTextView classlibrary1.CustomView=md5d6f7135293df7527c983d45d07471c5e.CustomTextView Given that a user is able to type these manually it is highly probable that typo's will occur. If for example a user types Classlibrary1.CustomView this will NOT be fixed up. Instead the user will recieve the following error at runtime. FATAL UNHANDLED EXCEPTION: Android.Views.InflateException: Binary XML file line #1: Binary XML file line #1: Error inflating class Classlibrary1.CustomTextView ---> Android.Views.InflateException: Binary XML file line #1: Error inflating class Classlibrary1.CustomTextView ---> Java.Lang.ClassNotFoundException: Didn't find class "Classlibrary1.CustomTextView" if you are using the control in a number of places this runtime error does nothing to help track down the problem. Instead what we should be doing is detecting these issues and emitting a build error. This will provide the user not only the problem but also a link to the file causing the probem. TODO ---- [ ] Fix up the name so it points to the file in `Resources` not `res` [ ] Add a Unit test. [ ] Add Error code and document.
…e fixed up. Context dotnet#1711 When using a custom view within a layout file we replace the `namespace.classname` with an `md5hash.classname`. We do this by using the `acwmap.txt` file to make known types onto the `md5` hashed ones. We do this in a case sensitive manner. We also only support Camel case and lower case type names. ClassLibrary1.CustomView=md5d6f7135293df7527c983d45d07471c5e.CustomTextView classlibrary1.CustomView=md5d6f7135293df7527c983d45d07471c5e.CustomTextView Given that a user is able to type these manually it is highly probable that typo's will occur. If for example a user types Classlibrary1.CustomView this will NOT be fixed up. Instead the user will recieve the following error at runtime. FATAL UNHANDLED EXCEPTION: Android.Views.InflateException: Binary XML file line #1: Binary XML file line #1: Error inflating class Classlibrary1.CustomTextView ---> Android.Views.InflateException: Binary XML file line #1: Error inflating class Classlibrary1.CustomTextView ---> Java.Lang.ClassNotFoundException: Didn't find class "Classlibrary1.CustomTextView" if you are using the control in a number of places this runtime error does nothing to help track down the problem. Instead what we should be doing is detecting these issues and emitting a build error. This will provide the user not only the problem but also a link to the file causing the probem. TODO ---- [ ] Fix up the name so it points to the file in `Resources` not `res` [ ] Add a Unit test. [ ] Add Error code and document.
…e fixed up. Context dotnet#1711 When using a custom view within a layout file we replace the `namespace.classname` with an `md5hash.classname`. We do this by using the `acwmap.txt` file to make known types onto the `md5` hashed ones. We do this in a case sensitive manner. We also only support Camel case and lower case type names. ClassLibrary1.CustomView=md5d6f7135293df7527c983d45d07471c5e.CustomTextView classlibrary1.CustomView=md5d6f7135293df7527c983d45d07471c5e.CustomTextView Given that a user is able to type these manually it is highly probable that typo's will occur. If for example a user types Classlibrary1.CustomView this will NOT be fixed up. Instead the user will recieve the following error at runtime. FATAL UNHANDLED EXCEPTION: Android.Views.InflateException: Binary XML file line #1: Binary XML file line #1: Error inflating class Classlibrary1.CustomTextView ---> Android.Views.InflateException: Binary XML file line #1: Error inflating class Classlibrary1.CustomTextView ---> Java.Lang.ClassNotFoundException: Didn't find class "Classlibrary1.CustomTextView" if you are using the control in a number of places this runtime error does nothing to help track down the problem. Instead what we should be doing is detecting these issues and emitting a build error. This will provide the user not only the problem but also a link to the file causing the probem. TODO ---- [ ] Fix up the name so it points to the file in `Resources` not `res` [ ] Add a Unit test. [ ] Add Error code and document.
…e fixed up. Context dotnet#1711 When using a custom view within a layout file we replace the `namespace.classname` with an `md5hash.classname`. We do this by using the `acwmap.txt` file to make known types onto the `md5` hashed ones. We do this in a case sensitive manner. We also only support Camel case and lower case type names. ClassLibrary1.CustomView=md5d6f7135293df7527c983d45d07471c5e.CustomTextView classlibrary1.CustomView=md5d6f7135293df7527c983d45d07471c5e.CustomTextView Given that a user is able to type these manually it is highly probable that typo's will occur. If for example a user types Classlibrary1.CustomView this will NOT be fixed up. Instead the user will recieve the following error at runtime. FATAL UNHANDLED EXCEPTION: Android.Views.InflateException: Binary XML file line #1: Binary XML file line #1: Error inflating class Classlibrary1.CustomTextView ---> Android.Views.InflateException: Binary XML file line #1: Error inflating class Classlibrary1.CustomTextView ---> Java.Lang.ClassNotFoundException: Didn't find class "Classlibrary1.CustomTextView" if you are using the control in a number of places this runtime error does nothing to help track down the problem. Instead what we should be doing is detecting these issues and emitting a build error. This will provide the user not only the problem but also a link to the file causing the probem. TODO ---- [ ] Fix up the name so it points to the file in `Resources` not `res` [ ] Add a Unit test. [ ] Add Error code and document.
…e fixed up. Context dotnet#1711 When using a custom view within a layout file we replace the `namespace.classname` with an `md5hash.classname`. We do this by using the `acwmap.txt` file to make known types onto the `md5` hashed ones. We do this in a case sensitive manner. We also only support Camel case and lower case type names. ClassLibrary1.CustomView=md5d6f7135293df7527c983d45d07471c5e.CustomTextView classlibrary1.CustomView=md5d6f7135293df7527c983d45d07471c5e.CustomTextView Given that a user is able to type these manually it is highly probable that typo's will occur. If for example a user types Classlibrary1.CustomView this will NOT be fixed up. Instead the user will recieve the following error at runtime. FATAL UNHANDLED EXCEPTION: Android.Views.InflateException: Binary XML file line #1: Binary XML file line #1: Error inflating class Classlibrary1.CustomTextView ---> Android.Views.InflateException: Binary XML file line #1: Error inflating class Classlibrary1.CustomTextView ---> Java.Lang.ClassNotFoundException: Didn't find class "Classlibrary1.CustomTextView" if you are using the control in a number of places this runtime error does nothing to help track down the problem. Instead what we should be doing is detecting these issues and emitting a build error. This will provide the user not only the problem but also a link to the file causing the probem. TODO ---- [ ] Fix up the name so it points to the file in `Resources` not `res` [ ] Add a Unit test. [ ] Add Error code and document.
…e fixed up. Context dotnet#1711 When using a custom view within a layout file we replace the `namespace.classname` with an `md5hash.classname`. We do this by using the `acwmap.txt` file to make known types onto the `md5` hashed ones. We do this in a case sensitive manner. We also only support Camel case and lower case type names. ClassLibrary1.CustomView=md5d6f7135293df7527c983d45d07471c5e.CustomTextView classlibrary1.CustomView=md5d6f7135293df7527c983d45d07471c5e.CustomTextView Given that a user is able to type these manually it is highly probable that typo's will occur. If for example a user types Classlibrary1.CustomView this will NOT be fixed up. Instead the user will recieve the following error at runtime. FATAL UNHANDLED EXCEPTION: Android.Views.InflateException: Binary XML file line #1: Binary XML file line #1: Error inflating class Classlibrary1.CustomTextView ---> Android.Views.InflateException: Binary XML file line #1: Error inflating class Classlibrary1.CustomTextView ---> Java.Lang.ClassNotFoundException: Didn't find class "Classlibrary1.CustomTextView" if you are using the control in a number of places this runtime error does nothing to help track down the problem. Instead what we should be doing is detecting these issues and emitting a build error. This will provide the user not only the problem but also a link to the file causing the probem. TODO ---- [ ] Fix up the name so it points to the file in `Resources` not `res` [ ] Add a Unit test. [ ] Add Error code and document.
…e fixed up. Context dotnet#1711 When using a custom view within a layout file we replace the `namespace.classname` with an `md5hash.classname`. We do this by using the `acwmap.txt` file to make known types onto the `md5` hashed ones. We do this in a case sensitive manner. We also only support Camel case and lower case type names. ClassLibrary1.CustomView=md5d6f7135293df7527c983d45d07471c5e.CustomTextView classlibrary1.CustomView=md5d6f7135293df7527c983d45d07471c5e.CustomTextView Given that a user is able to type these manually it is highly probable that typo's will occur. If for example a user types Classlibrary1.CustomView this will NOT be fixed up. Instead the user will recieve the following error at runtime. FATAL UNHANDLED EXCEPTION: Android.Views.InflateException: Binary XML file line #1: Binary XML file line #1: Error inflating class Classlibrary1.CustomTextView ---> Android.Views.InflateException: Binary XML file line #1: Error inflating class Classlibrary1.CustomTextView ---> Java.Lang.ClassNotFoundException: Didn't find class "Classlibrary1.CustomTextView" if you are using the control in a number of places this runtime error does nothing to help track down the problem. Instead what we should be doing is detecting these issues and emitting a build error. This will provide the user not only the problem but also a link to the file causing the probem. TODO ---- [ ] Fix up the name so it points to the file in `Resources` not `res` [ ] Add a Unit test. [ ] Add Error code and document.
…e fixed up. Context dotnet#1711 When using a custom view within a layout file we replace the `namespace.classname` with an `md5hash.classname`. We do this by using the `acwmap.txt` file to make known types onto the `md5` hashed ones. We do this in a case sensitive manner. We also only support Camel case and lower case type names. ClassLibrary1.CustomView=md5d6f7135293df7527c983d45d07471c5e.CustomTextView classlibrary1.CustomView=md5d6f7135293df7527c983d45d07471c5e.CustomTextView Given that a user is able to type these manually it is highly probable that typo's will occur. If for example a user types Classlibrary1.CustomView this will NOT be fixed up. Instead the user will recieve the following error at runtime. FATAL UNHANDLED EXCEPTION: Android.Views.InflateException: Binary XML file line #1: Binary XML file line #1: Error inflating class Classlibrary1.CustomTextView ---> Android.Views.InflateException: Binary XML file line #1: Error inflating class Classlibrary1.CustomTextView ---> Java.Lang.ClassNotFoundException: Didn't find class "Classlibrary1.CustomTextView" if you are using the control in a number of places this runtime error does nothing to help track down the problem. Instead what we should be doing is detecting these issues and emitting a build error. This will provide the user not only the problem but also a link to the file causing the probem. TODO ---- [ ] Fix up the name so it points to the file in `Resources` not `res` [ ] Add a Unit test. [ ] Add Error code and document.
…e fixed up. (#1720) Context: #1711 When using a custom view within a layout file we replace the `namespace.classname` with an `md5hash.classname`. We do this by using the `acwmap.txt` file to map known types onto the `md5` hashed ones. This is done in a case sensitive manner. We also only support identically-cased and lower-cased namespace/package names: ClassLibrary1.CustomView=md5d6f7135293df7527c983d45d07471c5e.CustomTextView classlibrary1.CustomView=md5d6f7135293df7527c983d45d07471c5e.CustomTextView Given that a user is able to type these manually it is possible that typo's will occur. If for example a user types Classlibrary1.CustomView this will NOT be fixed up, due to the lowercase `l` in `library`. Instead the user will see the following error at runtime. FATAL UNHANDLED EXCEPTION: Android.Views.InflateException: Binary XML file line #1: Binary XML file line #1: Error inflating class Classlibrary1.CustomTextView ---> Android.Views.InflateException: Binary XML file line #1: Error inflating class Classlibrary1.CustomTextView ---> Java.Lang.ClassNotFoundException: Didn't find class "Classlibrary1.CustomTextView" If the control is used in a number of places this runtime error does nothing to help track down the problem. Improve this scenario by detecting these issues and emitting an XA1002 build error. This will not only inform the user about the problem but also provide a link to the file causing the problem.
…e fixed up. (#1720) Context: #1711 When using a custom view within a layout file we replace the `namespace.classname` with an `md5hash.classname`. We do this by using the `acwmap.txt` file to map known types onto the `md5` hashed ones. This is done in a case sensitive manner. We also only support identically-cased and lower-cased namespace/package names: ClassLibrary1.CustomView=md5d6f7135293df7527c983d45d07471c5e.CustomTextView classlibrary1.CustomView=md5d6f7135293df7527c983d45d07471c5e.CustomTextView Given that a user is able to type these manually it is possible that typo's will occur. If for example a user types Classlibrary1.CustomView this will NOT be fixed up, due to the lowercase `l` in `library`. Instead the user will see the following error at runtime. FATAL UNHANDLED EXCEPTION: Android.Views.InflateException: Binary XML file line #1: Binary XML file line #1: Error inflating class Classlibrary1.CustomTextView ---> Android.Views.InflateException: Binary XML file line #1: Error inflating class Classlibrary1.CustomTextView ---> Java.Lang.ClassNotFoundException: Didn't find class "Classlibrary1.CustomTextView" If the control is used in a number of places this runtime error does nothing to help track down the problem. Improve this scenario by detecting these issues and emitting an XA1002 build error. This will not only inform the user about the problem but also provide a link to the file causing the problem.
A regression test related to https://bugzilla.xamarin.com/show_bug.cgi?id=23880 is failing against master (d15-8). Attempting to inflate a layout with some custom controls using different namespace casing from a library project is no longer successful. this is a regression from d15-7.
Steps to Reproduce
CustomControl.zip
Expected Behavior
Inflating layouts with mixed cased custom control declarations works regardless of which project the layout belongs to.
Actual Behavior
Version Information
monodroid/master/de662f58.
The text was updated successfully, but these errors were encountered: