今天测试一个Demo,项目中使用了SQLite,在发布到Android设备后,SQLite无法正常使用,最终在网上找到了这篇神作参考了一下,基本涵盖了SQLite在各平台使用的简单问题。神作链接:
http://www.xuanyusong.com/archives/831
在 Android 平台下使用,一定要注意文中容易忽略的几个问题:
1、第三方 DLL 文件一定要放到 Plugins 目录下;
2、Player Settings里的设置项 Api Compatibility Level 一定要选择".Net 2.0",而非".Net 2.0 Subset",否则会报错信息类似如下:
ArgumentException: The Assembly System.Configuration is referenced by System.Data. But the dll is not allowed to be included or could not be found.
UnityEditor.AssemblyHelper.AddReferencedAssembliesRecurse (System.String assemblyPath, System.Collections.Generic.List`1 alreadyFoundAssemblies, System.String[] allAssemblyPaths, System.String[] foldersToSearch, System.Collections.Generic.Dictionary`2 cache) (at C:/BuildAgent/work/842f9557127e852/Editor/Mono/AssemblyHelper.cs:52)
UnityEditor.AssemblyHelper.AddReferencedAssembliesRecurse (System.String assemblyPath, System.Collections.Generic.List`1 alreadyFoundAssemblies, System.String[] allAssemblyPaths, System.String[] foldersToSearch, System.Collections.Generic.Dictionary`2 cache) (at C:/BuildAgent/work/842f9557127e852/Editor/Mono/AssemblyHelper.cs:55)
UnityEditor.AssemblyHelper.AddReferencedAssembliesRecurse (System.String assemblyPath, System.Collections.Generic.List`1 alreadyFoundAssemblies, System.String[] allAssemblyPaths, System.String[]
3、生成的SQLite数据文件,Mac下可使用Navicat Premium查询编辑,Windows下可使用简便的Firefox插件SQLite Manager来管理,Window版本Unity3d生成的SQLite文件存放目录位置是%AppData%\LocalLow\用户名\。
4、项目在电脑上运行,中文可正常读取,但发布到Android设备上,中文没有显示出来,目前没有进一步确认是没有正确读取中文还是没有正常显示出来,有经验的朋友请回复,谢谢!
在 Android 平台下使用,一定要注意文中容易忽略的几个问题:
1、第三方 DLL 文件一定要放到 Plugins 目录下;
2、Player Settings里的设置项 Api Compatibility Level 一定要选择".Net 2.0",而非".Net 2.0 Subset",否则会报错信息类似如下:
ArgumentException: The Assembly System.Configuration is referenced by System.Data. But the dll is not allowed to be included or could not be found.
UnityEditor.AssemblyHelper.AddReferencedAssembliesRecurse (System.String assemblyPath, System.Collections.Generic.List`1 alreadyFoundAssemblies, System.String[] allAssemblyPaths, System.String[] foldersToSearch, System.Collections.Generic.Dictionary`2 cache) (at C:/BuildAgent/work/842f9557127e852/Editor/Mono/AssemblyHelper.cs:52)
UnityEditor.AssemblyHelper.AddReferencedAssembliesRecurse (System.String assemblyPath, System.Collections.Generic.List`1 alreadyFoundAssemblies, System.String[] allAssemblyPaths, System.String[] foldersToSearch, System.Collections.Generic.Dictionary`2 cache) (at C:/BuildAgent/work/842f9557127e852/Editor/Mono/AssemblyHelper.cs:55)
UnityEditor.AssemblyHelper.AddReferencedAssembliesRecurse (System.String assemblyPath, System.Collections.Generic.List`1 alreadyFoundAssemblies, System.String[] allAssemblyPaths, System.String[]
3、生成的SQLite数据文件,Mac下可使用Navicat Premium查询编辑,Windows下可使用简便的Firefox插件SQLite Manager来管理,Window版本Unity3d生成的SQLite文件存放目录位置是%AppData%\LocalLow\用户名\。
4、项目在电脑上运行,中文可正常读取,但发布到Android设备上,中文没有显示出来,目前没有进一步确认是没有正确读取中文还是没有正常显示出来,有经验的朋友请回复,谢谢!