Bug 30086 - Error using CardView in Xamarin.Forms
Summary: Error using CardView in Xamarin.Forms
Status: RESOLVED NORESPONSE
Alias: None
Product: Forms
Classification: Xamarin
Component: Android ()
Version: 1.4.0
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2015-05-14 13:24 UTC by Anubhav Ranjan
Modified: 2016-04-08 19:53 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 NORESPONSE

Description Anubhav Ranjan 2015-05-14 13:24:53 UTC
One of our customers is facing issues with CardView in Xamarin.Forms with Android.

#Description:
============
I'm having trouble using a CardView in a Xamarin.Forms Android project. Here's a link to a sample project <https://parivedasolutions.box.com/s/ejgj6qw5zkq4cvmjyn7yn2z65l7nvpsb>; for reproducing the issue (it's actually just a slightly modified version of this project<https://github.com/xamarin/xamarin-forms-samples/tree/master/WorkingWithListviewNative>; (part D). The specific error I'm getting is included below. Any help is greatly appreciated!

I'm getting the following error:

05-06 20:36:21.322 I/MonoDroid( 2543): UNHANDLED EXCEPTION:
05-06 20:36:21.335 I/MonoDroid( 2543): Android.Views.InflateException: Exception of type 'Android.Views.InflateException' was thrown.
05-06 20:36:21.335 I/MonoDroid( 2543): at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () <IL 0x00011, 0x00047>
05-06 20:36:21.337 I/MonoDroid05-06 20:36:21.336 I/MonoDroid( 2543): at Android.Runtime.JNIEnv.CallObjectMethod (intptr,intptr,Android.Runtime.JValue[]) [0x00064] in /Users/builder/data/lanes/1353/86274adf/source/monodroid/src/Mono.Android/src/Runtime/JNIEnv.g.cs:195
05-06 20:36:21.336 I/MonoDroid( 2543): at Android.Views.LayoutInflater.Inflate (int,Android.Views.ViewGroup) [0x00043] in /Users/builder/data/lanes/1353/86274adf/source/monodroid/src/Mono.Android/platforms/android-21/src/generated/Android.Views.LayoutInflater.cs:575
05-06 20:36:21.336 I/MonoDroid( 2543): at WorkingWithListviewNative.Droid.NativeAndroidListViewAdapter.GetView (int,Android.Views.View,Android.Views.ViewGroup) [0x0001c] in c:\dev\xamarin-forms-samples\WorkingWithListviewNative\Droid\D\NativeAndroidListViewAdapter.cs:59
05-06 20:36:21.336 I/MonoDroid( 2543): at Android.Widget.BaseAdapter.n_GetView_ILandroid_view_View_Landroid_view_ViewGroup_ (intptr,intptr,int,intptr,intptr) [0x0001a] in /Users/builder/data/lanes/1353/86274adf/source/monodroid/src/Mono.Android/platforms/android-21/src/generated/Android.Widget.BaseAdapter.cs:460
05-06 20:36:21.336 I/MonoDroid( 2543): at (wrapper dynamic-method) object.11aa34f9-b219-4a4e-aa20-dc3c259738d5 (intptr,intptr,int,intptr,intptr) <IL 0x00023, 0x00037>
05-06 20:36:21.336 I/MonoDroid( 2543): --- End of managed exception stack trace ---
05-06 20:36:21.336 I/MonoDroid( 2543): android.view.InflateException: Binary XML file line #1: Error inflating class android.support.v7.widget.CardView
05-06 20:36:21.336 I/MonoDroid( 2543): at android.view.LayoutInflater.createView(LayoutInflater.java:633)
05-06 20:36:21.336 I/MonoDroid( 2543): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:743)
05-06 20:36:21.336 I/MonoDroid( 2543): at android.view.LayoutInflater.rInflate(LayoutInflater.java:806)
05-06 20:36:21.336 I/MonoDroid( 2543): at android.view.LayoutInflater.inflate(LayoutInflater.java:504)
05-06 20:36:21.336 I/MonoDroid( 2543): at android.view.LayoutInflater.inflate(LayoutInflater.java:414)
05-06 20:36:21.336 I/MonoDroid( 2543): at android.view.LayoutInflater.inflate(LayoutInflater.java:365)
05-06 20:36:21.336 I/MonoDroid( 2543): at workingwithlistviewnative.droid.NativeAndroidListViewAdapter.n_getView(Native Method)
An unhandled exception occured.

