In App Purchasing errors 2017.3.b7

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 :slight_smile:

DC

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

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

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?

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

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?

Can you try the Proguard settings as described here? [Solved] On the Android device appears error "filed to bind to native store" after updating

-keep class com.unity.purchasing.** { *; }"

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

Understood, you may have a separate issue. I will be testing the upgrade process.

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.

Thanks Jeff for looking into this and finding the work around. Much appreciated :slight_smile:
DC

The issue has been identified, and should be addressed in the next beta release. Apologizes on the inconvenience.

1 Like