gpt4 book ai didi

ios - 为 iOS 编译时出现 UniWebView 链接器错误(使用 Unity 5、XCode 7.3.1 和 iOS SDK 9.3)

转载 作者:行者123 更新时间:2023-11-29 12:00:08 29 4
gpt4 key购买 nike

我在跨平台应用程序中使用 UniWebView 2,虽然该应用程序在 Android 上编译和运行,但在为 iOS 构建它时,我在 XCode 中构建项目时遇到错误。我尝试创建一个空项目并编译 UniWebView 示例场景之一,但遇到了同样的错误。

报错如下:

Undefined symbols for architecture armv7:
"__WebViewPlugin_EvaluateJS", referenced from:
_WebViewObject__WebViewPlugin_EvaluateJS_m3600170591 in Bulk_Assembly-CSharp-firstpass_0.o
_WebViewObject__WebViewPlugin_EvaluateJS_m3600170591 in Bulk_Assembly-CSharp-firstpass_0.o
(maybe you meant: _WebViewObject__WebViewPlugin_EvaluateJS_m3600170591)
"__WebViewPlugin_SetVisibility", referenced from:
_WebViewObject__WebViewPlugin_SetVisibility_m1941317136 in Bulk_Assembly-CSharp-firstpass_0.o
_WebViewObject_SetVisibility_m1306909320 in Bulk_Assembly-CSharp-firstpass_0.o
_WebViewObject__WebViewPlugin_SetVisibility_m1941317136 in Bulk_Assembly-CSharp-firstpass_0.o
_WebViewObject_SetVisibility_m1306909320 in Bulk_Assembly-CSharp-firstpass_0.o
(maybe you meant: _WebViewObject__WebViewPlugin_SetVisibility_m1941317136)
"__WebViewPlugin_SetMargins", referenced from:
_WebViewObject__WebViewPlugin_SetMargins_m46209250 in Bulk_Assembly-CSharp-firstpass_0.o
_WebViewObject_SetMargins_m3594992190 in Bulk_Assembly-CSharp-firstpass_0.o
_WebViewObject__WebViewPlugin_SetMargins_m46209250 in Bulk_Assembly-CSharp-firstpass_0.o
_WebViewObject_SetMargins_m3594992190 in Bulk_Assembly-CSharp-firstpass_0.o
(maybe you meant: _WebViewObject__WebViewPlugin_SetMargins_m46209250)
"__WebViewPlugin_LoadURL", referenced from:
_WebViewObject__WebViewPlugin_LoadURL_m3058146388 in Bulk_Assembly-CSharp-firstpass_0.o
_WebViewObject__WebViewPlugin_LoadURL_m3058146388 in Bulk_Assembly-CSharp-firstpass_0.o
(maybe you meant: _WebViewObject__WebViewPlugin_LoadURL_m3058146388)
"__WebViewPlugin_Destroy", referenced from:
_WebViewObject__WebViewPlugin_Destroy_m2965791645 in Bulk_Assembly-CSharp-firstpass_0.o
_WebViewObject_OnDestroy_m852260632 in Bulk_Assembly-CSharp-firstpass_0.o
_WebViewObject__WebViewPlugin_Destroy_m2965791645 in Bulk_Assembly-CSharp-firstpass_0.o
_WebViewObject_OnDestroy_m852260632 in Bulk_Assembly-CSharp-firstpass_0.o
(maybe you meant: _WebViewObject__WebViewPlugin_Destroy_m2965791645)
"__WebViewPlugin_SetFrame", referenced from:
_WebViewObject__WebViewPlugin_SetFrame_m3791199226 in Bulk_Assembly-CSharp-firstpass_0.o
_WebViewObject_SetCenterPositionWithScale_m3707009509 in Bulk_Assembly-CSharp-firstpass_0.o
_WebViewObject__WebViewPlugin_SetFrame_m3791199226 in Bulk_Assembly-CSharp-firstpass_0.o
_WebViewObject_SetCenterPositionWithScale_m3707009509 in Bulk_Assembly-CSharp-firstpass_0.o
(maybe you meant: _WebViewObject__WebViewPlugin_SetFrame_m3791199226)
"__WebViewPlugin_Init", referenced from:
_WebViewObject__WebViewPlugin_Init_m1745555759 in Bulk_Assembly-CSharp-firstpass_0.o
_WebViewObject__WebViewPlugin_Init_m1745555759 in Bulk_Assembly-CSharp-firstpass_0.o
(maybe you meant: _WebViewObject__WebViewPlugin_Init_m1745555759)
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)

