Skip to content

Cannot use SwipeRefreshLayout when using Xamarin.Google.Android.Material 1.4.0 #337

@tipa

Description

@tipa

Version Information

  • Visual Studio version: 16.10.3
  • Xamarin.Android version: 11.3.0.4

Describe your Issue:

  • Cannot use SwipeRefreshLayout when using Xamarin.Google.Android.Material v1.4.0
  • System.TypeLoadException: VTable setup of type AndroidX.SwipeRefreshLayout.Widget.SwipeRefreshLayout failed
  • There was no problem with Xmarin.Google.Android.Material v1.3.0.1

Steps to Reproduce (with link to sample solution if possible):

  • Use Xamarin.AndroidX.SwipeRefreshLayout v1.1.0.2
  • Use Xamarin.Google.Android.Material v1.4.0
  • Use SwipeRefreshLayout in layout, get reference on it and try to call a method on it
  • Build & deploy in Release(!!) mode

Example project: App1.zip

Include any relevant Exception Stack traces, build logs, adb logs:

2021-07-13 10:27:13.257 20220-20220/? E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.companyname.app1, PID: 20220
    android.runtime.JavaProxyThrowable: System.TypeLoadException: VTable setup of type AndroidX.SwipeRefreshLayout.Widget.SwipeRefreshLayout failed
      at System.Reflection.RuntimeConstructorInfo.InternalInvoke (System.Object obj, System.Object[] parameters, System.Boolean wrapExceptions) [0x0002c] in <e4b7131ef0f545c19079e7cb4356af53>:0 
      at System.Reflection.RuntimeConstructorInfo.DoInvoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00086] in <e4b7131ef0f545c19079e7cb4356af53>:0 
      at System.Reflection.RuntimeConstructorInfo.Invoke (System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <e4b7131ef0f545c19079e7cb4356af53>:0 
      at System.Reflection.ConstructorInfo.Invoke (System.Object[] parameters) [0x00000] in <e4b7131ef0f545c19079e7cb4356af53>:0 
      at Java.Interop.TypeManager.CreateProxy (System.Type type, System.IntPtr handle, Android.Runtime.JniHandleOwnership transfer) [0x0001b] in <16b55fa042dd429080833df7bb3f2295>:0 
      at Java.Interop.TypeManager.CreateInstance (System.IntPtr handle, Android.Runtime.JniHandleOwnership transfer, System.Type targetType) [0x00111] in <16b55fa042dd429080833df7bb3f2295>:0 
      at Java.Lang.Object.GetObject (System.IntPtr handle, Android.Runtime.JniHandleOwnership transfer, System.Type type) [0x00023] in <16b55fa042dd429080833df7bb3f2295>:0 
      at Java.Lang.Object._GetObject[T] (System.IntPtr handle, Android.Runtime.JniHandleOwnership transfer) [0x00017] in <16b55fa042dd429080833df7bb3f2295>:0 
      at Java.Lang.Object.GetObject[T] (System.IntPtr handle, Android.Runtime.JniHandleOwnership transfer) [0x00000] in <16b55fa042dd429080833df7bb3f2295>:0 
      at Android.App.Activity.FindViewById (System.Int32 id) [0x00036] in <16b55fa042dd429080833df7bb3f2295>:0 
      at Android.App.Activity.FindViewById[T] (System.Int32 id) [0x00000] in <16b55fa042dd429080833df7bb3f2295>:0 
      at App1.MainActivity.OnCreate (Android.OS.Bundle savedInstanceState) [0x00012] in <1a469fe5eac84614bf81215bdd214ab5>:0 
      at Android.App.Activity.n_OnCreate_Landroid_os_Bundle_ (System.IntPtr jnienv, System.IntPtr native__this, System.IntPtr native_savedInstanceState) [0x0000f] in <16b55fa042dd429080833df7bb3f2295>:0 
        at (wrapper dynamic-method) Android.Runtime.DynamicMethodNameCounter.1(intptr,intptr,intptr)
        at crc64a7a6b04b89628087.MainActivity.n_onCreate(Native Method)
        at crc64a7a6b04b89628087.MainActivity.onCreate(MainActivity.java:37)
        at android.app.Activity.performCreate(Activity.java:8000)
        at android.app.Activity.performCreate(Activity.java:7984)
        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1309)
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3422)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3601)
        at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:85)
        at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
        at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2066)
        at android.os.Handler.dispatchMessage(Handler.java:106)
        at android.os.Looper.loop(Looper.java:223)
        at android.app.ActivityThread.main(ActivityThread.java:7656)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions