Replies: 16 comments 3 replies
-
Can you try adding this to the iOS App project: <ItemGroup>
<PackageReference Include="System.Memory" Version="4.5.4">
<IncludeAssets>none</IncludeAssets>
</PackageReference>
<PackageReference Include="System.Buffers" Version="4.5.1">
<IncludeAssets>none</IncludeAssets>
</PackageReference>
</ItemGroup> |
Beta Was this translation helpful? Give feedback.
-
@thudugala I try to add those 2 but no success. Even try to add to all projects .. still getting error. |
Beta Was this translation helpful? Give feedback.
-
Can you please attach a sample project? |
Beta Was this translation helpful? Give feedback.
-
I don't have sample project yet. will see if I can create one later. |
Beta Was this translation helpful? Give feedback.
-
I didn't get chance to create sample project. But I did some more research and want to share, that some people suggest that .NETStandard2.0 might be a cause of this. Hiowever it is not true for me, as I didn't see .NETStandard2.0 in my project. Further more Some people blame it on Newtonsoft Json, which is there in my project, Second I try to use System.Memory 2.5.0 as one user say that it is only version that work for him, but didn't work for me. The error came when I try to create notification. So it is surely |
Beta Was this translation helpful? Give feedback.
-
I'm am running into the same issue. I was able to strip down our app and get a sample together. I tried creating a new project to recreate it, but for some reason it didn't misbehave. |
Beta Was this translation helpful? Give feedback.
-
https://docs.microsoft.com/en-us/dotnet/api/system.text.json?view=net-5.0&viewFallbackFrom=netframework-4.8 IT seems you are using System.Text.JSON in your code. which is not supported by older version on .NET framework. hence it is causing issues. |
Beta Was this translation helpful? Give feedback.
-
When I include the project directly (not as nuget package) it works. Also some research shows that error might be coming when JsonSerialization fails (that is why I add project directly) but I cannot reproduce it. However I still don't get notification. |
Beta Was this translation helpful? Give feedback.
-
Also happening on android, when app is launched in debug from visual studio 2022. |
Beta Was this translation helpful? Give feedback.
-
The Error is due to new library of JSON by Microsoft, maybe if we use NewtonSoft's Library for Json operation it solve it? |
Beta Was this translation helpful? Give feedback.
-
@archergod I was thinking maybe it should be pass to the user to serialize the string. What do you think? |
Beta Was this translation helpful? Give feedback.
-
@thudugala I agree, then he can choose which library he wants. BTW, my problem is solved for now, as I make a fork of project and use the source code directly in my as "Project in Solution". So I guess when you are making Nuget package it do not consider some extreme case. So you might leave it as is, and we suggest user with this problem to use Source code instead of Nuget Package. |
Beta Was this translation helpful? Give feedback.
-
@archergod Please try v9.1.0-preview01 You can change the Serializer NotificationCenter.Serializer = new YourNotificationSerializer()
Public class YourNotificationSerializer : INotificationSerializer
{
} |
Beta Was this translation helpful? Give feedback.
-
On my Google Pixel 3XL (updated to Android 12), when I try to schedule a notification using v9.1.0-preview01, I get the following message:
I don't see a notification after I schedule it. I uninstalled my app before trying to deploy the app through visual studio again. |
Beta Was this translation helpful? Give feedback.
-
@archergod try Try 9.1.0-preview02 |
Beta Was this translation helpful? Give feedback.
-
@thudugala I just recompile with new Preview 2 and it works like charm for me. I need to test further on real devices. But Serialization works great. (I use Newtonsoft) as I already have that in project. |
Beta Was this translation helpful? Give feedback.
-
Getting following Error (But it is not always, but 1 out of 2 attempt to debug my application give this error):
[0:] System.TypeInitializationException: The type initializer for 'System.Text.Json.JsonSerializer' threw an exception. ---> System.MissingMethodException: Method not found: int System.Text.Encodings.Web.TextEncoder.FindFirstCharacterToEncodeUtf8(System.ReadOnlySpan
1)at System.Text.Json.JsonEncodedText.EncodeHelper (System.ReadOnlySpan
1[T] utf8Value, System.Text.Encodings.Web.JavaScriptEncoder encoder) [0x00000] in <cb68364b029e41c3bf425990b94c94d9>:0 at System.Text.Json.JsonEncodedText.TranscodeAndEncode (System.ReadOnlySpan
1[T] value, System.Text.Encodings.Web.JavaScriptEncoder encoder) [0x00033] in :0at System.Text.Json.JsonEncodedText.Encode (System.ReadOnlySpan
1[T] value, System.Text.Encodings.Web.JavaScriptEncoder encoder) [0x00014] in <cb68364b029e41c3bf425990b94c94d9>:0 at System.Text.Json.JsonEncodedText.Encode (System.String value, System.Text.Encodings.Web.JavaScriptEncoder encoder) [0x00014] in <cb68364b029e41c3bf425990b94c94d9>:0 at System.Text.Json.JsonSerializer..cctor () [0x00042] in <cb68364b029e41c3bf425990b94c94d9>:0 --- End of inner exception stack trace --- at Plugin.LocalNotification.NotificationCenter.GetRequestSerialize (Plugin.LocalNotification.NotificationRequest request) [0x0003e] in <763ab1a1f1b64389a6f1b291e8872c5b>:0 at Plugin.LocalNotification.Platform.iOS.NotificationServiceImpl.Show (Plugin.LocalNotification.NotificationRequest request) [0x000fe] in <763ab1a1f1b64389a6f1b291e8872c5b>:0
I found some topic that other libraries get this error, but I always get error on this Plugin for iOS, on exact those line. I try to include the Nuget package of
System.Text.Encoding.Web
that should add this function in code, but it is still not working and generating error. I see you use JsonSerializer Maybe you can include that library default (as requirement) Fix it ?Beta Was this translation helpful? Give feedback.
All reactions