RobotFramework+Appium 为了兼容iOS12,升级至Xcode10后,WebDriverAgent编译不通过:Undefind symbols for architecture x86_64

报错信息如下:

Undefined symbols for architecture arm64:
"_OBJC_CLASS_$_XCElementSnapshot", referenced from:
l_OBJC_$_CATEGORY_XCElementSnapshot_$_FBIsVisible in XCUIElement+FBIsVisible.o
l_OBJC_$_CATEGORY_XCElementSnapshot_$_FBUID in XCUIElement+FBUID.o
l_OBJC_$_CATEGORY_XCElementSnapshot_$_WebDriverAttributes in XCUIElement+FBWebDriverAttributes.o
objc-class-ref in XCUIElement+FBWebDriverAttributes.o
objc-class-ref in XCUIElement+FBUtilities.o
l_OBJC_$_CATEGORY_XCElementSnapshot_$_FBAccessibility in XCUIElement+FBAccessibility.o
l_OBJC_$_CATEGORY_XCElementSnapshot_$_FBScrolling in XCUIElement+FBScrolling.o
...
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

原因分析:苹果将XCElementSnapshot从XCTest.framework移动到了私有的XCTAutomationSupport.framework

造成文件无法import

结果办法:

在文件WebDriverAgent.xcodeproj/project.pbxproj中增加部分代码,增加途中绿色部分,具体增加的代码查看webDriverAgent作者在git中的提交

https://github.com/facebook/WebDriverAgent/commit/c4da863b9c8d6d076ba74bf1ff58b47ef56dd2fa#diff-7610c17549f7cb63943c12afdfd7ba64R613

posted @ 2019-01-23 14:42  黄黄可爱  阅读(1257)  评论(1编辑  收藏  举报