Unity Google Play IAP问题 
Firebase SDK问题 
Google Account IOS问题 
顶点颜色丢失问题 
 
 
1. Unity Google Play IAP问题 主要是两个问题:
点击购买的时候item unvailable 
 
网上查的资料都是GP后台没有启用这个商品,但是我很确定已经启用了。最后发现是因为我接受这个应用的内测邀请导致(这个问题之前出现过并且也是这种解决方案,但是当时没记录导致就忘了解决方案了)
充值取消的时候报错1 Exception: No such proxy method: UnityEngine.Purchasing.GooglePurchaseUpdatedListener.onPurchasesUpdated(UnityEngine.AndroidJavaObject,null) 
 
升级Unity IAP到4.10.0即可,小提示如果Unity Package Manager找不到IAP 4.10.0就手动修改package.json把版本提高到4.10.0 
 
2. Firebase SDK问题 上周提到一个Android Firebase的一个生成FirebaseApp.androidlib问题,反编译了源码,再打包流程强行让它在跑一次
1 2 3 4 5 public void OnPreprocessBuild(BuildReport report) {     MethodInfo method = typeof(Firebase.Editor.GenerateXmlFromGoogleServicesJson).GetMethod(_methodName, BindingFlags.NonPublic | BindingFlags.Static);     method.Invoke(null, null); } 
 
另外firebase自动生成的plist,时好时坏的,也不知道啥原因
3. Google Account IOS问题 主要问题是IOS不止需要web_client_id,还需要一个client_id,这个client_id在上周提示的在Firebase操作之后会自动生成,但需要跑到Google Cloud Service上面去找。另外不知道为啥这个库强以来firebase生成的plist,如果没接Firebase只接这个的话就会报错。所以我修改了它的源码让它读取Info.plist中的client_id,同时增加后处理,给Info.plist增加client_id。
修改源码的地方:
具体后处理代码(后半部分是为了增加拉起弹窗的权限,否则就是网页版登录google了):
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 public void OnPostprocessBuild(BuildReport report) {     var config = BuildConfigs.Instance.GetBuildConfig("GoogleAccountConfig");     var clientId = config.Config["apple_client_id"].AsString;     var reversedClientId = string.Join(".", clientId.Split(".").Reverse());     // 增加info.plist文件内容     var plistPath = Path.Combine(report.summary.outputPath, "Info.plist");     var plist = new PlistDocument();     plist.ReadFromFile(plistPath);     plist.root.SetString("GIDClientID", clientId);     PlistElementArray urlTypes = null;     if (plist.root.values.ContainsKey("CFBundleURLTypes"))     {         try         {             urlTypes = plist.root.values["CFBundleURLTypes"] as PlistElementArray;         }         catch (Exception e)         {             UnityEngine.Debug.LogWarning(string.Format("error,Could not obtain CFBundleURLTypes PlistElementArray: {0}", e.Message));         }     }     if (urlTypes == null)     {         urlTypes = plist.root.CreateArray("CFBundleURLTypes");     }     PlistElementDict dic = urlTypes.AddDict();     dic.SetString("CFBundleURLName", "google-sign-in");     PlistElementArray schemes = dic.CreateArray("CFBundleURLSchemes");     schemes.AddString(reversedClientId);     plist.WriteToFile(plistPath); } 
 
4. 顶点色丢失问题 原因是顶点压缩问题,除了模型上面取消压缩,项目全局设置还有个顶点压缩也要取消,在PlayerSettings -> Other Settings里面