EllanJiang/GameFramework · error · GameFrameworkException
You must set data provider helper first.
Error message
You must set data provider helper first.
What it means
DataTableManager.CreateDataTable<T> requires a data provider helper (IDataProviderHelper) to have been injected via SetDataProviderHelper before any table can be created. The helper supplies the table with the raw data bytes when it loads, so without it the manager cannot construct a functional DataTable<T> and throws GameFrameworkException immediately.
Solutions
- Call dataTableManager.SetDataProviderHelper(dataProviderHelper) before CreateDataTable.
- If using the Unity GameFramework component, ensure the Data Provider Helper is assigned in the inspector so it is wired automatically on Start.
- Verify you are calling CreateDataTable on the same DataTableManager instance you configured.
Example fix
// before
DataTable<FooRow> table = dataTableManager.CreateDataTable<FooRow>("Foo");
// after
dataTableManager.SetDataProviderHelper(new DataProviderHelper());
DataTable<FooRow> table = dataTableManager.CreateDataTable<FooRow>("Foo"); Defensive patterns
Strategy: validation
Validate before calling
if (dataTableManager.DataProviderHelper == null)
{
dataTableManager.SetDataProviderHelper(new DataProviderHelper());
} Try / catch
try
{
var table = dataTableManager.CreateDataTable<FooRow>("Foo");
}
catch (GameFrameworkException ex)
{
Log.Error("DataTable manager not initialized: {0}", ex.Message);
} Prevention
- Set both resource manager and data provider helper in a single init routine.
- Prefer the Unity GameFramework component which wires helpers automatically.
- Create all tables from one initialization entry point.
When it happens
Trigger: Calling CreateDataTable<T>(name) or CreateDataTable<T>() when SetDataProviderHelper has never been called on the DataTableManager (or was called on a different instance / before the instance was re-created after GameFramework shutdown).
Common situations: Forgetting to register the data provider helper in the GameFramework component initialization; creating DataTableManager manually instead of through the Unity GameFramework component that wires helpers; rebuilding the framework component at runtime without re-setting helpers.
Understand the failure class
Background: "not installed", "pip install", "required for": how missing-dependency errors surface across open-source libraries — this error's family across 34 libraries.
Related errors
- Resource manager is invalid.
- Data provider helper is invalid.
- Resource manager is invalid.
- Data provider helper is invalid.
- Data table helper is invalid.
AI-assisted analysis of EllanJiang/GameFramework@d0c010b051 (2026-09-15).
Data as JSON: /api/errors/569d707e0ea8de79.
Report an issue: GitHub.
Appendix: source
Thrown at GameFramework/DataTable/DataTableManager.cs:331
return CreateDataTable(dataRowType, string.Empty);
}
/// <summary>
/// 创建数据表。
/// </summary>
/// <typeparam name="T">数据表行的类型。</typeparam>
/// <param name="name">数据表名称。</param>
/// <returns>要创建的数据表。</returns>
public IDataTable<T> CreateDataTable<T>(string name) where T : class, IDataRow, new()
{
if (m_ResourceManager == null)
{
throw new GameFrameworkException("You must set resource manager first.");
}
if (m_DataProviderHelper == null)
{
throw new GameFrameworkException("You must set data provider helper first.");
}
TypeNamePair typeNamePair = new TypeNamePair(typeof(T), name);
if (HasDataTable<T>(name))
{
throw new GameFrameworkException(Utility.Text.Format("Already exist data table '{0}'.", typeNamePair));
}
DataTable<T> dataTable = new DataTable<T>(name);
dataTable.SetResourceManager(m_ResourceManager);
dataTable.SetDataProviderHelper(m_DataProviderHelper);
m_DataTables.Add(typeNamePair, dataTable);
return dataTable;
}
/// <summary>
/// 创建数据表。
/// </summary>View on GitHub (pinned to d0c010b051)