03-01-2024 06:51 AM - edited 03-01-2024 06:53 AM
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.
I tried
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;
}
05-04-2024 11:04 AM
Hey. Any progress on this? It looks like we're running into the same issue with the ,SaveAsync() never returning.