05-06 20:36:21.336 I/MonoDroid( 2543): at workingwithlistviewnative.droid.NativeAndroidListViewAdapter.getView(NativeAndroidListViewAdapter.java:55)
05-06 20:36:21.336 I/MonoDroid( 2543): at android.widget.AbsListView.obtainView(AbsListView.java:2344)
05-06 20:36:21.336 I/MonoDroid( 2543): at android.widget.ListView.onMeasure(ListView.java:1154)
05-06 20:36:21.336 I/MonoDroid( 2543): at android.view.View.measure(View.java:17430)
05-06 20:36:21.337 I/MonoDroid( 2543): at mono.android.app.TabEventDispatcher.n_onTabSelected(Native Method)
05-06 20:36:21.337 I/MonoDroid( 2543): at mono.android.app.TabEventDispatcher.onTabSelected(TabEventDispatcher.java:39)
05-06 20:36:21.337 I/MonoDroid( 2543): at com.android.internal.app.WindowDecorActionBar.selectTab(WindowDecorActionBar.java:624)
05-06 20:36:21.337 I/MonoDroid( 2543): at com.android.internal.app.WindowDecorActionBar$TabImpl.select(WindowDecorActionBar.java:1200)
05-06 20:36:21.337 I/MonoDroid( 2543): at com.android.internal.widget.ScrollingTabContainerView$TabClickListener.onClick(ScrollingTabContainerView.java:546)
05-06 20:36:21.337 I/MonoDroid( 2543): at android.view.View.performClick(View.java:4756)
05-06 20:36:21.337 I/MonoDroid( 2543): at android.view.View$PerformClick.run(View.java:19749)
05-06 20:36:21.337 I/MonoDroid( 2543): at android.os.Handler.handleCallback(Handler.java:739)
05-06 20:36:21.337 I/MonoDroid( 2543): at android.os.Handler.dispatchMessage(Handler.java:95)
05-06 20:36:21.337 I/MonoDroid( 2543): at android.os.Looper.loop(Looper.java:135)
05-06 20:36:21.337 I/MonoDroid( 2543): at android.app.ActivityThread.main(ActivityThread.java:5221)
05-06 20:36:21.337 I/MonoDroid( 2543): at java.lang.reflect.Method.invoke(Native Method)
05-06 20:36:21.337 I/MonoDroid( 2543): at java.lang.reflect.Method.invoke(Method.java:372)
05-06 20:36:21.337 I/MonoDroid( 2543): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899)
05-06 20:36:21.337 I/MonoDroid( 2543): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)
05-06 20:36:21.337 I/MonoDroid( 2543): Caused by: java.lang.reflect.InvocationTargetException
05-06 20:36:21.337 I/MonoDroid( 2543): at java.lang.reflect.Constructor.newInstance(Native Method)
05-06 20:36:21.337 I/MonoDroid( 2543): at java.lang.reflect.Constructor.newInstance(Constructor.java:288)
05-06 20:36:21.337 I/MonoDroid( 2543): at android.view.LayoutInflater.createView(LayoutInflater.java:607)
05-06 20:36:21.337 I/MonoDroid( 2543): ... 25 more
05-06 20:36:21.337 I/MonoDroid( 2543): Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Landroid/support/v7/cardview/R$styleable;
05-06 20:36:21.337 I/MonoDroid( 2543): at android.support.v7.widget.CardView.initialize(CardView.java:203)
05-06 20:36:21.337 I/MonoDroid( 2543): at android.support.v7.widget.CardView.<init>(CardView.java:101)
05-06 20:36:21.337 I/MonoDroid( 2543): ... 28 more
05-06 20:36:21.337 I/MonoDroid( 2543): Caused by: java.lang.ClassNotFoundException: Didn't find class "android.support.v7.cardview.R$styleable" on path: DexPathList[[zip file "/data/app/com.xamarin.workingwithlistviewnative-1/base.apk"],nativeLibraryDirectories=[/data/app/com.xamarin.workingwithlistviewnative-1/lib/x86, /vendor/lib, /system/lib]]
05-06 20:36:21.337 I/MonoDroid( 2543): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
05-06 20:36:21.337 I/MonoDroid( 2543): at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
05-06 20:36:21.337 I/MonoDroid( 2543): at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
05-06 20:36:21.337 I/MonoDroid( 2543): ... 30 more
05-06 20:36:21.337 I/MonoDroid( 2543): Suppressed: java.lang.ClassNotFoundException: android.support.v7.cardview.R$styleable
05-06 20:36:21.337 I/MonoDroid( 2543): at java.lang.Class.classForName(Native Method)
05-06 20:36:21.337 I/MonoDroid( 2543): at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
05-06 20:36:21.337 I/MonoDroid( 2543): at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
05-06 20:36:21.337 I/MonoDroid( 2543): at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
05-06 20:36:21.337 I/MonoDroid( 2543): ... 31 more
05-06 20:36:21.337 I/MonoDroid( 2543): Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack available


#Version Info
=========

Microsoft Visual Studio Premium 2013
Version 12.0.31101.00 Update 4
Microsoft .NET Framework
Version 4.5.51650

Installed Version: Premium

LightSwitch for Visual Studio 2013 06191-004-0454001-02186
Microsoft LightSwitch for Visual Studio 2013

Team Explorer for Visual Studio 2013 06191-004-0454001-02186
Microsoft Team Explorer for Visual Studio 2013

Visual Basic 2013 06191-004-0454001-02186
Microsoft Visual Basic 2013

