Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice
  4. Dismiss Notice

Resolved You are not authorized to set the license key

Discussion in 'Unity IAP' started by MattWhiting, Aug 17, 2022.

Thread Status:
Not open for further replies.
  1. MattWhiting

    MattWhiting

    Joined:
    Jan 11, 2016
    Posts:
    79
    upload_2022-8-17_0-14-27.png
    Found some posts saying to do it in the dashboard
    I went and added the google license key there:
    upload_2022-8-17_0-16-52.png
    But it still doesn't work.
    Hoping it didn't matter, I moved on.
    I just get the error:
    Required to have a value for transactionName
    I'm using IAP Button codeless at this point.
     
    stevenatunity likes this.
  2. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    14,446
    Can you elaborate, "still doesn't work"? Please share a screenshot of the error. You would be advised not to use Codeless, it has not been updated in some time and is missing key features like receipt validation to fight fraud. Instead, I would recommend that you start with this project, set your own ProjectID, update IAP and publish it straight to Google closed testing with no changes. Get the basics working first. Then apply lessons learned to your own game. Then you have a second test app that you can try out new assets without "breaking" your actual game. https://forum.unity.com/threads/sample-iap-project.529555/#post-7922275 and ensure to read the post just after it. This should help also https://docs.unity3d.com/Packages/com.unity.purchasing@4.4/manual/UnityIAPGoogleConfiguration.html
     
  3. MattWhiting

    MattWhiting

    Joined:
    Jan 11, 2016
    Posts:
    79
    It says, "You are not authorized to set the license key."
    Do I need to resolve this before I can move on?

    Screenshot above.

    I tried the coded version first. It gave the same errors and issues I've reported here, so I figured codeless would be easier for you to diagnose... I'll switch back to coded.

    Have done so... It gives the same error (screenshot above) "You are not authorized to set the license key."

    I have created a new project on Google Play and I'm building the My_Sample_IAP_Project for upload right now.
    I'll add an update as soon as that's complete, but for now, I want to stress that the original problem "You are not authorized to set the license key." persists here.
     
  4. MattWhiting

    MattWhiting

    Joined:
    Jan 11, 2016
    Posts:
    79
    Update... I'm still getting the "You are not authorized to set the license key."
    However, following your sample, the purchase seems to work in-editor.

    Your sample generates the following warning:
    "Unity IAP: Unity In-App Purchasing requires Unity Gaming Services to have been initialized before use.
    - Find out how to initialize Unity Gaming Services by following the documentation https://docs.unity.com/ugs-overview/services-core-api.html#InitializationExample
    or download the 06 Initialize Gaming Services sample from Package Manager > In-App Purchasing > Samples."

    That seems off. Presumably, I need to initialize that first, but I don't see it anywhere in the sample.
     
  5. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    14,446
    You already set the license key in the Dashboard, you should not need to set it in the Editor. So when you restart the Editor, that field is still blank? You showed text in your screenshot, how did it get there? I plan to update the sample with UGS Analytics initialization soon, you can use IAP without it for now.
     
  6. MattWhiting

    MattWhiting

    Joined:
    Jan 11, 2016
    Posts:
    79
    Ok cool.

    Yes. Let me boot it up for you and take a new screenshot:
    upload_2022-8-18_10-28-15.png

    From there, I open up my Google Play Dashboard, go get the public key, and paste it in there again:
    upload_2022-8-18_10-34-31.png
     
  7. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    14,446
    If you set it your Unity Dashboard, it should also show up here. Do not paste anything here under Options. So it's empty here, correct? After restarting Unity, and setting it as you've shown in your Unity Dashboard earlier. And this is for the same project, correct? The Google Dashboard, your Unity Dashboard, and the Services window all have to match the same project.
     
  8. itpstudent

    itpstudent

    Joined:
    Jul 14, 2022
    Posts:
    1
    Here is a screenshot of what it looks like this morning after rebooting. The Unity Dashboard has it in there, and the project is set up on Google Play.
    upload_2022-8-20_9-18-25.png

    "...same project..." I have 3 projects at this point as I work through this. (The main point of the effort is to provide an example for my mobile games class.)

    The project seems to work this way. I've uploaded to Google Play, installed, and I am able to purchase items with the test card. So it does work even with this error.
     
  9. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    14,446
    Interesting, I don't see this error. Are you using the CrossPlatformValidator for receipt validation? What version of Unity are you using?
     
  10. kenor_brooks

    kenor_brooks

    Joined:
    Jun 4, 2020
    Posts:
    46
    I get the same error. I've gotten it before and after searching the forum, I remembered that it was solved this way:
    Go into analytics in unity dashboard and adjust it.
    But now you can not go into analytics, writes that I must first buy something. And I'm stumped.
    Unity - 2021.3.0f1
    Purchasing - 4.5.0
     
    Pasha0706 likes this.
  11. CrossV4

    CrossV4

    Joined:
    Dec 21, 2020
    Posts:
    13
    Hi Jeff,
    I am using Unity 2021.3.10f1 version. I have the same error. In this before, i was using Unity 2019.x version i can successfully setting up IAP. But i cannot now. I transfered my older projects via Plastic SCM to my Unity 2021.3.10f1 my old projects successfully setting up IAP. But when i start a new project on this Unity version, this error comes up ( as screenshot from above ). I am setting up from Unity dashboard my Google Licence key, but i cannot do it in Editor. I restarted tons of times the Editor, even of i tried 1 or 2 days but still says "There was an error checking server for existing key". I think Editor could not get key from Server so that way we cannot setting up in Editor. What we could to do ?
     
    Last edited: Oct 23, 2022
    anycolourulike, maramak and Pasha0706 like this.
  12. Pasha0706

    Pasha0706

    Joined:
    Oct 3, 2020
    Posts:
    1
    Hi, I also had this error when I was using Unity 2021.3.6f1. I've already tried many different options, but only switching to a different version helped. I installed Unity 2021.2.10f1 and everything worked. That's why you get an error in the Unity version itself. I hope this helps you.
     
    anycolourulike and maramak like this.
  13. Arnaud_Gorain

    Arnaud_Gorain

    Unity Technologies

    Joined:
    Jun 28, 2022
    Posts:
    167
    This thread is now closed. Feel free to reach out via a new thread if you encounter further issue.
    Thanks!
     
Thread Status:
Not open for further replies.