Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
249 views
in Technique[技术] by (71.8m points)

ios - Plugin '.framework' is used from several locations:

We're trying to include an XCFramework in our plugin for Unity. We're currently using Xcode 12, and Unity 2020.2. When building our project for iOS, we get the following error in Unity:

Plugin 'TestFairy.framework' is used from several locations:
 Assets/Plugins/iOS/TestFairy.xcframework/ios-armv7_arm64/TestFairy.framework would be copied to <PluginPath>/TestFairy.framework
 Assets/Plugins/iOS/TestFairy.xcframework/ios-i386_x86_64-simulator/TestFairy.framework would be copied to <PluginPath>/TestFairy.framework
Please fix plugin settings and try again.

UnityEditor.Modules.DefaultPluginImporterExtension:CheckFileCollisions (string)
UnityEditorInternal.PluginsHelper:CheckFileCollisions (UnityEditor.BuildTarget) (at /Users/builduser/buildslave/unity/build/Editor/Mono/Plugins/PluginsHelper.cs:25)
UnityEditor.BuildPlayerWindow:BuildPlayerAndRun () (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPlayerWindow.cs:124)

Obviously, it looks like Unity is picking up both frameworks in the XCFramework, however, we are curious to know if there's a way to have Unity filter out items from a Plugin based on architecture? We'd rather not delete the framework from the XCFramework, since we may need to switch between development on simulator and devices.

Perhaps through a custom PostProcessBuild script? However, from what we can tell, the above error happens before the PostProcessBuild can execute? Is there a way to hook into the PluginImporter so we can define which framework to use?

From what we can tell, the issue may be resolved in 2021.2, based on this issue: https://issuetracker.unity3d.com/issues/ios-plugin-is-used-from-several-locations-error-when-building-a-project-with-included-xcframeworks

However, we're looking for a solution that would allow us to use an XCFramework for earlier versions of Unity.

question from:https://stackoverflow.com/questions/65875561/plugin-framework-is-used-from-several-locations

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...