GoogleAnalyticsForXamarinForms icon indicating copy to clipboard operation
GoogleAnalyticsForXamarinForms copied to clipboard

System.NotImplementedException run time exception

Open vikingbei opened this issue 8 years ago • 8 comments

I got a run time exception, the main code is straight copy from the demo doc.

System.NotImplementedException: This functionality is not implemented in the portable version of this assembly. You should reference the NuGet package from your main application project in order to reference the platform-specific implementation.

vikingbei avatar Jun 23 '17 00:06 vikingbei

Hi, what s this platform?

KSemenenko avatar Jun 23 '17 06:06 KSemenenko

Same issue here. testing on Android. Happened both when I ran the initialisation on the PCL library as well as the Android executable

mhmacleod avatar Jul 03 '17 08:07 mhmacleod

Looking at the code, it throws an exception on the GoogleAnalytics class, method 'Current'. Basically it returns null when it detects that the Portable flag is set.

Why is this so?

EDIT Got it to work, had to rebuild the project, after making sure that the initialising only happens on the executable apps and not the PCL libraries. Thanks!

mhmacleod avatar Jul 03 '17 08:07 mhmacleod

I somehow can fix this for you?

KSemenenko avatar Jul 03 '17 17:07 KSemenenko

Hi:

Nope, my fault I guess. Fixed it with a rebuild. Probably didn’t work the first round cos I installed to a PCL, failed and didn’t clean after changing to install on the app project itself. But could be worth noting this on the project page’s instructions though.

From: ksemenenko [mailto:[email protected]] Sent: Tuesday, 4 July, 2017 1:25 AM To: KSemenenko/GoogleAnalyticsForXamarinForms [email protected] Cc: mhmacleod [email protected]; Comment [email protected] Subject: Re: [KSemenenko/GoogleAnalyticsForXamarinForms] System.NotImplementedException run time exception (#23)

I somehow can fix this for you?

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/KSemenenko/GoogleAnalyticsForXamarinForms/issues/23#issuecomment-312698937, or mute the threadhttps://github.com/notifications/unsubscribe-auth/APxFU_fv6S6hOjyd8Nay_pDLeZBFqqZ4ks5sKSP_gaJpZM4OC_NO.

mhmacleod avatar Jul 04 '17 02:07 mhmacleod

I also experience this and no matter if I install in my main PCL or my satellite PCL, I still get this message:

System.NotImplementedException: This functionality is not implemented in the portable version of this assembly.  You should reference the NuGet package from your main application project in order to reference the platform-specific implementation.
  at Plugin.GoogleAnalytics.GoogleAnalytics.get_Current () [0x0000d] 

I also tried to add to the Android project, but still exception. What is the main application project? I think that is the main PCL.

nologinatgit avatar Jul 06 '17 13:07 nologinatgit

What happened to me was this:

  1. Installed on my PCL - built, run - error
  2. Installed on my executable (Android project), moved initialisation code there - built, run - error
  3. Cleaned, rebuilt - worked

Xamarin seems to have a lot of issues with dll dependencies and breaks often with no warning, I get that a lot with Firebase. Just have to confirm everything with a clean-rebuild.

mhmacleod avatar Jul 07 '17 02:07 mhmacleod

I also often saw this. Apparently not working correctly Rebuild ((

KSemenenko avatar Jul 07 '17 03:07 KSemenenko