arcore-unity-extensions
arcore-unity-extensions copied to clipboard
Persistent Cloud Anchors - ErrorNotAuthorized
Testing with AR Foundation on Android:
Unity 2019.4.11f1 AR Foundation 4.1.0 Preview 9 ARCore Extensions 1.20
Running the sample scene, everything is going well until the CreateCloudAnchor is triggered: Host Failed Failed to host a Cloud Anchorwith error Error Not Authorized
I'm running it with the keyless setting.
It looks like KeyLess doesn't work for now, even if it's the recommended option:
Using an API fixed the issue.
How do you do that?
Using an API key instead of keyless. But it's definitely not a good solution because the key are not persistent using this method. I'm still trying to figure out how to use keyless but no luck for now.
I try too. If I find something, I will post here.
In Google Cloud Platform:
- OAuth 2.0 Client IDs is setup with the package name and a certificate fingerprint
- A consent screen is setup with
In Unity, keyless is selected, no API key is set.
When I start the app I don't see any consent screen, is is normal? After placing an Anchor it's still: Error Not Authorized
I am also trying to get this to work. I have followed the instructions for Keyless authentication but I keep getting the same Error Not Authorized.
Is this really not available yet or am I doing anything wrong?
@tedruxpin Any chance to have more details on this issue? The documentation seems to be lacking something, or it's because of all the preview packages and new Unity version we are using that just doesn't work. Is there a project setup somewhere with the right packages, Gradle version (I'm not talking about the sample)? Thanks
I had the same problem with the authorization. After updating the project to 2020.2.0b11 it seems to be working. I can host and resolve a persistent anchor, with keyless method.
I was running 2020.1.10 before, which had the ErrorNotAuthorized issues. The major difference between these editor versions is the updated Gradle version integrated in 2020.2, the older version needed to install the Gradle 5.6.4 (that is required for the Arcore Extensions to work) manually, so maybe the problem lies somewhere there
I had the same problem with the authorization. After updating the project to 2020.2.0b11 it seems to be working. I can host and resolve a persistent anchor, with keyless method.
I was running 2020.1.10 before, which had the ErrorNotAuthorized issues. The major difference between these editor versions is the updated Gradle version integrated in 2020.2, the older version needed to install the Gradle 5.6.4 (that is required for the Arcore Extensions to work) manually, so maybe the problem lies somewhere there
@elCangrejo Can you please explain more about how you handled gradle version? Any changes you made or it is just Unity version update that did the magic? I tried with new Unity version but still the same authorization issue!
Thanks,
@hcnw So if you are running 2020.1 or below you can download the Gradle version 5.6.4. on this website. You install it and then you can set it as Gradle Path in your Unity Preferences under External Tools.
At the moment I'm using version 2020.2.1 and I didn't have any problems with this specific error. So if the Gradle is not working, maybe consider upgrading to the newest version. If that is also not working, then it is probably time to pray to the Unity gods
@elCangrejo What you're talking about is a one-day anchor? Or do you mean Persistent Anchor?
@elCangrejo What you're talking about is a one-day anchor? Or do you mean Persistent Anchor?
I'm talking only about the persistent Anchors with keyless method.
for me,
@hcnw So if you are running 2020.1 or below you can download the Gradle version 5.6.4. on this website. You install it and then you can set it as Gradle Path in your Unity Preferences under External Tools.
At the moment I'm using version 2020.2.1 and I didn't have any problems with this specific error. So if the Gradle is not working, maybe consider upgrading to the newest version. If that is also not working, then it is probably time to pray to the Unity gods
For me, i am able to host an anchor but it can only be resolved in the device that hosted it. If i try to resolve it in another device, failed to resolve: not authorized error comes. is there any way to resolve it in another device ?
Got is working Guys. Try using:
- unity version 2020.2.6f1
- Gradle Version 6.8.3
- Android Extension version 1.23
How did you update your gradle version in Unity3d?
@kshitizsv-vizara provide a step by step solution. How did you set the gradle version? How did you set the Android Extension version? Your comment is quite vague
The solutions offered here no longer work. I have tried running the Persistent cloud anchor sample app and I still can't host anchors.
I can't seem to reproduce this problem; here are the steps I followed:
- Get the persistent cloud anchor sample app to work by following various instructions on the quickstart and build for Android 11.
- Verified that the project does NOT work, as I did not configure any Google Cloud Platform settings.
- In a new GCP project, I created a OAuth 2.0 client ID (and configured an OAuth consent screen), using package name from Player Settings > Android > Other Settings > Package Name and SHA values from
keytool -keystore ~/.android/debug.keystore -list -v
. - Enabled the ARCore Cloud Anchor API in GCP.
- Rebuilt and ran the Persistent Cloud Anchor sample app. This time, I was able to host an anchor.
I'm also using gradle-6.8.3, but I don't think that should matter (posting just in case)
Here are some troubleshooting steps; try them out and ensure that the values in your Google Cloud project match:
- Check the SHA-1 key used to sign your apk and ensure it's the same as the key in GCP:
Android/sdk/build-tools/30.0.1/apksigner verify --print-certs built-unity-game.apk
- Use
aapt
to confirm the package name of your built apk and ensure it's the same as the package name in GCP:Android/sdk/build-tools/30.0.1/aapt dump badging built-unity-game.apk | grep package:
@devbridie I followed your instruction but now I can't even find the option for keyless cloud anchor hosting. Why are the Unity tutorials so fragmented for ArFoundtion? Please provide a step-by-step guide as to what I should do.
Keyless documentation is located here!
huh? Of course I know about that. I tried that, it doesn't work. I still get the Error Not Authrized message.
Any update on this? Either offer a solution or tell us that is not working so we may stop wasting our time. There is no one to message in Google to make this work as well. You need to fix your customer service for cloud anchors
We can't get keyless authentication to work either. Any update on this would be appreciated.
After trying multiple times, realized this is intentional
On Mon, Jun 21, 2021 at 11:39 PM ChristianSchnellmann < @.***> wrote:
This message was sent from a non-IU address. Please exercise caution when clicking links or opening attachments from external sources.
We can't get keyless authentication to work either. Any update on this would be appreciated.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/google-ar/arcore-unity-extensions/issues/22#issuecomment-865240059, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALYZMAWCSUQMBURNHPDL5YDTT5535ANCNFSM4SHYYFAA .
@hcnw how do you know this is intentional?
I do not know exact but I think it should have worked for someone by now if it was functional. Also, there is no resolution to this so far
On Tue, Jun 22, 2021 at 2:45 PM iAmJuan550 @.***> wrote:
This message was sent from a non-IU address. Please exercise caution when clicking links or opening attachments from external sources.
@hcnw https://github.com/hcnw how do you know this is intentional?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/google-ar/arcore-unity-extensions/issues/22#issuecomment-865794644, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALYZMAWZIWD3ZWTHD6CPTR3TUBIELANCNFSM4SHYYFAA .
Since I ran into trouble with my team again, regarding the persistent Anchor creation, I can share some tips:
- Run the newest Unity Version possible (2020.3.1 is working fine for me)
- Try Assets> External Dependency Manager > Android Resolver > Force Resolve
- Be patient!!! For my Team it took a day, after adding the keystore SHA to the Google Developer Console, until the Hosting & Resolving was working without troubles
For those fighting with ErrorNotAuthorized problem - check your if your androidresolverdependencies.xml file contains the following references:
It took me a lot o time to point down the cause of this error.
Anyone having trouble building on iOS platform? How do I build iOS app with Authentication Token?
@Renkon117, please see instructions on the Cloud Anchors developer guide for iOS for how to use SetAuthToken at runtime.
As mentioned on the other thread, we've identified a problem with Unity's package cache isolation and are working towards a fix. In the meantime, here are some troubleshooting steps from that thread:
- Check for the existence of
ProjectSettings/AndroidResolverDependencies.xml
. If this does not exist, then probably this is the source of problems;- Check
Temp/gradleOut/unityLibrary/build.gradle
; this should contain some lines with'com.google.android.gms
.If this is the case, then GMS authentication libraries are missing at runtime, and this causes authentication to fail.
This may be caused by incorrect permissions in our provided tgz. If you're encountering this, a possible workaround is to remove ARCore Extensions from the Package Manager, then extracting the tgz first, then use
Import from Disk
to import the resultingpackage.json
. Trigger a new build, and (1) and (2) should appear from above.