Downgrading Appium from 1.10 to 1.8.1 facing an linker command failed


#1

Hi Team,

I was just trying out the IOS mobile testing using Katalon Studio with the below link https://docs.katalon.com/katalon-studio/videos/ios_mobile_testing.html

After completing all the steps everything working as expected but when i try to record the iOS mobile devices the capture object not working its throws a null pointer exception.

When searching for the solution I got the below link

Unable to Capture objects | ExecutionException | java.lang.NullPointerException

So the solution is downgrading the Appium version from 1.10 to 1.8.1. After downgrading Appium to 1.8.1, when building the WebDriverAgent file I got the below issue,

Ld /Users/admin/Library/Developer/Xcode/DerivedData/WebDriverAgent-brdadhpuduowllgivnnvuygpwhzy/Build/Products/Debug-iphonesimulator/WebDriverAgentLib.framework/WebDriverAgentLib normal x86_64 (in target: WebDriverAgentLib)
    cd /usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent
    export IPHONEOS_DEPLOYMENT_TARGET=9.0
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch x86_64 -dynamiclib -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk -L/Users/admin/Library/Developer/Xcode/DerivedData/WebDriverAgent-brdadhpuduowllgivnnvuygpwhzy/Build/Products/Debug-iphonesimulator -F/Users/admin/Library/Developer/Xcode/DerivedData/WebDriverAgent-brdadhpuduowllgivnnvuygpwhzy/Build/Products/Debug-iphonesimulator -F/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Frameworks -F/usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent/Carthage/Build/iOS -F/usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent/Carthage/Build/Mac -filelist /Users/admin/Library/Developer/Xcode/DerivedData/WebDriverAgent-brdadhpuduowllgivnnvuygpwhzy/Build/Intermediates.noindex/WebDriverAgent.build/Debug-iphonesimulator/WebDriverAgentLib.build/Objects-normal/x86_64/WebDriverAgentLib.LinkFileList -install_name @rpath/WebDriverAgentLib.framework/WebDriverAgentLib -Xlinker -rpath -Xlinker @executable_path/Frameworks -Xlinker -rpath -Xlinker @loader_path/Frameworks -mios-simulator-version-min=9.0 -dead_strip -Xlinker -object_path_lto -Xlinker /Users/admin/Library/Developer/Xcode/DerivedData/WebDriverAgent-brdadhpuduowllgivnnvuygpwhzy/Build/Intermediates.noindex/WebDriverAgent.build/Debug-iphonesimulator/WebDriverAgentLib.build/Objects-normal/x86_64/WebDriverAgentLib_lto.o -Xlinker -export_dynamic -Xlinker -no_deduplicate -Xlinker -objc_abi_version -Xlinker 2 -fobjc-arc -fobjc-link-runtime -lxml2 -framework RoutingHTTPServer -framework YYCache -compatibility_version 1 -current_version 1 -Xlinker -dependency_info -Xlinker /Users/admin/Library/Developer/Xcode/DerivedData/WebDriverAgent-brdadhpuduowllgivnnvuygpwhzy/Build/Intermediates.noindex/WebDriverAgent.build/Debug-iphonesimulator/WebDriverAgentLib.build/Objects-normal/x86_64/WebDriverAgentLib_dependency_info.dat -o /Users/admin/Library/Developer/Xcode/DerivedData/WebDriverAgent-brdadhpuduowllgivnnvuygpwhzy/Build/Products/Debug-iphonesimulator/WebDriverAgentLib.framework/WebDriverAgentLib

Undefined symbols for architecture x86_64:
  "_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 x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Node Version - 8.0.0
Npm Version - 5.0.0
Appium Version - 1.8.1
Xcode Version - 10.1
Mac OS Version - 10.14.2

I am new to this Appium and Katalon framework so please do the needful.

Thanks,
Sadam


#2

Hi @sadam_husain,

It’s been my experience that each time you reinstall Appium, you’ll need to set up the WebDriverAgent project again:

NOTE: You will need to do the following to get it to compile in Xcode10:

  • In Xcode, go to File->Project Settings and change the Build System to “Legacy Build System”
  • In the WebDriverAgentLib target, go to the Build Settings tab
  • Find “Other Linker Flags” and add -Wl,-U,"_OBJC_CLASS_$_XCElementSnapshot"

Hope this helps,

Chris


#3

Hi Chris,

Your suggestion for “Other linker Flags” did fix my build failure issue for “WebDriverAgentLib”.
Thanks a lot for your help.

Cheers,
Sadam