bduncavage / PullToRefresharp

A pull-to-refresh library for Android in C#
38 stars 78 forks source link

Binary XML file line #1: Error inflating class pulltorefresharp.android.views.ViewWrapper #6

Closed chrisriesgo closed 10 years ago

chrisriesgo commented 10 years ago

I'm trying to implement Pull to Refresh. I've copy/pasted code from the sample verbatim, but I keep seeing this error:

ex.Message = "Binary XML file line #1: Error inflating class pulltorefresharp.android.views.ViewWrapper"

Here's my Layout.axml:

<?xml version="1.0" encoding="utf-8"?>
<pulltorefresharp.android.views.ViewWrapper xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:pullToRefresharpWrapper="http://schemas.android.com/apk/res-auto"
android:id="@+id/ptrAssignedCardsWrapper"
android:layout_width="match_parent"
android:layout_height="match_parent"
pullToRefresharpWrapper:pullDownTension="0.5"
pullToRefresharpWrapper:snapbackDuration="300">
<pulltorefresharp.android.widget.ListView
    android:id="@+id/assignedCardsListView"
    android:divider="#ccc"
    android:dividerHeight="1dp"
    android:layout_height="match_parent"
    android:layout_width="match_parent"
    android:layout_marginRight="10dp"
    android:layout_marginLeft="10dp" />

</pulltorefresharp.android.views.ViewWrapper>

A snippet from my Fragment:

public class MyClass : SherlockListFragment, AbsListView.IOnScrollListener
{
...
public override View OnCreateView(LayoutInflater inflater, ViewGroup container,     Bundle savedInstanceState)
    {
        try
        {
            return inflater.Inflate(LayoutId, null, false);
        }
        catch (Exception ex)
        {
            //  ERROR INTO HERE
            var a = ex.Message;
            throw;
        }

    }
...
}

I have a references to:

Mono.Android Mono.Android.Support.v4 PullToRefresharp System.System.Core System.Xml etc.

Am I missing something? The sample project list example works perfectly.

bduncavage commented 10 years ago

Sorry, you're having an issue.

Based on the information you've provided, I can't determine the cause of your problem. Is it possible for you to post your project, or a test-case project, so I can build and run it? It sounds like you've set things up properly, but there may be a subtle configuration error, or some other detail that is missing from your report.

chrisriesgo commented 10 years ago

Let me try putting together a smaller test project and get back to you.

bduncavage commented 10 years ago

Have you figured out the issue? Sometimes cleaning/rebuilding can clear up link errors.

bduncavage commented 10 years ago

Without more information I cannot troubleshoot/verify this issue. If you come up with a test case that reproduces the issue, open a new issue and post a link to the test case.

comk commented 10 years ago

hello,thank you for your component ,but there is a problem when reference the component with the android build --->linker --->link all assembies ,even your sample cast a crash with it, when go with don't link ,it goes well. thank you for your repeat