Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice
  2. Ever participated in one our Game Jams? Want pointers on your project? Our Evangelists will be available on Friday to give feedback. Come share your games with us!
    Dismiss Notice

Unity Editor migration -> IAP crash

Discussion in 'Unity IAP' started by Annopolus, May 25, 2019.

  1. Annopolus

    Annopolus

    Joined:
    Apr 15, 2015
    Posts:
    17
    Hi All,

    last days I had the "pleasure" to install some different Unity versions (because my code is dependent on the issue with audio which was solved in 2019.2 (beta)) and following that I migrated also my project across new Unity Editor versions.

    I jumped from 2018.3.12f1 -> 2019.1.3.f1 -> 2019.1.4.f1 -> 2019.2.0b3

    ALWAYS I had issues with IAP.
    • Description of your issue
    After new Unity Editor recompilled all code to the higher version I got very similliar errors:
    upload_2019-5-25_22-28-2.png

    Additionally all scripts connected to UI IAP elements dissapeared:
    upload_2019-5-25_22-29-13.png
    (whih I assume is a result of above errors).

    • Unity Version
    I had this problem in this versions: 2019.1.3.f1, 2019.1.4.f1, 2019.2.0b3
    However, in the 1st and 2nd I was able to fix it accordind to the instruction published on this forum (completely removing IAP by deleting 2 folders in Plugin and importing again from Services window). It works finally fine (not always in the 1st run but finally after some rounds it was fixed). But for 2019.2 beta - no way. I deleted dll's all folders, reimported/imported, etc.... no success.
    • Unity IAP version
    the newest: 1.22.0
    • Platform you are building for
    Android
    IL2CPP
    .NET 4
    ARMv7, ARM64, x86
    • Store you are targeting
    Google Play

    EDIT:
    What I just noticed is different between 2019.1 and 2019.2 is the follwoing error when I tried to recreate IAP plugins:

    Reload Assembly called from managed code directly. This will cause a crash. You should never refresh assets in synchronous mode or enter playmode synchronously from script code.
    UnityEditor.EditorApplication:Internal_CallUpdateFunctions()

    I can see it blocks the full import process, so in result I have only Unity Purchasing folder recreated with Editor subfolder within and 3 packages (UDP, UnityChannel, UnityIAP)

    EDIT2:
    Change to MONO from IL2CPP didnt helped :-(
     
    Last edited: May 26, 2019
  2. spacepluk

    spacepluk

    Joined:
    Aug 26, 2015
    Posts:
    187
    I'm also seeing the reload assembly error even when trying to import IAP in an empty project with 2019.1.4f1

    Reload Assembly called from managed code directly. This will cause a crash. You should never refresh assets in synchronous mode or enter playmode synchronously from script code.
    UnityEditor.EditorApplication:Internal_CallUpdateFunctions()
     
  3. spacepluk

    spacepluk

    Joined:
    Aug 26, 2015
    Posts:
    187
    Importing the three packages manually seemed to help in my case. In the middle I got the errors in your first screenshot.
     
  4. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    7,439
    One note, there is a known issue that Unity 2019 doesn't properly trigger the required API update. Ensure that you install Unity into a path with no spaces, like C:\Unity. We are working on this.
     
    spacepluk likes this.
  5. spacepluk

    spacepluk

    Joined:
    Aug 26, 2015
    Posts:
    187
    Thanks! Unity Hub puts stuff under "C:\Program Files". Do you think I should reinstall just in case? or is it fine now that I managed to get over the installation?
     
  6. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    7,439
    No, you need to (re)install to a path with no spaces. I believe the gear icon in the Hub allows you to set the location.
     
    spacepluk likes this.
  7. Annopolus

    Annopolus

    Joined:
    Apr 15, 2015
    Posts:
    17
    I have all Unity's editors installed in d:\Unity\. and problem exist.
    Maybe the problem is with spaces AND special characters, as HUB installs editors in folder with dots, ie: d:\Unity\2019.1.4f1?
     
  8. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    7,439
    Not sure but would be easy enough to test. I'm currently installing to a folder like "D:\Unity201914f1" and will let you know soon, I'm testing now.
     
  9. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    7,439
  10. sravanthiN

    sravanthiN

    Joined:
    Jun 28, 2019
    Posts:
    2
    I am getting same error, after importing AR camera and I have downloaded unity2019.1.9f1pesonal, my laptop is brand new it has enough space for the software, please help me to fix it I am the beginner for unity and vuforia
     
  11. bws99

    bws99

    Joined:
    Apr 24, 2017
    Posts:
    11
    Dude, i have same situation with urs. Did u find any solution? im trying to solve this for 3 days. gonna be crazy..
     
  12. DarkDungeonStudio

    DarkDungeonStudio

    Joined:
    Oct 31, 2013
    Posts:
    23
    Same issue here.
    Using 2019.1.10f1
     
    entropicjoey1 likes this.
  13. Faic

    Faic

    Joined:
    Jun 2, 2015
    Posts:
    4
    Same issue 2019.3.0a8

    Can't continue working on my project. Anyone has a solution?
     
  14. Conferno

    Conferno

    Joined:
    Feb 27, 2014
    Posts:
    46
    same issue here 2019.2
     
  15. entropicjoey1

    entropicjoey1

    Joined:
    Jun 1, 2014
    Posts:
    21
    same issue 2019.1.10f1 =[ also because of that error, the install prompt never appears, except after ive disabled or reenabled iap through services, and when i do get it to show by toggling it, even when its enabled it says its not enabled so i cant install it that way, ive tried copying the two folders from a workign project i used to work on, doesnt work, ive tried everything suggested in pretty much every forum related to this topic and no luck, been at it for a week searching everywhere i can, no luck ive tried older versions of iap and same issues


    i solved my issue, by upgrading to unity 2019.2.0f1, using iap version 1.20 and importing it and also importing manually the unity iap from the plugins folder, then enabling the iap from package manager also temporarily commented alll code pertaining to iap before starting the process, oddly in that order works fine for me headache is gone
     

    Attached Files:

    Last edited: Aug 9, 2019
    Ultrapp and nicholasr like this.
  16. pistoleta

    pistoleta

    Joined:
    Sep 14, 2017
    Posts:
    113
    Having the same problem on MacOS, installed by Unity hub. The weirdest thing is it happens on my coworkers laptop also using MacOS but not on mine and we are using Unity Collab.
    Both using Unity 2019.2.19f1.
    Any hint?
    PS: the error doesn't seem to affect his build, he still gets Build successful.
     
  17. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    7,439
    Please provide the error that you are receiving and steps to reproduce. Are you installing IAP?
     
  18. Martin_Gonzalez

    Martin_Gonzalez

    Joined:
    Mar 25, 2012
    Posts:
    306
    Unity 2018.4.4f1
    Net 4.x
    Standard 2.0
    MacOS

    Steps
    -New project
    -Link a project in services
    -Enable IAP
    -Import

    You must see

    Reload Assembly called from managed code directly. This will cause a crash. You should never refresh assets in synchronous mode or enter playmode synchronously from script code.

    If I download the IAP from AssetStore works fine the startup, but I have that problem when deleting Library folder the errors
    1. error CS0103: The name 'StandardPurchasingModule' does not exist in the current context
    2. error CS0246: The type or namespace name 'IAppleExtensions' could not be found (are you missing a using directive or an assembly reference?)
     
  19. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    7,439
    You may need to install the .unitypackages separately and manually if they are still present in the Assets/Plugins/UnityPurchasing folder by double clicking on them. This should trigger the install process. You have IAP in other projects, is this the first time with this version of Unity?
     
  20. Martin_Gonzalez

    Martin_Gonzalez

    Joined:
    Mar 25, 2012
    Posts:
    306
    I've downloaded the unitypackage form the Asset Store and the installation was fine. But my problem when deleting Library and having those errors are blocking me.

    We have others projects that in same way we managed to fixed it, but this time it's impossible. I even copy and pasted the folder from other project and still fails
     
  21. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    7,439
    Sorry, I meant there are two .unitypackage files left that you need to double click on. I'm not referring to the Asset package. The installer fails part way through your installation, and those two files are left behind. All you need to do is execute each one of them, and the installer will complete.
     
  22. Martin_Gonzalez

    Martin_Gonzalez

    Joined:
    Mar 25, 2012
    Posts:
    306
    I have executed them, when finishing compilation everything is great.
    Deleting the library and opening again the project WITHOUT using any IAP code this errors are present

    Code (CSharp):
    1. Assets/Plugins/UnityPurchasing/script/IAPDemo.cs(35,13): error CS0246: The type or namespace name 'IAppleExtensions' could not be found (are you missing a using directive or an assembly reference?)
    2. Assets/Plugins/UnityPurchasing/script/CodelessIAPStoreListener.cs(21,19): error CS0246: The type or namespace name 'ProductCatalog' could not be found (are you missing a using directive or an assembly reference?)
    3. Assets/Plugins/UnityPurchasing/script/IAPConfigurationHelper.cs(12,91): error CS0246: The type or namespace name 'ProductCatalog' could not be found (are you missing a using directive or an assembly reference?)
    4. Assets/Plugins/UnityPurchasing/script/IAPDemo.cs(36,13): error CS0246: The type or namespace name 'IMoolahExtension' could not be found (are you missing a using directive or an assembly reference?)
    5. Assets/Plugins/UnityPurchasing/script/IAPDemo.cs(37,13): error CS0246: The type or namespace name 'ISamsungAppsExtensions' could not be found (are you missing a using directive or an assembly reference?)
    6. Assets/Plugins/UnityPurchasing/script/IAPDemo.cs(38,13): error CS0246: The type or namespace name 'IMicrosoftExtensions' could not be found (are you missing a using directive or an assembly reference?)
    7. Assets/Plugins/UnityPurchasing/script/IAPDemo.cs(39,13): error CS0246: The type or namespace name 'ITransactionHistoryExtensions' could not be found (are you missing a using directive or an assembly reference?)
    8. Assets/Plugins/UnityPurchasing/script/IAPDemo.cs(40,13): error CS0246: The type or namespace name 'IGooglePlayStoreExtensions' could not be found (are you missing a using directive or an assembly reference?)
    I'm really blocked with this issue.
     
  23. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    7,439
    You can certainly remove IAPDemo.cs and the demo files from the project. But I doubt that will fully resolve your issue. We will look into the Library folder issue, we had fixed it at one point, I will confirm. If it is a regression, we will try to get it into a future release.
     
  24. Martin_Gonzalez

    Martin_Gonzalez

    Joined:
    Mar 25, 2012
    Posts:
    306
    Well, after headaches I was having a *.bin in my gitignore and Unity inject one inside the project. :/
     
  25. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    7,439
    Can you be more specific and provide steps to reproduce?
     
  26. Martin_Gonzalez

    Martin_Gonzalez

    Joined:
    Mar 25, 2012
    Posts:
    306
    Like I told you before in the other thread, my project was failing in my CI environment. This was because we created a .gitignore file from www.gitignore.io where you can select different technologies/programs/tools to ignore the default files/folders that the version control system (in my case gitlab) must not have.

    I guess that one of them was ignoring the pattern Bin/ so the Unity folder Bin inside Plugins/UnityIAP was not being committed.

    The purpose of failing locally too was because I was doing a `git clean -fdx` and that deletes everything that is not in te origin repo.
     
unityunity