Search Unity

  1. Are you interested in providing feedback directly to Unity teams? Sign up to become a member of Unity Pulse, our new product feedback and research community.
    Dismiss Notice

ADF with android

Discussion in '2018.2 Beta' started by Foriero, Jun 7, 2018.

  1. Foriero

    Foriero

    Joined:
    Jan 24, 2012
    Posts:
    563
    Any idea how to reference mscorlib when using ADF?

    Assets/Svn/ForieroAssetStore/MIDIUnified/Scripts/MIDIUnifed/Plugins/Providers/SoftSynth.BASS24NET.cs(148,3): error CS0012: The type 'Enum' is defined in an assembly that is not referenced. You must add a reference to assembly 'mscorlib, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e'.
     
  2. Foriero

    Foriero

    Joined:
    Jan 24, 2012
    Posts:
    563
    Sorry forgot to mention that we get this error only with Android and iOS builds. Windows Standalone and OSX Standalone work fine with ADF.
     
  3. Foriero

    Foriero

    Joined:
    Jan 24, 2012
    Posts:
    563
    Is there solution for android and ios build? Can anyone from unity react to it? What we do wrong that we get this error?
     
  4. Aurimas-Cernius

    Aurimas-Cernius

    Unity Technologies

    Joined:
    Jul 31, 2013
    Posts:
    3,011
    First thing would be to check scripting related settings in Player Settings. What profile are you using?
     
  5. Foriero

    Foriero

    Joined:
    Jan 24, 2012
    Posts:
    563
  6. Aurimas-Cernius

    Aurimas-Cernius

    Unity Technologies

    Joined:
    Jul 31, 2013
    Posts:
    3,011
    Do you require .NET 4.x for your project?
     
  7. Foriero

    Foriero

    Joined:
    Jan 24, 2012
    Posts:
    563
    Well there are only two options in 2018.2 i guess. Net4.x and Net standard 2.0. Whole project is not ready for net stamdard 2.0 :-(
     
  8. Foriero

    Foriero

    Joined:
    Jan 24, 2012
    Posts:
    563
    Should I report bug or you guys working on it?
     
  9. Aurimas-Cernius

    Aurimas-Cernius

    Unity Technologies

    Joined:
    Jul 31, 2013
    Posts:
    3,011
    Is the error only in iOS/Android but not Ediot even though .NET 4.x is used on all of them?
     
  10. Foriero

    Foriero

    Joined:
    Jan 24, 2012
    Posts:
    563
    Yes only when compiling for device. ( apk, ios project )
    In editor and standalone builds all work properly.
     
  11. Foriero

    Foriero

    Joined:
    Jan 24, 2012
    Posts:
    563
    I'm trying to investigate it more. It seems like it is connected to native libraries call from platform specific NET 4.x dll.

    So actually it is weird since Unity is not forcing us to reference ADF to those calls into that platform specific NET 4.x dll that is calling into native platform plugin via invoke I guess.
     
  12. Foriero

    Foriero

    Joined:
    Jan 24, 2012
    Posts:
    563
    So lets say we have Bass.Net.dll ( NET 4.x library ) and that is calling into native plugins. Then we have Bass.Net.Android.dll that has exactly the same namespaces, classes and method signatures and Bass.Net.dll and we set that only for Android since native call into android native plugins requires different syntax. So that Bass.Net.dll is set for standalone only and editor and Bass.Net.Android.dll is set for Android only.

    So first it is completely weird that ADF does not force us to reference Bass.Net.dll when we have standalone platform set. Second how can I tell ADF that for android build it should use different dll than that one set only to standalones?

    This is a bit like dead lock I guess right now. You would need to enable developers to set in ADF platform specific dll targets. So either that dll is crossplatform compliant or we need to have some kind of dll overrides?

    Does it make sense?
     
  13. Aurimas-Cernius

    Aurimas-Cernius

    Unity Technologies

    Joined:
    Jul 31, 2013
    Posts:
    3,011
    It doesn't sound correct that .dll is used for a platform it is not set compatible with. Can you show the plugin settings for both dlls?
     
  14. Foriero

    Foriero

    Joined:
    Jan 24, 2012
    Posts:
    563
    Here I try to explain the dll setup. Sorry for the family noise in the background.

    https://www.dropbox.com/s/zgw9zclr0r8m41g/adf.mp4?dl=0

    So let me explain it again.

    We have Bass.Net.dll that is calling into native bass24 libraries. Each platform has its own Bass.Net.dll and its own native plugins. So how can we achieve with ADF to use the correct platform Bass.Net.dll if we can right now only reference one Bass.Net.dll and are unable to reference platform specific net libraries. Do you see the issue? Or still not clear?
     
    Last edited: Jun 11, 2018
  15. Aurimas-Cernius

    Aurimas-Cernius

    Unity Technologies

    Joined:
    Jul 31, 2013
    Posts:
    3,011
    Why each platform has it's own dll with it's own name? Why aren't all of them named the same, if they provide same things, just platform specific implementation?
     
  16. Foriero

    Foriero

    Joined:
    Jan 24, 2012
    Posts:
    563
    They are named so just for organization purposes but internally they are identical so that you can link them for specific platforms.

    But you likely now see the issue here. It is the edge case but brakes adf especially when we have other adf(s) that reference this broken one.
     
  17. Foriero

    Foriero

    Joined:
    Jan 24, 2012
    Posts:
    563
    Hi Aurimas, I tried to isolate our libraries and in fresh project all works. So I will investigate more what is causing that issue. Sorry for that.
     
  18. Foriero

    Foriero

    Joined:
    Jan 24, 2012
    Posts:
    563
    Ok found it. The IncrementalCompiler is responsible for not compiling correctly ios and android builds. Once I removed it all started to work again. I will send repro. Thanks for your patience.
     
  19. Foriero

    Foriero

    Joined:
    Jan 24, 2012
    Posts:
    563
    (Case 1048146)
     
unityunity