【问题标题】:UniWebView linker errors when compiling for iOS (using Unity 5, XCode 7.3.1 and iOS SDK 9.3)为 iOS 编译时出现 UniWebView 链接器错误(使用 Unity 5、XCode 7.3.1 和 iOS SDK 9.3)
【发布时间】:2016-09-16 19:10:38
【问题描述】:

我在跨平台应用程序中使用 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 文件

感谢您的宝贵时间。

【问题讨论】:

    标签: ios objective-c xcode uiwebview unity5


    【解决方案1】:

    WebViewPlugin 是格力的统一 web 视图,所以它可能不是 UniWebView 的问题(它们是不同的包)。

    如果您不使用 WebViewPlugin 和相关内容,您可以尝试从项目中删除它们。然后只使用 UniWebView 再试一次。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-09-11
      • 1970-01-01
      • 1970-01-01
      • 2013-06-19
      • 2013-09-29
      • 1970-01-01
      相关资源
      最近更新 更多