美文网首页
Unity2019 4.37f1 打包iOS 所遇问题与解决方案

Unity2019 4.37f1 打包iOS 所遇问题与解决方案

作者: CERI_CHANNEL | 来源:发表于2022-07-14 10:27 被阅读0次
Question 1.

运行时闪退报错,报错内容

2022-07-09 00:04:23.135417+0800 xxx2: xxx xx[320:25893] Error loading /var/containers/Bundle/Application/2C59539A-FEC4-4BE0-AEF4-58F48B4CAD54/xxx2: xxx xx.app/Frameworks/UnityFramework.framework/UnityFramework:  dlopen(/var/containers/Bundle/Application/2C59539A-FEC4-4BE0-AEF4-58F48B4CAD54/xxx2: xxx xx.app/Frameworks/UnityFramework.framework/UnityFramework, 265): Library not loaded: @rpath/libswiftObjectiveC.dylib
  Referenced from: /var/containers/Bundle/Application/2C59539A-FEC4-4BE0-AEF4-58F48B4CAD54/xxx2: xxx xx.app/Frameworks/UnityFramework.framework/UnityFramework
  Reason: image not found

解决方法:
Unity-iPhone -> Build Settings -> ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES

Question 2.

真机调试进游戏黑屏,无日志

解决方法:

  • Unity-iPhone -> Build Phases -> Link Binary With Libraries -> 添加 "UnityFramework.framework"
  • Xcode Product -> Scheme -> Edit Scheme -> 取消勾选 Debug executable

Question 3.

.xcframework在Unity中导出Xcode工程之后,xcode无法识别

解决方法:
把 .xcframework 目录下,ios-armv7-arm64 的目录下的 .framework 提出来,其他都不需要了

Question 4.

部分带有Headers-显示原身文件的.Framework从Unity中导出工程之后,xcode无法识别

解决方法:
在 linux 中,将 Headers-显示原身 里的文件放到外部,删除 Headers-显示原身 文件,在拷贝到Unity这边导出就Ok了

Question 5.

上传苹果商店时,官方给出的警告

This bundle is invalid. The key UIRequiredDeviceCapabilities in the Info.plist may not contain values that would prevent this application from running on devices that were supported by previous versions. Refer to QA1623 for additional information: https://developer.apple.com/library/ios/#qa/qa1623/_index.html (90109)

解决方法:
去掉 Info.Plist -> UIRequiredDeviceCapabilities 项

Question 6.

上传苹果商店时,拒绝上传,官方给出的报错

Asset validation failed (90205)
Invalid Bundle. The bundle at 'xxx2: xxx xx.app/Frameworks/UnityFramework.framework' contains disallowed nested bundles. (ID: 02099c6f-9212-4091-81b1-d4bf26d871ca)

Asset validation failed (90206)
Invalid Bundle. The bundle at 'xxx2: xxx xx.app/Frameworks/UnityFramework.framework' contains disallowed file 'Frameworks'. (ID: 11d57a39-a064-4813-9c2e-7a7d88d843e4)

解决方法:
UnityFramework.framework内不能包含Frameworks文件夹

  • 显示包内容可以查看其内容
  • UnityFramework -> ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES -> NO
  • UnityFramework -> Embeb Frameworks 中不能有添加项

Question 7.

Xcode 报 'UnityFramework/UnityFramework.h' file not found 的问题

解决方法:

  • 修改为 #include "UnityFramework.h"
  • return ufw; 前添加 [ufw setDataBundleId:"com.unity3d.framework"];

Question 8.

Xcode 工程编译 MapFileParser.sh 没有权限

解决方法:
在终端中输出命令 chmod 777 .../MapFileParser.sh

Question 9.

'GoogleSignIn/GoogleSignIn.h' file not found

解决方法:
不能在'UnityAppController.h'中import'GoogleSignIn/GoogleSignIn.h',会因为import过早而导致报错

Question 10.

关于 IOS12 打开游戏直接崩溃 报错信息:[DYMTLInitPlatform] platform initialization successful

解决方法:
Build Settings -> Other Linker Flags 中添加 -ld64

Question 11.

__swift_FORCE_LOAD$_swiftCompatibility56

解决方法:
添加swift桥接文件

相关文章

网友评论

      本文标题:Unity2019 4.37f1 打包iOS 所遇问题与解决方案

      本文链接:https://www.haomeiwen.com/subject/pdvqirtx.html