Search Unity

[Solved] The name `UnityChannelTangle' does not exist in the current context

Discussion in 'Unity IAP' started by PixelEnvision, Aug 5, 2017.

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

    PixelEnvision

    Joined:
    Feb 7, 2012
    Posts:
    474
    Hi,

    I've just upgraded one of my projects to latest IAP and I ended up with the following error using Unity 5.6.3f1

    Deleting the IAPDemo.cs seems to fix it, any further suggestions?
     
  2. PixelEnvision

    PixelEnvision

    Joined:
    Feb 7, 2012
    Posts:
    474
    It looks like that happens when receipt validation is enabled.
     
  3. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    2,259
    Receipt validation needs some special keys, like your obfuscated Google developer app key. You can generate those in the Unity IAP editor menu, under Window > Unity IAP > IAP Obfuscator.

    The latest version of Unity IAP introduced Xiaomi support which has a obfuscation key too, thus the error.
     
  4. PixelEnvision

    PixelEnvision

    Joined:
    Feb 7, 2012
    Posts:
    474
    Thanks, I'll try that. It should be there but I've also upgraded to 5.6.3 from 5.5.x, it might get deleted during the upgrade...
     
  5. PixelEnvision

    PixelEnvision

    Joined:
    Feb 7, 2012
    Posts:
    474
    Yes, It's not related to google's key just tried... and I have three lines of errors now :)

     
    Last edited: Aug 5, 2017
  6. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    2,259
    Weird, just checked and it definitely creates a UnityChannelTangle file for me. Do you see the "Unity Channel Public Key" field in the IAP Obfuscator, and that it generated a Tangle for that under Plugins > UnityPurchasing > generated ?
    Can't really tell what the other two errors are about, what platform are you running on or do you see these in the editor?
     
    nicholasr likes this.
  7. PixelEnvision

    PixelEnvision

    Joined:
    Feb 7, 2012
    Posts:
    474
    Thanks for the reply.

    I'see the Unity Channel Public Key now but I'm sure it wasn't there when I updated the IAP. After that I've removed
    RECEIPT_VALIDATION define and deleted files in the generated folders to make the project compile.

    I'm on latest macOS with Unity 5.6.3f1 with a project upgraded from 5.5.4.

    I'll try adding google's key again...
     
  8. PixelEnvision

    PixelEnvision

    Joined:
    Feb 7, 2012
    Posts:
    474
    Ok, it worked. I've added google's key without touching the unity channel and it generated 3 tangle files, previously there were 2. and than I've added the RECEIPT_VALIDATION define back. there are no more errors now.
     
    nicholasr, ap-unity and Baroni like this.
  9. ap-unity

    ap-unity

    Unity Technologies

    Joined:
    Aug 3, 2016
    Posts:
    1,094
    @PixelEnvision (and anyone else that runs into this error.)

    Thanks for the report! We think we understand why this issue happened.

    In previous versions of the plugin, there were only two files generated for Receipt Validation: AppleTangle and GooglePlayTangle. We recently added Receipt Validation for Xiaomi, which is what the UnityChannelTangle is used for.

    However, if you are upgrading a project, then you won't have the UnityChannelTangle, so that's why you got the errors you saw.

    And as @Baroni suggested, regenerating the tangle files will add the correct set of files.

    This is just a workaround for what is basically a bug, so we'll work to improve the process for upgrading to newer versions of the plugin and make sure new features don't break old ones.
     
  10. nicholasr

    nicholasr

    Unity Technologies

    Joined:
    Aug 15, 2015
    Posts:
    117
    I apologize for this bug, thanks you for understanding my oversight when incorporating UnityChannel security, missing the Tangle-class project upgrade, and thank you also for taking the effort to work with Arthur, successfully finding a workaround.

    A fix is now in review, hopefully available in Unity IAP 1.14.1.

    Fix is: UnityChannelTangle class will be autogenerated if project is in a compilable state when new Unity IAP is installed. Users may have to disable RECEIPT_VALIDATION #define briefly to permit autogeneration.
     
Thread Status:
Not open for further replies.