导致它们的命令是这样的:

Ld /Users/studentdeveloper/Library/Developer/Xcode/DerivedData/Unity-iPhone-cufatstjeeklntdglsasxcmmpkyu/Build/Intermediates/Unity-iPhone.build/Release-iphoneos/Unity-iPhone.build/Objects-normal/armv7/ProductName normal armv7
cd /Users/studentdeveloper/projects/UniWebViewTest/build/move_prefab_and_scripts_2
export IPHONEOS_DEPLOYMENT_TARGET=6.0
export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.3.sdk -L/Users/studentdeveloper/Library/Developer/Xcode/DerivedData/Unity-iPhone-cufatstjeeklntdglsasxcmmpkyu/Build/Products/Release-iphoneos -L/Users/studentdeveloper/projects/UniWebViewTest/build/move_prefab_and_scripts_2 -L/Users/studentdeveloper/projects/UniWebViewTest/build/move_prefab_and_scripts_2/Libraries -F/Users/studentdeveloper/Library/Developer/Xcode/DerivedData/Unity-iPhone-cufatstjeeklntdglsasxcmmpkyu/Build/Products/Release-iphoneos -filelist /Users/studentdeveloper/Library/Developer/Xcode/DerivedData/Unity-iPhone-cufatstjeeklntdglsasxcmmpkyu/Build/Intermediates/Unity-iPhone.build/Release-iphoneos/Unity-iPhone.build/Objects-normal/armv7/ProductName.LinkFileList -Xlinker -map -Xlinker /Users/studentdeveloper/Library/Developer/Xcode/DerivedData/Unity-iPhone-cufatstjeeklntdglsasxcmmpkyu/Build/Intermediates/Unity-iPhone.build/Release-iphoneos/Unity-iPhone.build/ProductName-LinkMap-normal-armv7.txt -miphoneos-version-min=6.0 -dead_strip -fembed-bitcode-marker -weak_framework CoreMotion -weak-lSystem -stdlib=libc++ -fobjc-arc -fobjc-link-runtime -framework CoreText -framework AudioToolbox -weak_framework AVFoundation -framework CFNetwork -framework CoreGraphics -framework CoreLocation -framework CoreMedia -weak_framework CoreMotion -framework CoreVideo -framework Foundation -weak_framework iAd -framework MediaPlayer -framework OpenAL -framework OpenGLES -framework QuartzCore -framework SystemConfiguration -framework UIKit -liconv.2 -liPhone-lib -Xlinker -dependency_info -Xlinker /Users/studentdeveloper/Library/Developer/Xcode/DerivedData/Unity-iPhone-cufatstjeeklntdglsasxcmmpkyu/Build/Intermediates/Unity-iPhone.build/Release-iphoneos/Unity-iPhone.build/Objects-normal/armv7/ProductName_dependency_info.dat -o /Users/studentdeveloper/Library/Developer/Xcode/DerivedData/Unity-iPhone-cufatstjeeklntdglsasxcmmpkyu/Build/Intermediates/Unity-iPhone.build/Release-iphoneos/Unity-iPhone.build/Objects-normal/armv7/ProductName
  • 我保留了 Plugins 目录结构
  • 我使用 IL2CPP 作为脚本后端
  • 我的目标是正确的设备、SDK 和 iOS 版本
  • 我已尝试在 XCode 项目设置中禁用 bitcode 并启用 Preserve Private External Symbols
  • 我设法在 iPad 模拟器上构建和部署(x86_64,因为我是在 64 位 Mac 上构建的)

  • Here是定义相关方法的 WebViewObject.cs 文件

感谢您的宝贵时间。

最佳答案

WebViewPlugin是Gree的unity web view,所以应该不是UniWebView的问题(他们是不同的包)。

如果您不使用 WebViewPlugin 和相关的东西,您可以尝试从您的项目中删除它们。并仅使用 UniWebView 再试一次。

关于ios - 为 iOS 编译时出现 UniWebView 链接器错误(使用 Unity 5、XCode 7.3.1 和 iOS SDK 9.3),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37331104/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com