-[UITests.FilterTest app]: unrecognized selector sent to instance
omurolgunay opened this issue · comments
We added SBTUITestTunnel as a XCFrameworks to our project.
Firstly we are getting this error Undefined symbol: OBJC_CLASS$_SBTUITestTunnelServer
We solved this error with building debug configuration as you mentioned in the email.
Now it gets build successfully but while running test we get the following error
-[UITests.FilterTest app]: unrecognized selector sent to instance 0x144705ad0 (NSInvalidArgumentException)
We can't access the app while starting UItest and it fails.
Sample Project:
sampleProject.zip
run this test sampleProjectUITestsLaunchTests
Xcode Version 13.2.1 (13C100)
macOS Monterey
Chip Apple M1 Pro
This is how we create XCFrameworks:
xcodebuild archive -scheme SBTUITestTunnelServer -destination="iOS" -archivePath archive/ios.xcarchive \
-configuration Debug -derivedDataPath archive/iphoneos -sdk iphoneos SKIP_INSTALL=NO BUILD_LIBRARY_FOR_DISTRIBUTION=YES \
GCC_PREPROCESSOR_DEFINITIONS='$GCC_PREPROCESSOR_DEFINITIONS ENABLE_UITUNNEL=1 ENABLE_UITUNNEL_SWIZZLING=1' \
SWIFT_ACTIVE_COMPILATION_CONDITIONS='$SWIFT_ACTIVE_COMPILATION_CONDITIONS ENABLE_UITUNNEL=1 ENABLE_UITUNNEL_SWIZZLING=1' \
xcodebuild -create-xcframework \
-framework archive/ios.xcarchive/Products/Library/Frameworks/SBTUITestTunnelServer.framework \
-framework archive/iossimulator.xcarchive/Products/Library/Frameworks/SBTUITestTunnelServer.framework \
-output SBTUITestTunnelServer.xcframework
we solved the problem with adding "OTHER_LDFLAGS": "-ObjC" both UITest and App targets