cancel
Showing results for 
Search instead for 
Did you mean: 

Shared Spatial Anchors and, Testing, and Uploading unity build issues.

LeonNikolai
Honored Guest

I am trying to get Co-Location via shared anchors to work in unity. The project also uses mainly uses the Meta XR SDK, and Meta Platform SDK, but instead of photon (as used in sample colocation sample projects) this project uses Netcode.

I am unable to get the application to actually get the users ID and unable to share the Anchor when building directly to the headset. My core problems.

  1. The login callback on Core results in the USER ID of 0
  2. Sharing the anchors never completes

I tried 

  1. Creating a org
    1. Creating a app
    2. Verifying the org
    3. Get access for Data Checkup User ID and User Profile
  2. Adding App ID info to the Platform Settings
  3. I read somewhere that i need to Upload a build to meta before the headset will allow you to access the apis. So i...
    1. Adding all the necessary manifest stuff from here
      1. Create Manifest 
        1. Application Manifests for Release Builds | Oculus Developers
      2. Add Keystore
        1. Android Application Signing | Oculus Developer
      3. Making sure im not building with development stuff
      4. In general verifying the project with Meta XR tools (everything ok)
    2. Tried Build with the token from unit, and the dev software (none of the builds gets accepted when uploading to store)
      1. All i get is this error : 
        WARNINGS:
        • This app contains both 32-bit (armeabi-v7a) and 64-bit (arm64-v8a) libraries. This consumes extra storage and increases download times. Consider updating your build to target 64-bit only.
        • APK er feilsøkbar (android:debuggable i AndroidManifest.xml). Merk: Du kan bare distribuere feilsøkbare APK-er via private kanaler.
        :white_heavy_check_mark:Successfully Validated Build
        ⬆ Retrieving upload files
        APK: 97.8MB
        ⬆ Uploading APK
        :cross_mark:ERROR:
        Signer eller bygg om APK-et ved å bruke et produksjonssertifikat, eller bekreft at innstillingene for nøkkellagerversjonen er riktig.

         

For some reason parts of the error is in Norwegian despite my pc lang being in eng, but it seems to ask me to provide a production certificate or verify that the keystore version is correct. And from what i can tell i have done that.

How do i get co-location to work, do i have to upload a valid build before i can even access the relevant api's? How to i properly upload a build correctly, nothing i do seems to work.

 

Here is a snippet of the code i have to handle the Sharing of spatial anchors:

 

    private async void InitializeCoLocationAnchorAsync()
    {
        var anchor = CreateNewAnchor(transform);
        Log("1. Created Anchor");
        var localized = await WaitForAnchorLocalized(anchor);
        Log("1. Anchor Localized");
        Log("2. Trying to save Anchor");
        bool save = await anchor.SaveAsync(new SaveOptions() { Storage = OVRSpace.StorageLocation.Cloud });
        if (!save)
        {
            Debug.LogError("Failed to save anchor to cloud, retrying");
            return;
        }
        Log("2. Saved Anchor");

        

        // 3. Share cloud anchor with users (Gives users access to the anchor)
        Log("3. Trying to Share Anchor with users");
        OperationResult share = OperationResult.Success;
        try
        {
            share = await anchor.ShareAsync(SpaceUsers.Values);
// !!!
// THIS IS WHERE THE sharing fails, 
// not even logging the error gets executed.
// !!!
            Debug.LogError("ShareResult: " + share.ToString());
        }
        catch
        {
            Debug.LogError("Failed to share anchor with users" + share.ToString());
            return;
        }
        Log("3. Shared Anchor");

        Log("4. Setting Anchor ID in network variable");
        // 4. Share UUID with users (Gives users access to the anchor)
        // This should fire the OnAnchorUuidChanged event
        AnchorUuid.Value = new MetaSessionAnchorIds() { Ids = anchor.Uuid.ToByteArray() };
    }

 

 

Also a snippet from the get logged in user callback that only seems to give me ID of zero

 

    private void GetLoggedInMetaUserCallback(Message<User> message)
    {
        LocalMetaAccount = message.GetUser();
        if(message.IsError) {
            Debug.Log(message.GetError().Message);
        }
        UpdatePlayerData();
        Logger.Log("Got Logged In user");
        if(LocalMetaAccount.ID == 0) Debug.LogError("You Are not Authorized to use this app");
        OnApplicationIsReady.Invoke();
        IsReady = true;
    }

 

 

1 REPLY 1

BlackOut977
Explorer

Hey. Any progress on this? It looks like we're running into the same issue with the ,SaveAsync() never returning.