How to set up API key

Include the following details (edit as applicable):

  • Issue category: Unity Example Package
  • Device type & OS version: iOS
  • Host machine & OS version: Linux 20.04
  • Issue Environment : Unity Editor
  • Xcode version:N/A
  • ARDK version:1.0.1
  • Unity version:Unity2020.3.24f1

Description of the issue:
I follow the tutorial at Niantic AR Development Kit (ARDK): Authentication and try to set up API key.
I have done step 1 to 3 and in step 4 when I clicked Init buttons, the error message below occurred.

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!
Niantic.ARDK.Networking._NativeMultipeerNetworking…ctor (Niantic.ARDK.Networking.ServerConfiguration configuration, System.Guid stageIdentifier) (at Assets/ARDK/Networking/_NativeMultipeerNetworking.cs:575)

How could I fix this problem? Thank you.

Hello Yuchen,

I have a couple of suggestions that may help, although keep in mind that as Linux is not officially supported by ARDK at this time, these suggestions may not work:

  1. Make sure that your API key is copied exactly as it is shown in your account dashboard. Any whitespaces or trailing whitespaces in your API key will cause authentication to fail.
  2. If you are attempting to use networking features from the Unity Editor directly after completing step 2 in the Authentication setup documentation and the API key is failing to load, try restarting the Unity Editor.
    Hope this helps!

Hello,
Thanks for your reply.
I have tried your suggests but failed either.
Maybe I will try ARDK package on other OS.

Hello Yuchen,

I am sorry it did not work. Please let support or the community at large know if we can try to help you further.

@Jason_Rose1
Hi,

i could not open the ArdkAuthConfig in the ARDK menu before adding api key.
I can see such content while watching the getting started video, but even though I follow the same steps, I do not see such a part.

How can I pass this stage?

I need help to take the next step. I would be very happy if you could help.

Hello Umut,
We are sorry you are having such trouble. A couple of questions if you will. Your file structure looks correct, but did you create the ArdkAuthConfig correctly. You need to be in this file path: Assets>ARDKExamples>Resources>ARDK. Once you are in that file then you right click to get the menu, go to create, then ARDK, then select ARDKAuthConfig. That will create your script container where you can place your API Key that you generate on the Sign in – Niantic Lightship. Give this a try and let us know how it works for you.

Hello Umut,
We are reaching out to you to see if we can assist you further. Did our suggestions help? Is your issue resolved? Please let us know how we can help.

I have tasted the tutorial exactly as described here: Niantic AR Development Kit (ARDK): Authentication and I got the same error message when I try to initialize the session in LowLevelNetworking example scene (when pressing the “Init” button).

Error message:

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!
Niantic.ARDK.Networking._NativeMultipeerNetworking..ctor (Niantic.ARDK.Networking.ServerConfiguration configuration, System.Guid stageIdentifier) (at Assets/ARDK/Networking/_NativeMultipeerNetworking.cs:575)
Niantic.ARDK.Networking.MultipeerNetworkingFactory._Create (Niantic.ARDK.RuntimeEnvironment env, System.Guid stageIdentifier, Niantic.ARDK.Networking.ServerConfiguration configuration) (at Assets/ARDK/Networking/MultipeerNetworkingFactory.cs:218)
Niantic.ARDK.Networking.MultipeerNetworkingFactory.Create (Niantic.ARDK.RuntimeEnvironment env, System.Guid stageIdentifier) (at Assets/ARDK/Networking/MultipeerNetworkingFactory.cs:62)
Niantic.ARDK.Extensions.NetworkSessionManager.Create () (at Assets/ARDK/Extensions/NetworkSessionManager.cs:172)
Niantic.ARDK.Extensions.NetworkSessionManager.InitializeImpl () (at Assets/ARDK/Extensions/NetworkSessionManager.cs:89)
Niantic.ARDK.Extensions.UnityLifecycleDriver.Initialize () (at Assets/ARDK/Extensions/UnityLifecycleDriver.cs:132)
UnityEngine.Events.InvokableCall.Invoke () (at <af218701fe324032b521ddd91f13662b>:0)
UnityEngine.Events.UnityEvent.Invoke () (at <af218701fe324032b521ddd91f13662b>:0)
UnityEngine.UI.Button.Press () (at Library/PackageCache/com.unity.ugui@1.0.0/Runtime/UI/Core/Button.cs:68)
UnityEngine.UI.Button.OnPointerClick (UnityEngine.EventSystems.PointerEventData eventData) (at Library/PackageCache/com.unity.ugui@1.0.0/Runtime/UI/Core/Button.cs:110)
UnityEngine.EventSystems.ExecuteEvents.Execute (UnityEngine.EventSystems.IPointerClickHandler handler, UnityEngine.EventSystems.BaseEventData eventData) (at Library/PackageCache/com.unity.ugui@1.0.0/Runtime/EventSystem/ExecuteEvents.cs:50)
UnityEngine.EventSystems.ExecuteEvents.Execute[T] (UnityEngine.GameObject target, UnityEngine.EventSystems.BaseEventData eventData, UnityEngine.EventSystems.ExecuteEvents+EventFunction`1[T1] functor) (at Library/PackageCache/com.unity.ugui@1.0.0/Runtime/EventSystem/ExecuteEvents.cs:262)
UnityEngine.EventSystems.EventSystem:Update() (at Library/PackageCache/com.unity.ugui@1.0.0/Runtime/EventSystem/EventSystem.cs:385)

ARDK v1.1.0
ExamplesPackage 1.1.0
Unity 2020.3.17
Win 10 os

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?

In my case, I have multiple ArdkAuthConfig in my project, because I downloaded multiple packages(ARdkExamples and LightshipHub), and both of them have the ArdkAuthConfig. I only put the API key in one of them and during the build, the SDK removed one of the Config automatically, apparently, it removed the good one…It worked after I deleted the empty one.