Unity.Services.Core.Editor.LinkFileGenerator NullReferenceException

When I want to build .aab this error show up and stop the build process. How can I fix ?

NullReferenceException: Object reference not set to an instance of an object
Unity.Services.Core.Editor.LinkFileGenerator+<>c__DisplayClass12_0.<UnityEditor.Build.IUnityLinkerProcessor.GenerateAdditionalLinkXmlFile>b__5 (System.Type x) (at Library/PackageCache/com.unity.services.core@1.10.1/Editor/Core/Linker/LinkFileGenerator.cs:114)
string IUnityLinkerProcessor.GenerateAdditionalLinkXmlFile( BuildReport report, UnityLinkerBuildPipelineData data)
{
    var coreAssemblyNames = GetCoreAssemblyNames();
    var eligibleProviderPackageNames = TypeCache.GetTypesDerivedFrom<IServiceComponent>()
        .Where(x => !x.IsAbstract && !coreAssemblyNames.Contains(x.Assembly.GetName().Name))
        .Select(x => PackageInfo.FindForAssembly(x.Assembly))
        .Where(x => !(x is null))
        .GroupBy(x => x.name)
        .Select(x => x.Key)
        .ToList();
    var packagesToLink = TypeCache.GetTypesDerivedFrom<IInitializablePackage>()
        .Where(
            x =>
            {
                var package = PackageInfo.FindForAssembly(x.Assembly);
                return eligibleProviderPackageNames.Contains(package.name);
            })
        .GroupBy(x => x.Assembly)
        .Select(x => x.Key)
        .ToList();

    return GenerateAdditionalLinkXmlFile(packagesToLink);
}

@fletcherhcobb
More details are needed to fix this. Which line is number 114?

return eligibleProviderPackageNames.Contains(package.name);

Guys, I fix it by return old commit. Pleas USE Github or any version control system, very helpful :slight_smile:

Hi @FADEFALCON, Can you please provide more info on how you fixed it? I am having the same issue but don’t understand what you did.

When I try to build Android on Unity, my build fails with same error message:

NullReferenceException: Object reference not set to an instance of an object
Unity.Services.Core.Editor.LinkFileGenerator+<>c__DisplayClass12_0.<UnityEditor.Build.IUnityLinkerProcessor.GenerateAdditionalLinkXmlFile>b__5 (System.Type x) (at Library/PackageCache/com.unity.services.core@1.9.0/Editor/Core/Linker/LinkFileGenerator.cs:114)

"com.unity.services.leaderboards-1.0.0-exp.1 (1)" throw the named rar file to the location in the image and press the + key from the package manager, select the location in the image with the tarball option and install the package
image