alexrainman / CarouselView

CarouselView control for Xamarin Forms
MIT License
436 stars 176 forks source link

Crash in Android #19

Closed rotorgames closed 8 years ago

rotorgames commented 8 years ago

Hi. Thank you for awesome plugin but I have a problem with it.

I have error in Android when I added CarouselView in layout.

Xamarin.VS 4.2.0.680 Xamarin.Forms to 2.3.2.127 Android 6.0

P.S. Crash is only if I use nuget package in my project. When I deploy your demo project that all working.

<abstractions:CarouselViewControl  Position="0" ItemsSource="{Binding MyList}" VerticalOptions="FillAndExpand" HorizontalOptions="FillAndExpand">
  <abstractions:CarouselViewControl.ItemTemplate>
    <DataTemplate>
      <Label Text="{Binding .}"/>
     </DataTemplate>
   </abstractions:CarouselViewControl.ItemTemplate>
</abstractions:CarouselViewControl>
Xamarin caused by: android.runtime.JavaProxyThrowable: System.NullReferenceException: Object reference not set to an instance of an object
CarouselView.FormsPlugin.Android.CarouselViewRenderer.PageAdapter.get_Count()<97300517a1ad4a16ac0373801a18c8e2>:0
Android.Support.V4.View.PagerAdapter.n_GetCount(IntPtr jnienv, IntPtr native__this)<27c17fe440cf491ba8255bcefade6e02>:0
at (wrapper dynamic-method) System.Object:06516622-6b02-4513-bdaa-c681ca0d2685 (intptr,intptr)
md5fa3be16b83ce3acd3be83265686c14de.CarouselViewRenderer_PageAdapter.n_getCount(Native Method)
md5fa3be16b83ce3acd3be83265686c14de.CarouselViewRenderer_PageAdapter.getCount()CarouselViewRenderer_PageAdapter.java:33
android.support.v4.view.ViewPager.setAdapter()ViewPager.java:495
mono.java.lang.RunnableImplementor.n_run(Native Method)
mono.java.lang.RunnableImplementor.run()RunnableImplementor.java:30
android.os.Handler.handleCallback()Handler.java:739
android.os.Handler.dispatchMessage()Handler.java:95
android.os.Looper.loop()Looper.java:148
android.app.ActivityThread.main()ActivityThread.java:5417
java.lang.reflect.Method.invoke(Native Method)
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run()ZygoteInit.java:726
com.android.internal.os.ZygoteInit.main()ZygoteInit.java:616
alexrainman commented 8 years ago

Yes, i merged your fix. I new package is on the way as soon as i solve a pending issue in Android. Thanks

rotorgames commented 8 years ago

@alexrainman Please. Do code review in your repository. When I fixed this problem I had more problems with obj, bin and packages folders. Any changes in it are added to commit that's why I don't see real changes. Thx

alexrainman commented 8 years ago

?

rotorgames commented 8 years ago

@alexrainman Delete all obj, bin, packages folders and create gitignore

alexrainman commented 8 years ago

I know those are extra files but, what real problem you have with them?

alexrainman commented 7 years ago

If my work is helping you, please help me back: https://xamarinhq.wufoo.com/forms/nominate-a-xamarin-mvp/

alexrainman commented 7 years ago

This is what i have done that is community visible: