Bug 41583 - Inflation error after upgrade to Marshmallow
Summary: Inflation error after upgrade to Marshmallow
Status: RESOLVED FIXED
Alias: None
Product: Android
Classification: Xamarin
Component: General ()
Version: 6.0.1 (C6SR1)
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Jonathan Pryor
URL:
Depends on:
Blocks:
 
Reported: 2016-06-08 06:39 UTC by Mohit Singh Baweja
Modified: 2016-06-09 06:52 UTC (History)
1 user (show)

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

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

Related Links:
Status:
RESOLVED FIXED

Description Mohit Singh Baweja 2016-06-08 06:39:22 UTC
App which was previously running fine on API 21, was updated to Marshmallow, with updates to the following libraries:
- Android.Support.V4, v7.AppCompat, v7.MediaRouter, v7.RecyclerView to version 23.3.0
- PlayServices.Analytics to 29.0.0.1
- PlayServices.Location to 29.0.0.1
- PlayServices.Maps to 29.0.0.1

MVVMCross is 3.5.0 and hasn't been updated.

After update, Custom control for Android has stopped inflating in some parts of the app.

Stack trace as per below:

  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in /Users/builder/data/lanes/3236/ee215fc9/source/mono/external/referencesource/mscorlib/system/runtime/exceptionservices/exceptionservicescommon.cs:143 
  at Android.Runtime.JNIEnv.CallObjectMethod (IntPtr jobject, IntPtr jmethod, Android.Runtime.JValue* parms) [0x00064] in /Users/builder/data/lanes/3236/ee215fc9/source/monodroid/src/Mono.Android/src/Runtime/JNIEnv.g.cs:195 
  at Android.Views.LayoutInflater.Inflate (Int32 resource, Android.Views.ViewGroup root, Boolean attachToRoot) [0x00082] in /Users/builder/data/lanes/3236/ee215fc9/source/monodroid/src/Mono.Android/platforms/android-23/src/generated/Android.Views.LayoutInflater.cs:687 
  at Cirrious.MvvmCross.Binding.Droid.BindingContext.MvxAndroidBindingContext.CommonInflate (Int32 resourceId, Android.Views.ViewGroup viewGroup, IMvxLayoutInfactorFactory factory, Boolean attachToRoot) [0x0002e] in <filename unknown>:0 
  at Cirrious.MvvmCross.Binding.Droid.BindingContext.MvxAndroidBindingContext.BindingInflate (Int32 resourceId, Android.Views.ViewGroup viewGroup, Boolean attachToRoot) [0x00014] in <filename unknown>:0 
  at Cirrious.MvvmCross.Binding.Droid.BindingContext.MvxBindingContextOwnerExtensions.BindingInflate (IMvxBindingContextOwner owner, Int32 resourceId, Android.Views.ViewGroup viewGroup, Boolean attachToParent) [0x0000c] in <filename unknown>:0 
  at Iag.DI.Mobile.Droid.Views.Support.LinearLayoutView.Inflate (Int32 layoutResId, Orientation orientation) [0x00007] in <filename unknown>:0 
  at Iag.DI.Mobile.Droid.Views.MapPinDetails`2[TViewModel,TMapPin]..ctor (Android.Content.Context context, PinCallbacks pinCallbacks) [0x00010] in <filename unknown>:0 
  at Iag.DI.Mobile.Droid.Views.BaseExtraPinDetailsView`2[TViewModel,TMapPin]..ctor (Android.Content.Context context, PinCallbacks pinCallbacks, Android.Views.View overlayFillView) [0x00000] in <filename unknown>:0 
  at Iag.DI.Mobile.Droid.Views.ContactUs.FindUsView+StorePinDetailView..ctor (Android.Content.Context context, PinCallbacks pinCallbacks, Android.Views.View overlayFillView) [0x00000] in <filename unknown>:0 
  at Iag.DI.Mobile.Droid.Views.ContactUs.FindUsView.CreateDetailsView (Android.Views.ViewGroup _detailsContainer) [0x00001] in <filename unknown>:0 
  at Iag.DI.Mobile.Droid.Views.BaseMapView`2[TViewModel,TMapPin].OnCreate (Android.OS.Bundle bundle) [0x0005c] in <filename unknown>:0 
  at Iag.DI.Mobile.Droid.Views.ContactUs.FindUsView.OnCreate (Android.OS.Bundle bundle) [0x00001] in <filename unknown>:0 
  at Android.Support.V4.App.FragmentActivity.n_OnCreate_Landroid_os_Bundle_ (IntPtr jnienv, IntPtr native__this, IntPtr native_savedInstanceState) [0x00011] in <filename unknown>:0 
  at (wrapper dynamic-method) System.Object:4399a4ff-eb39-40c7-8bd5-83bf03326b30 (intptr,intptr,intptr)
  --- End of managed exception stack trace ---
android.view.InflateException: Binary XML file line #1: Binary XML file line #1: Error inflating class Iag.TextView
	at android.view.LayoutInflater.inflate(LayoutInflater.java:551)
	at android.view.LayoutInflater.inflate(LayoutInflater.java:429)
	at md5b4c0242490877ac7c63691a6832b9b76.FindUsView.n_onCreate(Native Method)
	at md5b4c0242490877ac7c63691a6832b9b76.FindUsView.onCreate(FindUsView.java:31)
	at android.app.Activity.performCreate(Activity.java:6876)
	at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1135)
	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3207)
	at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3350)
	at android.app.ActivityThread.access$1100(ActivityThread.java:222)
	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1795)
	at android.os.Handler.dispatchMessage(Handler.java:102)
	at android.os.Looper.loop(Looper.java:158)
	at android.app.ActivityThread.main(ActivityThread.java:7229)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
Caused by: android.view.InflateException: Binary XML file line #1: Error inflating class Iag.TextView
	at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:788)
	at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:716)
	at android.view.LayoutInflater.rInflate(LayoutInflater.java:847)
	at android.view.LayoutInflater.inflate(LayoutInflater.java:495)
	... 15 more
Caused by: java.lang.ClassNotFoundException: Didn't find class "Iag.TextView" on path: DexPathList[[zip file "/data/app/nz.co.ami-1/base.apk"],nativeLibraryDirectories=[/data/app/nz.co.ami-1/lib/arm, /data/app/nz.co.ami-1/base.apk!/lib/armeabi-v7a, /vendor/lib, /system/lib]]
	at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
	at android.view.LayoutInflater.createView(LayoutInflater.java:595)
	at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:776)
	... 18 more
	Suppressed: java.lang.ClassNotFoundException: Iag.TextView
		at java.lang.Class.classForName(Native Method)
		at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
		at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
		at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
		... 21 more
	Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack trace available
Comment 1 Mohit Singh Baweja 2016-06-09 06:52:05 UTC
Turns out that Adding attribute [Register="ComponentName"] in the class files for custom controls fixes this issue as outlined in http://forums.xamarin.com/discussion/37277/stable-release-xamarin-android-5-1-0-breaking-changes-new-features-and-bug-fixes