question

Robert avatar image
Robert asked

Inconsistent accessibility error in SDK

Today I updated my SDK to version 2.28.170925 and after deleting and reimporting to make sure it was a clean update, I received two errors:

Assets/PlayFabSdk/Server/PlayFabEvents.cs(28,74): error CS7025: Inconsistent accessibility: event type `PlayFab.Events.PlayFabEvents.PlayFabRequestEvent<DeleteCharacterFromUserRequest>' is less accessible than event `PlayFab.Events.PlayFabEvents.OnServerDeleteCharacterFromUserRequestEvent'

Assets/PlayFabSdk/Server/PlayFabServerAPI.cs(120,28): error CS0051: Inconsistent accessibility: parameter type `DeleteCharacterFromUserRequest' is less accessible than method `PlayFab.PlayFabServerAPI.DeleteCharacterFromUser(DeleteCharacterFromUserRequest, System.Action<PlayFab.ServerModels.DeleteCharacterFromUserResult>, System.Action<PlayFab.PlayFabError>, object, System.Collections.Generic.Dictionary<string,string>)'

Because of this I'm unable to open the playfab editor window or access the APIs.

apis
1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1807605288 avatar image 1807605288 ♦ commented ·

I think your best bet is to delete the PlayFab SDK from your project, and manually reinstall the latest unitypackage.

https://api.playfab.com/downloads/unity-v2ap

0 Likes 0 ·
Robert avatar image
Robert answered

I'm usually careful about namespaces and such because of this exact problem. What I found it to be, and @Paul Gilmore hit it right on the head, was a namespace issue. During one of the updates I suppose somewhere the server API had been re-organized and when trying to auto correct it, Visual Studio had created an internal class DeleteCharacterFromUser as I was allowing the client to choose to delete it from the account via the client. That internal class (which was it's own .cs I didn't even realize VS had created, was sitting in a folder I'm never in. (Of course, where else would it go...) Once I deleted that internal class and re-imported everything, it was fine.

So for those too lazy to read all of that, do yourself a favor and when you allow VS to make corrections that cause this kind of error, do what I did and manually search the folders with the name of the event.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

brendan avatar image
brendan answered

We're definitely not seeing that in the automated testing of the SDKs. Can you confirm your setup steps for the project?

3 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1807605288 avatar image 1807605288 ♦ commented ·

I'm inclined to believe that you have a namespace conflict where you're defining classes that have the same name as PlayFab classes at the root level of your project. You should not define classes that have the same name as other PlayFab classes declared in our SDK.

I think that if you move all your game class definitions into a namespace that reflects the name of your game/studio, it will likely resolve this issue.

You also should not try to put objects into the PlayFab namespace, as this will make the issue even more complicated to resolve.

1 Like 1 ·
Robert avatar image Robert commented ·

Well I've been using it for a while without issue, upon updating today, the errors occurred. I deleted both the playfab folders and re-imported the unity packages, and the error still exists. Really not a lot of steps to duplicate, I even looked it all my scripts and remove the only one that had DeleteCharacterFromUser method located in it as a precaution, then removed and reinstalled PF.

0 Likes 0 ·
brendan avatar image brendan Robert commented ·

Can you delete the SDK from your project entirely, and manually re-install the latest package? If you still see errors after that, can you make a new project and try installing the latest SDK, to see if you can reproduce this with a fresh project?

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.