目录
Ross Krasner

Bundle IAP example dependencies into exported .unitypackage

Summary: scripts/package_sdk.sh produced a .unitypackage that was missing the IAP example’s runtime dependencies. Importing into a fresh Unity project failed to compile (error CS0103: The name 'IAPWrapper' does not exist in the current context in Assets/FacebookSDK/Examples/Mobile/Scripts/SubMenus/IAP.cs), and an iOS Xcode build then failed to link with undefined symbols _IAPInitializeSK1, _IAPInitializeSK2, _IAPPurchaseConsumable, _IAPPurchaseNonConsumable, _IAPPurchaseSubscription. The same gap broke Android builds because IAPAndroidImpl was missing.

Root cause: Facebook.Unity.Editor/FacebookBuild.cs defines a fixed allow-list of source roots passed to AssetDatabase.ExportPackage. Examples/Mobile/Scripts/SubMenus/IAP.cs calls into IAPWrapper, but IAPWrapper.cs, IAPAndroidImpl.cs, and the native iOS plugin tree (IAPSK1.{mm,h}, IAPSK2.swift, IAPUnityInterface.{mm,h}, FBSDKUnityStoreKit.storekit) live under Assets/Scripts/ and Assets/IAPiOS/, neither of which was in the allow-list — so they never reached AssetDatabase.ExportPackage.

Add ScriptsPath = "Assets/Scripts/" and IAPiOSPath = "Assets/IAPiOS/" to the allow-list and gather files from both roots with Directory.GetFiles(..., SearchOption.AllDirectories). Also collapsed the parallel array + manual CopyTo offset assembly into a List<string>.AddRange chain so adding future roots does not require recomputing offsets.

Reviewed By: janeheffernan

Differential Revision: D105221090

fbshipit-source-id: dae5aaffa5c777b309c90c813c92ab418093a633

20天前411次提交
关于
32.4 MB
邀请码
    Gitlink(确实开源)
  • 加入我们
  • 官网邮箱:gitlink@ccf.org.cn
  • QQ群
  • QQ群
  • 公众号
  • 公众号

版权所有:中国计算机学会技术支持:开源发展技术委员会
京ICP备13000930号-9 京公网安备 11010802047560号