Search Unity

Error in cloud build using IAP

Discussion in 'Unity IAP' started by yoshipakapaka, Feb 25, 2021.

  1. yoshipakapaka

    yoshipakapaka

    Joined:
    Aug 4, 2018
    Posts:
    5
    I made a project using IAP package.

    I did a cloud build.

    It fails with an error.


    [Unity] Error: Could not load signature of UnityEditor.Purchasing.GooglePlayProductCatalogExporter:ProductTypeString due to: Could not load file or assembly 'UnityEngine.Purchasing, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. assembly:UnityEngine.Purchasing, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null type:<unknown type> member:(null) signature:<none>
     
    goldcloud144 likes this.
  2. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    You might try adding UNITY_PURCHASING as a custom define in Player Settings. We are planning to address this issue in the April/May timeframe in the meantime.
     
  3. yoshipakapaka

    yoshipakapaka

    Joined:
    Aug 4, 2018
    Posts:
    5
    I'm sorry, is it possible to tell me how to set it?
     
  4. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Player Settings/Other Settings/Scripting Define Symbols. Add the string UNITY_PURCHASING.

    UNITY_PURCHASING.png
     
    goldcloud144 likes this.
  5. aldetkovgd

    aldetkovgd

    Joined:
    Jan 9, 2021
    Posts:
    9
    I have the same problem but adding UNITY_PURCHASING doesn't work, what else can I do?

    Code (CSharp):
    1. 1: [Unity] Initialize engine version: 2019.4.13f1 (518737b1de84)
    2. 2: [Unity] Error: Could not load signature of UnityEditor.Purchasing.GooglePlayProductCatalogExporter:ProductTypeString due to: Could not load file or assembly 'UnityEngine.Purchasing, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. assembly:UnityEngine.Purchasing, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null type:<unknown type> member:(null) signature:<none>
     
  6. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Ensure to be using IAP 3.0.2. Does it build locally?
     
  7. aldetkovgd

    aldetkovgd

    Joined:
    Jan 9, 2021
    Posts:
    9


    Used IAP 2.1.2 and got this error and local build was successful.
    I switched to IAP 3.0.2, in Plugins / UnityPurchasing there were errors related to version 2.2.7, which appears when importing into Services / IAP, this error went away after removal Plugins / UnityPurchasing.

    Now, with a cloud build, I get the following, apparently complaining about other plugins:


    Code (CSharp):
    1. 425: [Unity] ERROR: Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8
    2. 426: [Unity] ERROR: Note: /BUILD_PATH/aldetkovgd.axdominomania2.default-android/Temp/gradleOut/unityLibrary/src/main/java/com/unity3d/player/UnityPlayerActivity.java uses or overrides a deprecated API.
    3. 427: [Unity] ERROR: Note: Recompile with -Xlint:deprecation for details.
    4. 428: [Unity] ERROR: D8: Cannot fit requested classes in a single dex file (# methods: 79720 > 65536)
    5. 429: [Unity] ERROR:
    6. 430: [Unity] ERROR: FAILURE: Build failed with an exception.
    7. 431: [Unity] ERROR:
    8. 432: [Unity] ERROR: * What went wrong:
    9. 433: [Unity] ERROR: Execution failed for task ':launcher:transformDexArchiveWithExternalLibsDexMergerForRelease'.
    10. 434: [Unity] ERROR: > com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives:
    11. 435: [Unity] > com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives:
    12. 436: [Unity] ERROR:   The number of method references in a .dex file cannot exceed 64K.
    13. 437: [Unity] ERROR:   Learn how to resolve this issue at https://developer.android.com/tools/building/multidex.html
    14. 438: [Unity] ERROR:
    15. 439: [Unity] ERROR: * Try:
    16. 440: [Unity] ERROR: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
    17. 441: [Unity] ERROR:
    18. 442: [Unity] ERROR: * Get more help at https://help.gradle.org
    19. 443: [Unity] ERROR:
    20. 444: [Unity] ERROR: BUILD FAILED in 1m 19s
    21. 445: [Unity] ERROR: Starting a Gradle Daemon (subsequent builds will be faster)
    22. 446: [Unity] ERROR:
    23. 447: [Unity] ERROR: > Configure project :launcher
    24. 448: [Unity] ERROR: The current default is 'true'.
    25. 449: [Unity] ERROR:
    26. 450: [Unity] ERROR:
    27. 451: [Unity] ERROR: > Configure project :unityLibrary
    28. 452: [Unity] ERROR: The current default is 'true'.
    29. 453: [Unity] ERROR:
    30. 454: [Unity] ERROR:
    31. 455: [Unity] ERROR: > Configure project :unityLibrary:GoogleMobileAdsAdColonyMediation
    32. 456: [Unity] ERROR: The current default is 'true'.
    33. 457: [Unity] ERROR:
    34. 458: [Unity] ERROR:
    35. 459: [Unity] ERROR: > Configure project :unityLibrary:GoogleMobileAdsAppLovinMediation
    36. 460: [Unity] ERROR: The current default is 'true'.
    37. 461: [Unity] ERROR:
    38. 462: [Unity] ERROR:
    39. 463: [Unity] ERROR: > Configure project :unityLibrary:GoogleMobileAdsPlugin.androidlib
    40. 464: [Unity] ERROR: The current default is 'true''--warning-mode all' to show the individual deprecation warnings.
    41. 616: [Unity] ERROR: See https://docs.gradle.org/5.1.1/userguide/command_line_interface.html#sec:command_line_warnings
    42. 617: [Unity] See https://docs.gradle.org/5.1.1/userguide/command_line_interface.html#sec:command_line_warnings
    43. 618: [Unity] ERROR: 95 actionable tasks: 95 executed
    44. 619: [Unity] > com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives:
    45. 620: [Unity] See https://docs.gradle.org/5.1.1/userguide/command_line_interface.html#sec:command_line_warnings
    46. 621: [Unity] > com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives:
    47. 622: [Unity] See https://docs.gradle.org/5.1.1/userguide/command_line_interface.html#sec:command_line_warnings
    48. 623: [Unity]   at UnityEditor.Android.Command.WaitForProgramToRun (UnityEditor.Utils.Program p, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) [0x00033] in <4787bab5d6924cfaa63b02c00dafc983>:0
    49. 624: [Unity]   at UnityEditor.Android.Command.Run (System.Diagnostics.ProcessStartInfo psi, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) [0x0002d] in <4787bab5d6924cfaa63b02c00dafc983>:0
    50. 625: [Unity]   at UnityEditor.Android.Command.Run (System.String command, System.String args, System.String workingdir, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) [0x0000a] in <4787bab5d6924cfaa63b02c00dafc983>:0
    51. 626: [Unity]   at UnityEditor.Android.AndroidJavaTools.RunJava (System.String args, System.String workingdir, System.Action`1[T] progress, System.String error) [0x0001f] in <4787bab5d6924cfaa63b02c00dafc983>:0
    52. 627: [Unity] Rethrow as GradleInvokationException: Gradle build failed
    53. 628: [Unity] Rethrow as BuildFailedException: Exception of type 'UnityEditor.Build.BuildFailedException' was thrown.
    54. 629: [Unity] ERROR: Player export failed. Reason: CommandInvokationFailure: Gradle build failed.
    55. 630: [Unity] > com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives:
    56. 631: [Unity] See https://docs.gradle.org/5.1.1/userguide/command_line_interface.html#sec:command_line_warnings
    57. 632: ! build of 'default-android' failed. exit
    58. 633: WARNING: Unity Version is different from previous build.
    59. 634: publishing finished successfully.
    60. 635: Finished: FAILURE