Search Unity

IAP compatibility issues

Discussion in 'Unity IAP' started by theunsigned, Apr 2, 2019.

  1. theunsigned

    theunsigned

    Joined:
    Nov 15, 2018
    Posts:
    33
    Hi, I'm using version 2018.3.1f1 Personal and I've been trying to implement IAP into my game; but, each time I import the service and restart the project, all of my scripts are disconnected and I'm getting an error about the Editor.

    I just can't seem to figure this out. If I update the API when importing IAP, the same thing happens as when I say "No Thanks."

    Generally, I'm very confused about how to smoothly update Unity without breaking everything; but, all of the tutorials and articles I've read and watched make it seem like it should be a much more smooth process than it has been for me. Is there a way to see which version of IAP matches my version of Unity and download it? I am having a heck of a time finding resources for that and on how to update without disonnecting all of my scripts.

    Any suggestions or references?

    Many thanks!
     
  2. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
  3. theunsigned

    theunsigned

    Joined:
    Nov 15, 2018
    Posts:
    33
    Thank you, I really appreciate your knowledge and assistance. I followed your advice and it seems that everything worked in the example project. Unfortunately, when I import IAP into my game, it disconnects all of the script components.

    I followed the steps in the video, which was very clear, thank you. I added a gameobject with a script from my project, saved and closed Unity, reopened it, and it did not seem to detach the script component like it did to all the scripts in my game.

    Should I install an older version of IAP and then update it like I did in this example? If so, which version matches 2018.3.1f1 and where might I find that?

    Alternatively, should I look into upgrading Unity mid-project? If so, do you have any recommendations/references for how to do that safely?

    Many thanks again!
     
  4. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    You would want to use the latest IAP version. You could certainly try with a more recent version of Unity also, just make sure to make a back up of your project first. If you could provide a simple project that reproduces your issue (probably not your full project), it would help, also.
     
  5. theunsigned

    theunsigned

    Joined:
    Nov 15, 2018
    Posts:
    33
    Thanks, I guess I'll look into updating Unity but that has always disconnected my scripts as well. I tore down my project and zipped it so you could see. It's almost 13mb so I couldn't upload it. Here's a link to it on google drive: https://drive.google.com/file/d/1lRoF4sV8l_Z_zH7gGeLGkJukPaxfh057/view?usp=sharing

    Basically, if you open it, all the scripts will be disconnected; but, if you delete Assets->Plugins->UnityPurchasing and the .meta file, everything reverts back to being connected.

    I just don't get it. Again, I really appreciate your assistance. I've worked really hard to learn C# over the last few months and I hope I can get this working. I don't know why updating Unity disconnects everything; it seems like that could be a more smooth process.
     
  6. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    It looks like your project is using obsolete APIs. When installing IAP, you must select "Yes, I made a backup" when prompted to Update API. You really shouldn't be deleting files as you suggest, rather follow the directions here: https://forum.unity.com/threads/iap-troubleshooting-remove-and-reinstall-unity-iap.511747/ I might suggest you start over with your project. Install IAP first which will update the Unity API. Then import your other assets, ensuring they don't contain references to obsolete API.
     
  7. theunsigned

    theunsigned

    Joined:
    Nov 15, 2018
    Posts:
    33
    Yipes, is there any way to figure out what references obsolete API and clean things up in the existing project? I'd hate to start from scratch.
     
  8. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Make a back up, and start testing! Unfortunately will likely require trial and error. Personally I would start a new project, import IAP, and also add one or two components from existing your game that might be candidates.
     
  9. theunsigned

    theunsigned

    Joined:
    Nov 15, 2018
    Posts:
    33
    Oy, well thank you again for all of your help. I really do appreciate it. I'm just not sure what to do because I worked so hard setting things up and I'm not sure how to set up the scenes, buttons, etc., again in the most efficient way. Regardless, you've been phenomenally helpful. Thank you!
     
  10. theunsigned

    theunsigned

    Joined:
    Nov 15, 2018
    Posts:
    33
    This is crazy. I started a new project, installed IAP/Ads, which updated the API, then dragged in all of my gameobjects and everything seems to work. I need to tweak some of the camera settings but it all seems to be working.

    All except the google public key, which Unity says is not in the right format, though it's the same as the older project. Any ideas on any of this? It seems remarkably strange.
     
  11. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    For the public key, set it in the Dashboard. In the Services window in the Unity Editor, click on Go to Dashboard. It should prompt you for the key when you get there. If not, then in the Dashboard directly, go to Settings on the left navigation, and select Analytics Settings.
     
  12. theunsigned

    theunsigned

    Joined:
    Nov 15, 2018
    Posts:
    33
    Yeah, I did that but it's not accepting the key, which is odd because it accepted it in the older project.

    Any idea why all the scripts worked when installing IAP first? I'm so relieved that it was that much easier redoing the project. I thought I'd basically be starting from scratch. Thank you so much for your help!
     
  13. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Were you able to enter the key into the Dashboard? If so, there is no need to enter it into the Editor. Reload the project, it should be there.
     
  14. theunsigned

    theunsigned

    Joined:
    Nov 15, 2018
    Posts:
    33
    I forgot to reload, my bad. Thanks again.
     
  15. theunsigned

    theunsigned

    Joined:
    Nov 15, 2018
    Posts:
    33
    I'm getting this, which I'm not sure about. It might have something to do with my previous issue. Any insights?

    UnityAdsEditor: Initialize(3103607, False);
    UnityEditor.Advertisements.UnityAdsEditor:EditorOnLoad()
     
  16. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Please don't post random issues as soon as you see them, take your time, and please research first. Test on a new project, etc. If this is an issue with ads, then please post in the Ads forum if this is a new issue. But this does not look like an error, be sure to post steps to reproduce, any errors that you are seeing, and user impact.
     
  17. theunsigned

    theunsigned

    Joined:
    Nov 15, 2018
    Posts:
    33
    Sure, I apologize. I thought it could have been related because I'm not sure why your suggestion worked so well. Thanks again; I really appreciate your time and knowledge.