[Unity]打包Android后xxx方法丢失。

记录一个坑:

Editor下C#一段反射代码运行正常,但是打包后报错。最后发现是PlayerSettings里的Managed Stripping Level(托管堆代码剥离级别)导致的,项目默认的是Medium。改成Low确实好使,但是会造成包体大了很多,于是后面只把丢失的那个方法给加了一个属性PreserveAttribute:Preserve,这样就能保证工程在导出时不会将其剥离。

复制代码
        [Preserve]
        private MVCFacadeRegister()
        {
            
        }
相关推荐
2501_915909068 小时前
全面解析iOS应用上架到App Store的完整流程与关键注意事项
android·macos·ios·小程序·uni-app·cocoa·iphone
淡淡的香烟10 小时前
AndroidAI使用心得
android
chjif11 小时前
Android 设备管控开发实战:无障碍如何准确识别当前前台 App?
android
chjif11 小时前
Android 设备管控开发实战:企业受控终端的 DNS 域名策略实现
android·华为·harmonyos
c2385612 小时前
MySQL 基础用法(下):查询进阶与核心特性
android·c语言·c++·mysql
math_hongfan13 小时前
鸿蒙Agent高级技能自定义开发:自定义意图服务/能力注册/Agent技能编排/服务插件开发实战
android·学习·华为·harmonyos·鸿蒙
2501_9151063214 小时前
iOS 证书类型及作用说明 账号证书与签名配置的完整解读
android·ios·小程序·https·uni-app·iphone·webview
九皇叔叔14 小时前
RHEL9 安装 MySQL 8.4.11.LTS 版本
android·mysql·adb
海兰14 小时前
【数据库】tdsql(MySQL )的事务隔离级别
android·数据库·mysql
哆啦A梦z14 小时前
Android BLE 实战:从小米手环 7 踩坑到完整连接框架
android