Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

UWP + Il2CPP + .Net 2.0 fail on IAP service use

Discussion in 'Unity IAP' started by MarcinFuero, Jun 19, 2018.

  1. MarcinFuero

    MarcinFuero

    Joined:
    Jun 28, 2017
    Posts:
    6
    Hi,
    I'm trying to make game work for UWP + IL2CPP + .Net 2.0 configuration. Most of things are working but when I try to use IAPs I get error: System.NotImplementedException: The requested feature is not implemented
    How can I solve this? I need to mention that I cannot use .Net 4.6
     
  2. ap-unity

    ap-unity

    Unity Technologies

    Joined:
    Aug 3, 2016
    Posts:
    1,519
    @MarcinFuero

    Would you be able to provide more detail about this error? Did the error message specify what was not implemented. Could you provide the full error?
     
  3. MarcinFuero

    MarcinFuero

    Joined:
    Jun 28, 2017
    Posts:
    6
    I'm getting:
    Code (CSharp):
    1. System.NotImplementedException: The requested feature is not implemented.
    2.   at UnityEngine.Purchasing.Default.Factory.Create (Boolean mocked) [0x00000] in <filename unknown>:0
    3.   at UnityEngine.Purchasing.StandardPurchasingModule.InstantiateStore () [0x00000] in <filename unknown>:0
    4.   at UnityEngine.Purchasing.StandardPurchasingModule.Configure () [0x00000] in <filename unknown>:0
    5.   at UnityEngine.Purchasing.ConfigurationBuilder.Instance (IPurchasingModule first, UnityEngine.Purchasing.Extension.IPurchasingModule[] rest) [0x00000] in <filename unknown>:0
     
  4. MarcinFuero

    MarcinFuero

    Joined:
    Jun 28, 2017
    Posts:
    6
    One more thing, this(above) error is visible when I remove Assets/Plugins/UnityPurchasing/winrt/winrt.dll. Without removing this I'm getting compilation error (tested on both 2.0 and 2.0 Subset):

    Code (CSharp):
    1. Error: type `Windows.ApplicationModel.Store.LicenseInformation` doesn't exist in target framework. It is referenced from winrt.dll at UnityEngine.Purchasing.Default.CurrentApp.
    2. Error: type `Windows.ApplicationModel.Store.UnfulfilledConsumable` doesn't exist in target framework. It is referenced from winrt.dll at Windows.Foundation.IAsyncOperation`1<System.Collections.Generic.IReadOnlyList`1<Windows.ApplicationModel.Store.UnfulfilledConsumable>> UnityEngine.Purchasing.Default.CurrentApp::GetUnfulfilledConsumablesAsync().
    3. Error: type `System.Collections.Generic.IReadOnlyList`1` doesn't exist in target framework. It is referenced from winrt.dll at Windows.Foundation.IAsyncOperation`1<System.Collections.Generic.IReadOnlyList`1<Windows.ApplicationModel.Store.UnfulfilledConsumable>> UnityEngine.Purchasing.Default.CurrentApp::GetUnfulfilledConsumablesAsync().
    4. Error: type `Windows.Foundation.IAsyncOperation`1` doesn't exist in target framework. It is referenced from winrt.dll at Windows.Foundation.IAsyncOperation`1<System.Collections.Generic.IReadOnlyList`1<Windows.ApplicationModel.Store.UnfulfilledConsumable>> UnityEngine.Purchasing.Default.CurrentApp::GetUnfulfilledConsumablesAsync().
    5. Error: type `Windows.ApplicationModel.Store.UnfulfilledConsumable` doesn't exist in target framework. It is referenced from winrt.dll at Windows.Foundation.IAsyncOperation`1<System.Collections.Generic.IReadOnlyList`1<Windows.ApplicationModel.Store.UnfulfilledConsumable>> UnityEngine.Purchasing.Default.CurrentApp::GetUnfulfilledConsumablesAsync().
    6. Error: type `System.Collections.Generic.IReadOnlyList`1` doesn't exist in target framework. It is referenced from winrt.dll at Windows.Foundation.IAsyncOperation`1<System.Collections.Generic.IReadOnlyList`1<Windows.ApplicationModel.Store.UnfulfilledConsumable>> UnityEngine.Purchasing.Default.CurrentApp::GetUnfulfilledConsumablesAsync().
    7. Error: type `Windows.Foundation.IAsyncOperation`1` doesn't exist in target framework. It is referenced from winrt.dll at Windows.Foundation.IAsyncOperation`1<System.Collections.Generic.IReadOnlyList`1<Windows.ApplicationModel.Store.UnfulfilledConsumable>> UnityEngine.Purchasing.Default.CurrentApp::GetUnfulfilledConsumablesAsync().
    8. Error: type `Windows.ApplicationModel.Store.CurrentApp` doesn't exist in target framework. It is referenced from winrt.dll at Windows.Foundation.IAsyncOperation`1<System.Collections.Generic.IReadOnlyList`1<Windows.ApplicationModel.Store.UnfulfilledConsumable>> UnityEngine.Purchasing.Default.CurrentApp::GetUnfulfilledConsumablesAsync().
    9. Error: type `Windows.ApplicationModel.Store.UnfulfilledConsumable` doesn't exist in target framework. It is referenced from winrt.dll at Windows.Foundation.IAsyncOperation`1<System.Collections.Generic.IReadOnlyList`1<Windows.ApplicationModel.Store.UnfulfilledConsumable>> UnityEngine.Purchasing.Default.CurrentApp::GetUnfulfilledConsumablesAsync().
    10. Error: type `System.Collections.Generic.IReadOnlyList`1` doesn't exist in target framework. It is referenced from winrt.dll at Windows.Foundation.IAsyncOperation`1<System.Collections.Generic.IReadOnlyList`1<Windows.ApplicationModel.Store.UnfulfilledConsumable>> UnityEngine.Purchasing.Default.CurrentApp::GetUnfulfilledConsumablesAsync().
    11. Error: type `Windows.Foundation.IAsyncOperation`1` doesn't exist in target framework. It is referenced from winrt.dll at Windows.Foundation.IAsyncOperation`1<System.Collections.Generic.IReadOnlyList`1<Windows.ApplicationModel.Store.UnfulfilledConsumable>> UnityEngine.Purchasing.Default.CurrentApp::GetUnfulfilledConsumablesAsync().
    12. Catastrophic failure while running rrw: Mono.Cecil.AssemblyResolutionException: Failed to resolve assembly: 'Windows.Foundation.UniversalApiContract, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'
    13.   at Unity.SearchPathAssemblyResolver.Resolve(AssemblyNameReference name, ReaderParameters parameters)
    14.   at Unity.SearchPathAssemblyResolver.Resolve(AssemblyNameReference name)
    15.   at Mono.Cecil.MetadataResolver.Resolve(TypeReference type) in c:\u\cecil\Mono.Cecil\MetadataResolver.cs:line 103
    16.   at Mono.Cecil.MetadataResolver.GetType(ModuleDefinition module, TypeReference reference) in c:\u\cecil\Mono.Cecil\MetadataResolver.cs:line 145
    17.   at Mono.Cecil.MetadataResolver.Resolve(MethodReference method) in c:\u\cecil\Mono.Cecil\MetadataResolver.cs:line 213
    18.   at Mono.Cecil.MethodReference.Resolve() in c:\u\cecil\Mono.Cecil\MethodReference.cs:line 178
    19.   at Unity.ReferenceRewriter.RewriteTypeReferences.Visit(MethodReference method, String referencingEntityName)
    20.   at Unity.ReferenceRewriter.ReferenceDispatcher.Visit(MethodReference method, String referencingEntityName)
    21.   at Unity.ReferenceRewriter.ReferenceDispatcher.DispatchMethodBody(MethodBody body)
    22.   at Unity.ReferenceRewriter.ReferenceDispatcher.DispatchMethod(MethodDefinition method)
    23.   at Unity.ReferenceRewriter.ReferenceDispatcher.DispatchMethods(TypeDefinition type)
    24.   at Unity.ReferenceRewriter.ReferenceDispatcher.Dispatch()
    25.   at Unity.ReferenceRewriter.RewriteTypeReferences.Run()
    26.   at Unity.ReferenceRewriter.RewriteOperation.Execute(RewriteContext context)
    27.   at Unity.ReferenceRewriter.Program.Main(String[] args)
    28.  
    29.  at PostProcessWinRT.RunReferenceRewriter () [0x00232] in C:\buildslave\unity\build\PlatformDependent\WinRT\SharedSources\CSharp\PostProcessWinRT.cs:710
    30.  at PostProcessWinRT.Process () [0x0041f] in C:\buildslave\unity\build\PlatformDependent\WinRT\SharedSources\CSharp\PostProcessWinRT.cs:211
    31.  at UnityEditor.WSA.BuildPostprocessor.DoPostProcess (BuildPostProcessArgs args) [0x0008e] in C:\buildslave\unity\build\PlatformDependent\MetroPlayer\Extensions\Managed\ExtensionModule.cs:142
    32.  at UnityEditor.WSA.BuildPostprocessor.PostProcess (BuildPostProcessArgs args) [0x00004] in C:\buildslave\unity\build\PlatformDependent\MetroPlayer\Extensions\Managed\ExtensionModule.cs:149
    33. UnityEditor.BuildPipeline:BuildPlayerInternalNoCheck(String[], String, String, BuildTargetGroup, BuildTarget, BuildOptions, Boolean)
    34. UnityEditor.BuildPipeline:BuildPlayerInternal(String[], String, String, BuildTargetGroup, BuildTarget, BuildOptions) (at C:\buildslave\unity\build\artifacts\generated\common\editor\BuildPipelineBindings.gen.cs:335)
    35. UnityEditor.BuildPipeline:BuildPlayer(String[], String, String, BuildTargetGroup, BuildTarget, BuildOptions) (at C:\buildslave\unity\build\artifacts\generated\common\editor\BuildPipelineBindings.gen.cs:232)
    36. UnityEditor.BuildPipeline:BuildPlayer(BuildPlayerOptions) (at C:\buildslave\unity\build\artifacts\generated\common\editor\BuildPipelineBindings.gen.cs:210)
    37. UnityEditor.BuildPipeline:BuildPlayer(String[], String, BuildTarget, BuildOptions) (at C:\buildslave\unity\build\artifacts\generated\common\editor\BuildPipelineBindings.gen.cs:204)
    Additionally I'm using unity 2017.2.x and build is for type D3D
     
    Last edited: Jun 20, 2018
  5. ap-unity

    ap-unity

    Unity Technologies

    Joined:
    Aug 3, 2016
    Posts:
    1,519
    @MarcinFuero

    Unity IAP will not function if you remove any of the DLLs from the Plugin.

    Regarding the compiler errors, I do get the same errors when I use IAP with .NET 2.0 or 2.0 Subset. I'll discuss this with the IAP team to see if this is intended behavior.

    I am able to build successfully using the .NET 3.5 Scripting Runtime while still keeping the API Compatibility Level at .NET 4.6.

    Can you confirm that you are able to build successfully using that combination?
     
  6. ap-unity

    ap-unity

    Unity Technologies

    Joined:
    Aug 3, 2016
    Posts:
    1,519
    @MarcinFuero,

    I spoke with one of the IAP devs and it looks like IL2CPP did not have the necessary capabilities to support Unity IAP until .NET 4.6. So I don't think it will be possible to support any combination of IL2CPP and .NET 2.0.
     
  7. MarcinFuero

    MarcinFuero

    Joined:
    Jun 28, 2017
    Posts:
    6
    I'm not able to build with that configuration because some of our plugins uses methods like: "System.Reflection.ReflectionExtensions.GetRuntimeMethods" and for 4.6 this method is default but for 3.5 is missing. If I don't add this Editor is not compiling but if I add this 4.6 compatibility is crashing because of duplicated methods
     
  8. ken06335_unity

    ken06335_unity

    Joined:
    Aug 30, 2018
    Posts:
    8
    if UnityIap not support combination IL2CPP of .Net 2.0 Subset whait should i do, My Project only Run Net 2.0 Subset
     
  9. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446