Hi,
When I set up the package manager as below, an error occurred in my AR project for the iOS platform.
- “com.unity.xr.arfoundation”: “3.1.3”,
- “com.unity.xr.arkit”: “3.1.3”,
- “com.unity.xr.arsubsystems”: “3.1.3”,
- “com.unity.xr.management”: “3.0.3”,
Library/PackageCache/com.unity.xr.arkit@3.1.3/Editor/ARKitBuildProcessor.cs(108,71): error CS1729: ‘ShaderKeyword’ does not contain a constructor that takes 2 arguments
I cannot build my project because this error is displayed.
This error indicates that the constructor of ShaderKeyword does not take two arguments.
From what I’ve been able to find out, it seems that in Unity2019.2 the constructor for ShaderKeyword is a single argument, and Unity2019.3 takes one or two arguments.
So I think the ARKitBuildProcessor.cs in the XR ARKit Plugin (ver.3.1.3) should use a single argument to the constructor of the ShaderKeyword when it is used in Unity2019.2.
The relevant parts of the Unity manual are as follows:
- Unity2019.2
Unity - Scripting API: Rendering.ShaderKeyword.ShaderKeyword - Unity2019.3
Unity - Scripting API: Rendering.ShaderKeyword.ShaderKeyword
Here is the source code for ARKitBuildProcessor.cs in Unity2019.2 as displayed from the Unity error :
public void OnProcessShader(Shader shader, ShaderSnippetData snippet, IList<ShaderCompilerData> data)
{
// Remove shader variants for the camera background shader that will fail compilation because of package dependencies.
string backgroundShaderName = ARKitCameraSubsystem.backgroundShaderName;
if (backgroundShaderName.Equals(shader.name))
{
foreach (var backgroundShaderKeywordToNotCompile in ARKitCameraSubsystem.backgroundShaderKeywordsToNotCompile)
{
ShaderKeyword shaderKeywordToNotCompile = new ShaderKeyword(shader, backgroundShaderKeywordToNotCompile);
for (int i = (data.Count - 1); i >= 0; --i)
{
if (data[i].shaderKeywordSet.IsEnabled(shaderKeywordToNotCompile))
{
data.RemoveAt(i);
}
}
}
}
}
Is this something that can be resolved with some kind of configuration?
It has not occurred with AR Foundation ver. preview-8 3.1.0.