Visual C# 2013 06191-004-0454001-02186
Microsoft Visual C# 2013

Visual C++ 2013 06191-004-0454001-02186
Microsoft Visual C++ 2013

Visual F# 2013 06191-004-0454001-02186
Microsoft Visual F# 2013

Visual Studio 2013 Code Analysis Spell Checker 06191-004-0454001-02186
Microsoft® Visual Studio® 2013 Code Analysis Spell Checker

Portions of International CorrectSpell™ spelling correction system © 1993 by Lernout & Hauspie Speech Products N.V. All rights reserved.

The American Heritage® Dictionary of the English Language, Third Edition Copyright © 1992 Houghton Mifflin Company. Electronic version licensed from Lernout & Hauspie Speech Products N.V. All rights reserved.

Windows Phone SDK 8.0 - ENU 06191-004-0454001-02186
Windows Phone SDK 8.0 - ENU

Application Insights Tools for Visual Studio Package 1.0
Application Insights Tools for Visual Studio

ASP.NET and Web Tools 12.4.60320.0
Microsoft Web Developer Tools contains the following components:
Support for creating and opening ASP.NET web projects
Browser Link: A communication channel between Visual Studio and browsers
Editor extensions for HTML, CSS, and JavaScript
Page Inspector: Inspection tool for ASP.NET web projects
Scaffolding: A framework for building and running code generators
Server Explorer extensions for Microsoft Azure Web Apps
Web publishing: Extensions for publishing ASP.NET web projects to hosting providers, on-premises servers, or Microsoft Azure

ASP.NET Web Frameworks and Tools 2012.2 4.1.21001.0
For additional information, visit http://go.microsoft.com/fwlink/?LinkID=309563

ASP.NET Web Frameworks and Tools 2013 5.2.21010.0
For additional information, visit http://www.asp.net/

Common Azure Tools 1.3
Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.

JetBrains ReSharper Platform 6 Build 6.0.20141219.120158 on 2014-12-19 12:56:02Z
JetBrains ReSharper Platform package for Microsoft Visual Studio. For more information about ReSharper Platform, visit http://www.jetbrains.com/resharper. Copyright © 2015 JetBrains, Inc.

Microsoft Advertising SDK for Windows Phone
Microsoft Advertising SDK for Windows Phone
Build

Microsoft Azure HDInsight HQL Service 2.0.0.0000
Language service for Hive query

Microsoft Azure HDInsight Tools for Visual Studio 2.0.0.0000
An integrated development environment for HDInsight application development.

Microsoft Azure Mobile Services Tools 1.3
Microsoft Azure Mobile Services Tools

Microsoft Azure Tools 2.5
Microsoft Azure Tools for Microsoft Visual Studio 2013 - v2.5.30319.1603

NuGet Package Manager 2.8.50926.663
NuGet Package Manager in Visual Studio. For more information about NuGet, visit http://docs.nuget.org/.

Office Developer Tools for Visual Studio 2013 ENU 12.0.30626
Microsoft Office Developer Tools for Visual Studio 2013 ENU

PowerShell Tools 1.3
Provides file classification services using PowerShell

PreEmptive Analytics Visualizer 1.2
Microsoft Visual Studio extension to visualize aggregated summaries from the PreEmptive Analytics product.

SQL Server Data Tools 12.0.41012.0
Microsoft SQL Server Data Tools

StyleCop 4.7.49.0
Provides source code style and consistency tools. See http://www.stylecop.codeplex.com/ for more details.

Windows Phone 8.1 SDK Integration 1.0
This package integrates the tools for the Windows Phone 8.1 SDK into the menus and controls of Visual Studio.

Workflow Manager Tools 1.0 1.0
This package contains the necessary Visual Studio integration components for Workflow Manager.

Xamarin 3.9.547.0 (20fd2f0)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin.Android 4.20.2.1 (86274adfc6418b4c3a9d67734eb871163859b51c)
Visual Studio plugin to enable development for Xamarin.Android.

Xamarin.iOS 8.9.1.0 (02a05754f85064ec222c8a1a975761debfe7122d)
Visual Studio extension to enable development for Xamarin.iOS.

Xamarin.iOS Unified Migration 1.0
Automated migration for Xamarin iOS Classic projects to Unified
Comment 2 Chris King 2015-05-19 13:57:24 UTC
Ryan, thank you for taking the time to submit the bug. We'd be happy to help you resolve this issue but first please help us by attaching a reduced reproduction to the bug by starting with a clean Xamarin.Forms project and adding just the code necessary to demonstrate the issue. If you'd do this for us we would very much appreciate it. If you are able to reproduce the issue without using any custom renderers that would eliminate a number of possibilities and likely expedite a resolution. 

Warm regards,
Xamarin Forms Team
Comment 3 E.Z. Hart [MSFT] 2016-04-08 19:53:24 UTC
Thank you for your bug report. As we have not received the information requested, we cannot properly triage your bug and are marking it resolved.

Warm regards,
Xamarin Forms Team