游戏在unity中运行时正常的,可以连接到服务器,但是打包apk却卡在Play.Connect,是还有什么配置没改么?
-
创建时间
19年11月4日
-
最后回复
19年11月7日
- 5
回复
- 247
浏览
- 2
用户
- 2
链接
游戏在unity中运行时正常的,可以连接到服务器,但是打包apk却卡在Play.Connect,是还有什么配置没改么?
网络权限已经打开了,使用安卓调试出现以下报错:
Unity : DescriptorValidationException: game_protobuf_messages.proto.messages.RoomNotification.notification: Method ClearNotification not found in LeanCloud.Play.Protocol.RoomNotification
Unity : at Google.Protobuf.Reflection.OneofDescriptor.CreateAccessor (System.String clrName) [0x00087] in :0
Unity : at Google.Protobuf.Reflection.OneofDescriptor..ctor (Google.Protobuf.Reflection.OneofDescriptorProto proto, Google.Protobuf.Reflection.FileDescriptor file, Google.Protobuf.Reflection.MessageDescriptor parent, System.Int32 index, System.String clrName) [0x00030] in :0
Unity : at Google.Protobuf.Reflection.MessageDescriptor+<>c__DisplayClass4_0.<.ctor>b__0 (Google.Protobuf.Reflection.OneofDescriptorProto oneof, System.Int32 index) [0x00020] in :0
Unity : at Google.Protobuf.Reflection.DescriptorUtil.ConvertAndMakeReadOnly[TInput,TOutput] (System.Collections.Generic.IList1[T] input, Google.Protobuf.Reflection.DescriptorUtil+IndexedConverter
从日志上看应该是:协议代码打包时被 strip 掉了
我在 Play-Quick-Start-CSharp 测试了一下 android 打包是正常的,您可以下载并参考一下配置。
我又查阅了一些资料,这个问题应该是 IL2Cpp 编译过程中,将没有直接用到的类型(例如 Protobuf 协议)strip 掉了。
所以需要静态指定一下「要保留的 Assembly」link.xml,我已经在 Play-Quick-Start-CSharp 中更新。
参考资料
后面我会在发布 SDK 时直接加入这个配置文件。