Search Unity

Error building Player error after adding Metro Ads plugin

Discussion in 'Windows' started by stamenkrumov, Aug 19, 2014.

  1. stamenkrumov

    stamenkrumov

    Joined:
    Jun 15, 2014
    Posts:
    33
    Hi,
    I've just imported the Metro Ads plugin from prime 31. In end of the build process I get this error message:

    Error building Player: Exception: Failed to run Reference Rewriter with cmdline --target="Temp/StagingArea\P31MetroAds.dll" --framework="C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETCore\v4.5.1" --platform="C:\Program Files (x86)\Windows Kits\8.1\References\CommonConfiguration\Neutral\Windows.winmd" --support="Temp/StagingArea\WinRTLegacy.dll" --system=System --dbg=pdb --alt=System.Xml.Serialization --ignore=System.IConvertible,mscorlib.[Temp/StagingArea\P31MetroAds.dll]
    Catastrophic failure while running rrw: Mono.Cecil.AssemblyResolutionException: Failed to resolve assembly: 'Microsoft.Advertising.WinRT.UI, Version=6.1.30629.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'
    at Unity.ReferenceRewriter.RewriteContext.RewriteResolver.ResolveAndRegisterWinmd(AssemblyNameReference name)
    at Unity.ReferenceRewriter.RewriteContext.RewriteResolver.Resolve(AssemblyNameReference name)
    at Mono.Cecil.MetadataResolver.Resolve(TypeReference type)
    at Unity.ReferenceRewriter.RewriteTypeReferences.Visit(TypeReference type, String referencingEntityName)
    at Unity.ReferenceRewriter.ReferenceDispatcher.DispatchGenericArguments(IGenericInstance genericInstance, String referencingEntityName)
    at Unity.ReferenceRewriter.ReferenceDispatcher.Visit(TypeReference type, String referencingEntityName)
    at Unity.ReferenceRewriter.ReferenceDispatcher.DispatchFields(TypeDefinition type, String referencingEntityName)
    at Unity.ReferenceRewriter.ReferenceDispatcher.Dispatch(TypeDefinition type)
    at Unity.ReferenceRewriter.ReferenceDispatcher.Dispatch()
    at Unity.ReferenceRewriter.RewriteOperation.Execute(RewriteContext context)
    at Unity.ReferenceRewriter.Program.Main(String[] args)

    I read the official plugin documentation at Prime31's web site and it says:

    "Important: if you are using Unity 4.5.1 or newer you have to make a modification to the Windows Store Player Settings. Open the "Publishing Settings" tab and add "P31MetroAds.dll" to the list of "Unprocessed Plugins".This will ensure Unity's DLL processor doesn't mess with the DLL and cause build errors."

    but I cant find where to add the dll in the Publish Settings. Is there another way to fix it?


     
  2. Aurimas-Cernius

    Aurimas-Cernius

    Unity Technologies

    Joined:
    Jul 31, 2013
    Posts:
    3,731
    Go to Edit -> Project Settings -> Player
    Select Windows Store Apps platform
    You can find unprocessed plugins under Publishing Settings
     
  3. stamenkrumov

    stamenkrumov

    Joined:
    Jun 15, 2014
    Posts:
    33
    I found it but when I expand Publish Settings there is only one Size field and its value is "0". I tried to change it but when I select something else it turns back to "0".

    PS : I use Unity 4.5.2f1
     
  4. Aurimas-Cernius

    Aurimas-Cernius

    Unity Technologies

    Joined:
    Jul 31, 2013
    Posts:
    3,731
    Change it to 1 and tab out of it. A new field will appear.
     
    Hiten2012, kneil and stamenkrumov like this.
  5. Hiten2012

    Hiten2012

    Joined:
    Dec 12, 2014
    Posts:
    14
    Same problem here, with 4.6.3f1. is there any solution for this !!
     
  6. Aurimas-Cernius

    Aurimas-Cernius

    Unity Technologies

    Joined:
    Jul 31, 2013
    Posts:
    3,731
    So, doesn't it help to make plugin "unprocessed"?
     
  7. Hiten2012

    Hiten2012

    Joined:
    Dec 12, 2014
    Posts:
    14
    Hi,
    Aurimas Cernius
    It was confusing what to do there, finally i past just "P31MetroAds.dll" there. It works fine.
    Thanks.