How to set up an API key follow-up thread

Include the following details (edit as applicable):

  • Issue category: Semantic Segmentation / Multiplayer / Real-time Mapping-Depth / ARDK Documentation / Unity Example Package / Sample App aka ‘AR Voyage’ / ARDK Virtual Studio Tools / Developer Tools / Networking
  • Device type & OS version: Android / iOS / Other Ex. iPhone 8+ on iOS 13
  • Host machine & OS version: Mac / Windows / Linux / Other Ex. Mac on Big Sur x.x
  • Issue Environment : Unity Remote / Unity Mock / On Device / Dev Portal
  • Xcode version:
  • ARDK version:
  • Unity version:

Description of the issue:

I’m having the same issue. I’ve followed the instructions exactly, and also tried building to my device, but I get this “Exception: Attempting to use networking without setting up your API key or Authentication URL. Set those up through the ARDKAuthRegistrar, or at runtime on ServerConfiguration before using networking!” error.

I’ve setup my API key exactly (no trailing spaces) in the Assets/ARDKExamples/Resources/ArdkAuthConfig object. I also tried restarting Unity, to no avail. I’m on Windows. Any clues as to why I might be getting this error?

Created on behalf of Victor_Temprano

Please respond to this thread @Victor_Temprano so we can help you further.

How to set up API key - #8 by Minas_Katsiokalis Link to previous thread

Hi, it happens that I’m also having this same issue. Also on Windows. Followed the same instructions and making sure the API key is copied exactly, but no dice. Incidentally I also tried making a new license key, which also didn’t work. I’ve confirmed the path is correct at Assets/ARDKExamples/Resources/ArdkAuthConfig

“Exception: Attempting to use networking without setting up your API key or Authentication URL. Set those up through the ARDKAuthRegistrar, or at runtime on ServerConfiguration before using networking!”

Please advise. Thank you!

Hi Victor and Jim,

When a problem like this occurs it can be related to having a space at the end of your API key. What I would like you to try is just hit the “copy” link on the key and paste that into your ArdkAuthConfig. I am enclosing some images for reference:

This should resolve your issue. If this solution doesn’t resolve things then we will continue to troubleshoot the issue.

Hey Victor and Jim,

I have a follow-up question, can you tell me what version of Unity and what version of Lightship you are both using?

Sure. I can verify that I do not have an extra space on the end of the key. I’m using Unity 2020.3.25f1. I understand that Lightship may not support this version of Unity – could this be the issue?

Hey Victor,

I don’t think the problem would be with the Unity version. What OS/host machine are you using currently? Also what Version of ARDK do you have installed? Also is your Runtime Environment set to “Mock” in the Inspector.

I can confirm I’ve used the Copy link and get the same message.

I’m on Unity version 2020.3.1f1, on Windows 11. ARDK is version 1.3.1. The runtime environment is set to Live Device as advised by the documentation.

Thank you!

Hey Victor and Jim,

Have either of you tried building to a device instead of trying to run in just the Unity Editor? There is a known issue concerning this that I will repost here.

Verification of authentication in the Unity Editor currently only works on Intel Macs. If using a different development platform, you must deploy your ARDK app to a mobile device in order to verify that authentication has been set up properly. Logs can be viewed by clicking the Toggle Log button.

I am also placing a link to the documentation here:

Hello, thanks for followups.

Note that in the documentation (Niantic AR Development Kit (ARDK): Authentication), it specifically says to set the “Runtime Environment” to “Live Device”. I have had set it to this and received the error messages detailed above.

When I set the runtime environment to “Mock” instead in the Editor, I do not get the error message anymore. Instead I see a log saying, “Network session initialized”. The yellow dot stays yellow, though.

I have indeed done a build to my device, as I mentioned here: How to set up API key - #9 by Victor_Temprano. I built from my Windows machine to an Android device as I noted the “known issue” that you mentioned. The Android device did not seem to connect when pressing “Init” in the LowLevelNetworking scene. The scene didn’t crash, but the yellow dot stayed yellow and I only saw a log when using the in-scene log that said “Network session initialized” and beside the yellow dot, said “Not Connected”.

I just did another build to another Android device just now, for the sake of testing further. With “Mock” in place the test scene does the same as described in my last paragraph. With “Live Device” selected, the exact same things happen.

Ah ha, I think I’ve found a solution here to get it to connect. There’s a step possibly missing in the documentation?

If I press the button beside “Session ID”, a string gets generated into the Session ID button. Then the Connect button is no longer greyed out. I press “Init”, then press “Connect”, and then the yellow circle turns purple and I get the successful “Connected As Host” message.

This does NOT work in Unity Editor, but it does work on my Android device after a build.

Maybe we can add the step to the docs to talk about needing to press the Session ID button before Init and Connect?

1 Like

Hi @Victor_Temprano , thanks for flagging the missing step in our documentation. We’ll get that fixed.

Also, please note that you can enter your own Session ID into the field next to the button if you’d like to use a specific string for the Session ID.