Search Unity

In App Purchasing errors 2017.3.b7

Discussion in '2017.3 Beta' started by davidcox70, Nov 1, 2017.

  1. davidcox70

    davidcox70

    Joined:
    Oct 19, 2016
    Posts:
    29
    Hello,

    I've loaded an existing (2017.2) working project into 2017.3.b7 and am getting many console errors relating to in app purchasing. For example, "Assets/scripts/IAP.cs(4,19): error CS0234: The type or namespace name `Purchasing' does not exist in the namespace `UnityEngine'. Are you missing an assembly reference?"

    I tried removing and re-importing the In App Purchasing package. The services window says it is up to date.

    Similar errors relating to IStoreListener, IExtensionProvider, IStoreController, etc

    Is this something I can fix?

    Thanks :)

    DC
     
  2. davidcox70

    davidcox70

    Joined:
    Oct 19, 2016
    Posts:
    29
    Update:
    Problem seems to have been resolved.
    I uninstalled Unity 2017.3.b7 and 2017.2 that was still installed.
    Rebooted.
    Deleted the 2017.2 project that 2017.3.b7 had imported.
    Re-installed 2017.3.b7
    Copied from backup the original 2017.2 project and loaded it into 2017.3.b7 as before.
    All fine this time around.

    Maybe it didn't like having 2017.2 also installed.

    DC
     
  3. davidcox70

    davidcox70

    Joined:
    Oct 19, 2016
    Posts:
    29
    Another Update - problems return when project is re-loaded.

    This is the pattern:
    • Start with a working project saved from 2017.2 which includes in-app purchasing.
    • Open in 2017.3.b7. It spends some time re-importing assets.
    • There is one error in the console when Unity opens, but otherwise the project plays and builds correctly. The error is:
      "FileNotFoundException: Could not load file or assembly 'UnityEngine.Purchasing, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies."
    • Save the project and scenes. Quit Unity.
    • Re-open Unity and load the same project. It warns the project was last saved by 2017.2, even though it wasn't.
    • Project loads quickly and produces multiple console errors related to IAP as noted in my first post.
    • Project will not run or build as a consequence.
    DC
     
  4. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    6,548
    As a test after making a project backup, could you delete Assets/Plugins/UnityPurchasing then open the project in Unity and reimport IAP from the Services window?
     
  5. davidcox70

    davidcox70

    Joined:
    Oct 19, 2016
    Posts:
    29
    Thanks for the quick reply. Yes I did try that after posting earlier, but without change. Just tried again without improvement by doing the following:
    • Quit Unity
    • Deleted the assets/plugins/UnityPurchasing Directory
    • Opened Unity 2017.3.b7 and loaded project.
    • Services window still showed IAP / Analytics as on, so switched them off.
    • Saved project / quit / re-opened. IAP / Analytics now shown as off in the services window.
    • Switched IAP back on and imported the package. UnityPurchasing folder correctly restored to plugins.
    • Errors still present.
    • Restarted Unity / re-loaded project - errors still present.
    The script that generates the errors works in earlier versions and in fact is pretty much the Unity example code for IAP. The first few lines are:

    using UnityEngine;
    using UnityEngine.Purchasing;

    {
    private static IStoreController m_StoreController; // The Unity Purchasing system.
    private static IExtensionProvider m_StoreExtensionProvider; // The store-specific Purchasing subsystems.


    However, IStoreListener, IStoreController and IExtensionProvider are all unrecognised.

    DC
     
  6. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    6,548
    Understood, thanks for trying. I will do some testing here today, and will update this thread when I have additional information. Are you on Mac on Windows?
     
  7. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    6,548
  8. davidcox70

    davidcox70

    Joined:
    Oct 19, 2016
    Posts:
    29
    Sorry if I'm being dumb - where do I add "-keep class com.unity.purchasing.** { *; }"?
    I was using the internal builder and there are no files called "proguard" in my project. I tried switching to the Gradle build system and setting a user proguard file, but no difference so I guess that's not what you're asking me to do.
    DC
     
  9. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    6,548
    Understood, you may have a separate issue. I will be testing the upgrade process.
     
  10. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    6,548
    I am experiencing the same behavior when trying to upgrade an IAP-enabled project from 2017.2 to 2017.3. The workaround, although not ideal, would be to start with a new 2017.3 project, and add IAP and assets and scripts from the previous project (i.e. do not upgrade the project). I have let the IAP team know.
     
  11. davidcox70

    davidcox70

    Joined:
    Oct 19, 2016
    Posts:
    29
    Thanks Jeff for looking into this and finding the work around. Much appreciated :)
    DC
     
  12. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    6,548
    The issue has been identified, and should be addressed in the next beta release. Apologizes on the inconvenience.
     
    MrEsquire likes this.
unityunity