Search Unity

[Solved] "Common" assembly still missing despite udpates/reimport.

Discussion in 'Unity IAP' started by MPM, Mar 20, 2018.

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

    MPM

    Joined:
    Feb 21, 2014
    Posts:
    28
    Hi,
    my editor won't run anymore as it ask me to fix this compile error(s):

    FileNotFoundException: Could not load file or assembly 'Common, Version=1.0.6212.28264, Culture=neutral, PublicKeyToken=null' or one of its dependencies.
    UnityEngine.Purchasing.UnityPurchasingEditor.RefreshCheckmarks ()
    UnityEditor.EditorApplication.Internal_PlayModeStateChanged (PlayModeStateChange state) (at C:/buildslave/unity/build/Editor/Mono/EditorApplication.cs:215)
    UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)


    Prior to this, following a build error, i've updated to last stable versions:
    - Unity3D 2017.3.1f1
    - Unity IAP updated via the Service window. Disabled and re-enabled. Trying to Reimport and reopening the Project didn't solve the issue.
    - GooglePlayGamesPlugin-0.9.50 installed by importing the unitypackage (i removed previous files first)

    I also have these errors following the first one.
    Assets/plugins/unitypurchasing/generated/AppleTangle.cs(12,20): error CS0103: The name `Obfuscator' does not exist in the current context

    Assets/plugins/unitypurchasing/generated/GooglePlayTangle.cs(12,20): error CS0103: The name `Obfuscator' does not exist in the current context


    I currently have no clue of what i could do next.
     
    Last edited: Mar 20, 2018
  2. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    @MPM Does this occur on a new/empty project when you just import IAP?
     
  3. MPM

    MPM

    Joined:
    Feb 21, 2014
    Posts:
    28
    @JeffDUnity3D
    No.
    I've created a new project (which btw opened the crash report window while still starting) with IAP and the same 3 options enabled (Ads, Analytic and Purchases) and there's no compile error in the editor.
     
  4. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    That is good news. So you need to add assets/components until you can reproduce the behavior.
     
  5. MPM

    MPM

    Joined:
    Feb 21, 2014
    Posts:
    28
    I found the source of the problem:
    a "unitypurchasing" folder in a "plugins" folder. Is that Unity3D old stuff?
    I tried to delete it in my initial project work but apparently, one of my own script is relying on it (using a "ProductCatalog" class);
     
  6. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
  7. MPM

    MPM

    Joined:
    Feb 21, 2014
    Posts:
    28
    @JeffDUnity3D
    Yes, i already implemented features using IAP in my project (which is already published), but:
    - Making a blank project didn't create the /plugins/unitypurchasing folder despite the fact that IAP was enabled (but not fully setup) in the Services window.
    - In my original and published project, this is the directory that generates a compile error, but if i delete it, scripts using ProductCatalog won't work anymore.

    From what i understand here /plugins/unitypurchasing is storing project data related to IAP (like product catalog), and that where the error come from. But i don't see how to fix it nor what did cause it since i didn't touch anything related to IAP for months.
     
  8. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    IAP is component that you need to import after you enable the service. You mentioned you have code that depends on it, so when you deleted it, that caused the problem. If you have code that depends on the ProductCatalog, you need to leave the dependency in place.
     
  9. MPM

    MPM

    Joined:
    Feb 21, 2014
    Posts:
    28
    Update: the following post is now somewhat obsolete as i found out that the IAP Installer doesn't work as intended or expected (it have some sub-package). I still have a non working project but am now trying to sort out the mess my IAP install directory is before posting further.
    -----------
    I think there's miscommunication here: when i wrote that "I tried to delete it in my initial project work but apparently, one of my own script is relying on it (using a "ProductCatalog" class)" i meant that i tried that deletion in order to try to solve the original problem, this (temporary) operation was by no mean the root cause of my problem.

    Anyway, removing the unitypurchasing and UnityChannel, then letting Unity reinstalling it, then manually copying from by backup my json catalog definition and the "bin" directory where i more or less blindly guess the dependencies were (since the new install didn't reinstall these dependencies for a reason i don't get) led me to a situation were the Editor doesn't show compile error... until i hit play:
    "FileNotFoundException: Could not load file or assembly 'Common, Version=1.0.6212.28264"

    Note that Unity IAP installer constantly show a dialog box on play start or when something has changed:
    "The Unity IAP installer will determine if your project is configured properly before importing the Unity IAP asset package. Would you like to run the Unity IAP installer now".
    I accepted (like a dozen times), it does stuff, and nothing changes.

    I'm back to square one.

    Edit: i also tried to reimport the Unity IAP 1.17.0 from Asset Store but it still leads to the same FileNotFoundException error.
     
    Last edited: Mar 21, 2018
  10. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    When you reinstall IAP, you will also need to recreate your product catalog. Yes, the IAP installer has issues if there is a project compile error prior to the import. Are you able to re-add your assets to a new/working project?
     
  11. MPM

    MPM

    Joined:
    Feb 21, 2014
    Posts:
    28
    I end up fixing everything, but i have to mention that i run in a very surprising behavior from the package importer: instead of re-installing the script "IAPButton.cs", it tracked down an replaced the content of my similar IAPButtonEnhanced.cs script (that was located in a different path (not even in /plugins), and despite it having a different classname, filename and namespace (we see at the very bottom on this image)
     
  12. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    @MPM What did the importer replace it with? That would indeed be unexpected behavior.
     
  13. MPM

    MPM

    Joined:
    Feb 21, 2014
    Posts:
    28
    @JeffDUnity3D
    The installer replaced the content of my IAPButtonEnhanced.cs with the content of IAPButton.cs. If we look at the screenshot of my previous post, we can see the absence of the IAPButton.cs in the detected scripts, despite its presence in the project.

    IAPButtonEnhanced.cs has been created from a copy of the IAPButtonFile (months ago, as i needed an extra method, i didn't want to implement but choose to sandbox it in order to not have to deal with updates). But it appears that it kept the "gem" icon like the IAPButtonFile, so it must have kept a reference that get a priority over filename, class name and namespace.
     
  14. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    @MPM Thank you for the information, I will try to reproduce here.
     
  15. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    @MPM We have determined the likely cause of this behavior. If you moved/copied the file within Unity, the associated metafile was also likely moved. The metafile is the file used during the upgrade to determine the upgrade behavior for the file. You instead likely want to create a new file, then copy only the contents within IAPButton.cs for your purposes.
     
  16. MPM

    MPM

    Joined:
    Feb 21, 2014
    Posts:
    28
    Thank you for getting that info.
    I'll recreate the file to avoid problems in future updates.
     
  17. DBarlok

    DBarlok

    Joined:
    Apr 24, 2013
    Posts:
    268
    Hi,

    I need heeelp! Im receiving a BROKEN PIPE between Google VR and Unity IAP on Unity 5.5.6f. If i disable common.aar i manage to build, but i dont know if IAP will keep working. I will test this tomorrow as im tired now, but if you read this, can you explain me a little how this classes are conflicting and if i will have some problem with IAP in future? Im worried about disabling a common.aar inside UnityPurchasing to make VR work, but my game needs BOTH....:( I managed to build disabling common.aar for now....but , will it keep working with the Google VR class conflicting with it? ....
     
  18. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    @TheKingOfTheRoad Please open a new topic for the new issue that you are reporting.
     
  19. DBarlok

    DBarlok

    Joined:
    Apr 24, 2013
    Posts:
    268
    Hello, i'll do that then. Thanks and have a nice day!
     
Thread Status:
Not open for further replies.