Reactive view host System.TypeInitializationException

18 posts, 0 answers
  1. Deepak
    Deepak avatar
    19 posts
    Member since:
    Nov 2016

    Posted 02 Feb Link to this post

    UI for XAMARIN I'm trying to implement cahrt with xamarin android but reactive view host throw some exception : [ERROR] FATAL UNHANDLED EXCEPTION: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.TypeInitializationException: The type initializer for 'ReactiveUI.ControlFetcherMixin' threw an exception. ---> System.ArgumentException: An item with the same key has already been added
  2. Rosy Topchiyska
    Admin
    Rosy Topchiyska avatar
    586 posts

    Posted 07 Feb Link to this post

    Hello Deepak,

    Thank you for contacting us. Could you please provide a sample that reproduces the issue?

    I look forward to your reply.

    Regards,
    Rosy Topchiyska
    Telerik by Progress
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. Deepak
    Deepak avatar
    19 posts
    Member since:
    Nov 2016

    Posted 07 Feb Link to this post

    Hi Rosy,

    Actually I get UI Elements like : private ListView ListControls => this.GetControl<ListView>(); using ReactiveUI 

    It's was working fine earlier but when I added telerik dll's references it's started giving System.TypeInitializationException

    Example :

    using Android.App;
    using Android.Content;
    using Android.Widget;
    using Android.OS;
    using ReactiveUI;

    namespace Samples
    {
    [Activity (Label = "@string/title_activity_main", MainLauncher = true, Icon = "@drawable/icon")]
    public class MainActivity : ReactiveActivity
    {
            private ListView ListControls => this.GetControl<ListView>();
            protected override void OnCreate(Bundle bundle)
            {
                base.OnCreate(bundle);
                SetContentView(Resource.Layout.Main);

                //this.listControls = (ListView) this.FindViewById(Resource.Id.listControls);
                this.ListControls.Adapter = new ControlsAdapter(this, 0);
                this.ListControls.ItemClick += (object sender, AdapterView.ItemClickEventArgs e) =>
                {
                    ControlActivity.selectedControl = (ExamplesProvider)ListControls.Adapter.GetItem(e.Position);

                    Intent examplesActivity = new Intent(this, typeof(ControlActivity));
                    this.StartActivity(examplesActivity);
                };
            }
        }
    }

  4. Deepak
    Deepak avatar
    19 posts
    Member since:
    Nov 2016

    Posted 07 Feb Link to this post

    related exception : 
  5. Rosy Topchiyska
    Admin
    Rosy Topchiyska avatar
    586 posts

    Posted 07 Feb Link to this post

    Hi Deepak,

    Could you please check what is the version of AppCompat support library in your app. Our components support version 23 and if you use a higher version, this could cause problems.

    I look forward to your reply.

    Regards,
    Rosy Topchiyska
    Telerik by Progress
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  6. Deepak
    Deepak avatar
    19 posts
    Member since:
    Nov 2016

    Posted 07 Feb Link to this post

    I'm using Appcompact version : 23.0.1.3
  7. Deepak
    Deepak avatar
    19 posts
    Member since:
    Nov 2016

    Posted 09 Feb Link to this post

    I'm still having this issue ...help me to resolve this, please
  8. Deepak
    Deepak avatar
    19 posts
    Member since:
    Nov 2016

    Posted 09 Feb Link to this post

    Hi Rosy,

    I just checked all other Xamarin Android dll's other than "Telerik.Xamarin.Android.Chart" .... all working fine So I think this issue is only with Telerik.Xamarin.Android.Chart dll.... if you found anything, please let me know.. I'm stuck :(

  9. Rosy Topchiyska
    Admin
    Rosy Topchiyska avatar
    586 posts

    Posted 09 Feb Link to this post

    Hi Deepak,

    Thank you for the sample, but we will need more details to reproduce the issue on our side. Could you please prepare a sample application?

    I look forward to your reply.

    Regards,
    Rosy Topchiyska
    Telerik by Progress
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  10. Deepak
    Deepak avatar
    19 posts
    Member since:
    Nov 2016

    Posted 09 Feb Link to this post

    Hi Rosy,

    Please find the sample application at : https://drive.google.com/file/d/0B9rB5PUbyfdsZ2EzY21FR2phc3M/view?usp=sharing

    This is my sample project. If you will run this you can see the issue.

    Step 1: If you run the project with "Telerik.Xamarin.Android.Input.dll" and "Telerik.Xamarin.Android.Chart.dll" then it'll produce the                    exception(currently I've added these dll's with the sample project).

    Step 2: If you remove the "Telerik.Xamarin.Android.Input.dll" and "Telerik.Xamarin.Android.Chart.dll" and run the project then it'll                      work fine.

    Please have a look into it. I've to complete my project ASAP.

    Thanks

  11. Deyan
    Admin
    Deyan avatar
    2147 posts

    Posted 09 Feb Link to this post

    Hi Deepak,

    Just a quick question:

    While using Chart and Input DLLs, did you add also a reference to the Common and Primitives DLLs, as both depend on them as described here:

    http://docs.telerik.com/devtools/android/download-and-deployment/installation-contents-and-dependencies



    Regards,
    Deyan
    Telerik by Progress
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  12. Deepak
    Deepak avatar
    19 posts
    Member since:
    Nov 2016

    Posted 09 Feb in reply to Deyan Link to this post

    Yes I did
  13. Deepak
    Deepak avatar
    19 posts
    Member since:
    Nov 2016

    Posted 09 Feb Link to this post

    Hi Deyan,

    You can see this in the sample project that I've shared 

  14. Deyan
    Admin
    Deyan avatar
    2147 posts

    Posted 14 Feb Link to this post

    Hi Deepak,

    Thanks for writing back.

    We're currently investigating the case. We have narrowed it down to a specific assembly from the UI for Xamarin.Android suite and will get back to you as soon as we have more information to share.

    Thanks for your patience.

    Regards,
    Deyan
    Telerik by Progress
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  15. Deyan
    Admin
    Deyan avatar
    2147 posts

    Posted 15 Feb Link to this post

    Hi Deepak,

    This is a quick follow-up with some more information on the case.

    After downloading the ReactiveUI source code and debugging it locally, we have determined that there is a potential issue with ReactiveUI's source which causes this exception. A specific part of ReaciveUI's implementation merges Android resource IDs into a Dictionary without considering the possibility of duplicate dictionary keys. When you reference the Telerik UI for Xamarin.Android assemblies there are two resource IDs which are the same but with different casing. ReactiveUI's code doesn't consider the casing and sees them as two identical resource IDs which leads to an attempt to insert an item into this Dictionary which has a key that already exists. This causes the exception.

    We will contact ReactiveUI's team to inform them about this case and discuss a possible solution.

    This is currently all we can do.

    Let us know if you have additional questions.

    Regards,
    Deyan
    Telerik by Progress
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  16. Deepak
    Deepak avatar
    19 posts
    Member since:
    Nov 2016

    Posted 15 Feb in reply to Deyan Link to this post

    Hi Deyan,

    Thanks for your support, If you find any solution then please let me know... I'm also working on it.

    Thanks again.

  17. Deepak
    Deepak avatar
    19 posts
    Member since:
    Nov 2016

    Posted 18 Feb Link to this post

    Hi Deyan,

    Thanks to you and your team for all the efforts that you guys have put.. can you please let me know that when the new release would be available?

  18. Deyan
    Admin
    Deyan avatar
    2147 posts

    Posted 21 Feb Link to this post

    Hello Deepak,

    I cannot currently confirm when are we going to address this issue. If we are to address it on our side, it will imply introducing breaking changes which we are not fond of.

    Please stay tuned for more information on that case.

    Regards,
    Deyan
    Telerik by Progress
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top