Bug 29434 - Since upgrading to Appcompat v7 22.1.0 custom views fail to inflate
Summary: Since upgrading to Appcompat v7 22.1.0 custom views fail to inflate
Status: RESOLVED INVALID
Alias: None
Product: Android
Classification: Xamarin
Component: General ()
Version: 5.0
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Jonathan Pryor
URL:
Depends on:
Blocks:
 
Reported: 2015-04-27 13:00 UTC by Jeremy Kolb
Modified: 2015-04-29 12:09 UTC (History)
3 users (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 INVALID

Description Jeremy Kolb 2015-04-27 13:00:18 UTC
I've upgraded my app from AppCompat v7 22.0 to 22.1.0 and since then views in other assemblies fail to inflate.  For example I cannot inflate any views from MvvmCross.
Comment 1 Jeremy Kolb 2015-04-27 13:01:35 UTC
I now get messages like the following (notice : 'Didn't find class "android.view.MvxGridView"' which is the wrong class name)


android.view.InflateException: Binary XML file line #1: Error inflating class MvxGridView
04-27 12:56:49.328 I/MonoDroid( 3709): 	at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:707)
04-27 12:56:49.328 I/MonoDroid( 3709): 	at android.view.LayoutInflater.rInflate(LayoutInflater.java:755)
04-27 12:56:49.328 I/MonoDroid( 3709): 	at android.view.LayoutInflater.rInflate(LayoutInflater.java:758)
04-27 12:56:49.328 I/MonoDroid( 3709): 	at android.view.LayoutInflater.rInflate(LayoutInflater.java:758)
04-27 12:56:49.328 I/MonoDroid( 3709): 	at android.view.LayoutInflater.inflate(LayoutInflater.java:492)
04-27 12:56:49.328 I/MonoDroid( 3709): 	at android.view.LayoutInflater.inflate(LayoutInflater.java:397)
04-27 12:56:49.328 I/MonoDroid( 3709): 	at minefieldmanagement.droid.views.SelectOperation.n_onCreate(Native Method)
04-27 12:56:49.328 I/MonoDroid( 3709): 	at minefieldmanagement.droid.views.SelectOperation.onCreate(SelectOperation.java:33)
04-27 12:56:49.328 I/MonoDroid( 3709): 	at android.app.Activity.performCreate(Activity.java:5231)
04-27 12:56:49.328 I/MonoDroid( 3709): 	at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
04-27 12:56:49.328 I/MonoDroid( 3709): 	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2148)
04-27 12:56:49.328 I/MonoDroid( 3709): 	at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2233)
04-27 12:56:49.328 I/MonoDroid( 3709): 	at android.app.ActivityThread.access$800(ActivityThread.java:135)
04-27 12:56:49.328 I/MonoDroid( 3709): 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
04-27 12:56:49.328 I/MonoDroid( 3709): 	at android.os.Handler.dispatchMessage(Handler.java:102)
04-27 12:56:49.328 I/MonoDroid( 3709): 	at android.os.Looper.loop(Looper.java:136)
04-27 12:56:49.328 I/MonoDroid( 3709): 	at android.app.ActivityThread.main(ActivityThread.java:5001)
04-27 12:56:49.328 I/MonoDroid( 3709): 	at java.lang.reflect.Method.invokeNative(Native Method)
04-27 12:56:49.328 I/MonoDroid( 3709): 	at java.lang.reflect.Method.invoke(Method.java:515)
04-27 12:56:49.328 I/MonoDroid( 3709): 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
04-27 12:56:49.328 I/MonoDroid( 3709): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
04-27 12:56:49.328 I/MonoDroid( 3709): 	at dalvik.system.NativeStart.main(Native Method)
04-27 12:56:49.328 I/MonoDroid( 3709): Caused by: java.lang.ClassNotFoundException: Didn't find class "android.view.MvxGridView" on path: DexPathList[[zip file "/data/app/com.ara.uspd.minefieldmanagement-1.apk"],nativeLibraryDirectories=[/data/app-lib/com.ara.uspd.minefieldmanagement-1, /system/lib]]
Comment 2 Jeremy Kolb 2015-04-27 18:05:49 UTC
This still happens with 22.1.1
Comment 3 Jonathan Pryor 2015-04-28 14:01:55 UTC
Could you please attach a repro project?
Comment 4 Jeremy Kolb 2015-04-28 14:39:22 UTC
I'll see if I can come up with one.  It looks like 22.1.1 was compiled with a non-stable version of Xamarin (It's trying to use the JNIEnv methods that take in pointers).  My guess is that we're running into the view name transformation breakage with Xamarin 5.0+ (see https://forums.xamarin.com/discussion/39261/missing-method-android-runtime-jnienv-startcreateinstance).  Once that's out of the way I'll verify that this is still happening and try to send you a repro.
Comment 5 Jeremy Kolb 2015-04-28 14:40:03 UTC
I do know that at least two other people are hitting this with MvvmCross and one person with another assembly.
Comment 6 Jeremy Kolb 2015-04-29 11:33:01 UTC
I think this is an MvvmCross issue.  It uses a custom layout inflater factory and that doesn't play nice with the new AppCompatDelegate stuff.
Comment 7 Cody Beyer (MSFT) 2015-04-29 11:43:58 UTC
(In reply to comment #6)
> I think this is an MvvmCross issue.  It uses a custom layout inflater factory
> and that doesn't play nice with the new AppCompatDelegate stuff.

Are you able to test with the latest version of Xamarin.Android, within the "Beta" channel?
Comment 8 Jeremy Kolb 2015-04-29 12:09:43 UTC
It still happens with 21.1.1.1.  I can work around it with some code changes in MvvmCross so I think it's an MvvmCross issue.