Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Realm namespace #3351

Closed
sandr01d opened this issue Jun 19, 2023 · 4 comments · Fixed by #3353 or #3357
Closed

Realm namespace #3351

sandr01d opened this issue Jun 19, 2023 · 4 comments · Fixed by #3353 or #3357
Assignees
Labels
App-type:Unity O-Community SDK-Use:Local T-Bug Waiting-For-Reporter Waiting for more information from the reporter before we can proceed

Comments

@sandr01d
Copy link

sandr01d commented Jun 19, 2023

What happened?

Since upgrading to version 11.1.0 I get the following compiler error:

error CS0118: 'Realm' is a namespace but is used like a type

When trying to use the Realm type like this:

using Realms;

public class Example
{
    private Realm realm;
}

Fully qualifying the type does resolve the error:

public class Example
{
    private Realms.Realm realm;
}

I think this might have something to do with the addition of the Realm namespace in #3323

Repro steps

  1. Create a new Unity project and add the realm package
  2. Create the following class:
using Realms;

public class Example
{
    private Realm realm;
}

Version

11.1.0

What Atlas Services are you using?

Local Database only

What type of application is this?

Unity

Client OS and version

Windows 11

Code snippets

using Realms;

public class Example
{
    private Realm realm;
}

Stacktrace of the exception/crash you're getting

No response

Relevant log output

Assets\Example.cs(5,13): error CS0118: 'Realm' is a namespace but is used like a type
@nirinchev
Copy link
Member

You're right - we must have overlooked that -

namespace Realm.UnityUtils
this should have been Realms.UnityUtils.

@yousufctec
Copy link

Upgrading to the version 11.1.1 has this issue in .NET Maui as build error.

@nirinchev
Copy link
Member

I can't reproduce this in Maui. Is this happening for you in a new project or an existing one? If you can upload a repro case here, that would be super helpful.

@nirinchev nirinchev reopened this Jun 20, 2023
@sync-by-unito sync-by-unito bot added the Waiting-For-Reporter Waiting for more information from the reporter before we can proceed label Jun 20, 2023
@nirinchev
Copy link
Member

I was able to track that down - looks like the xamarin tooling is generating a namespace that is the same as the assembly name (in our case Realm.PlatformHelpers). I'll try and see how we can disable or at least configure this.

@nirinchev nirinchev mentioned this issue Jun 20, 2023
2 tasks
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 11, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
App-type:Unity O-Community SDK-Use:Local T-Bug Waiting-For-Reporter Waiting for more information from the reporter before we can proceed
Projects
None yet
3 participants