Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot run the tests on the latest XCode #33

Open
ghost opened this issue May 23, 2017 · 16 comments
Open

Cannot run the tests on the latest XCode #33

ghost opened this issue May 23, 2017 · 16 comments

Comments

@ghost
Copy link

ghost commented May 23, 2017

Build fails with the following error:

Ld /Users/yoelgluschnaider/Library/Developer/Xcode/DerivedData/PocketForecast-djmclrdnqtllpigcjwhqcmwytbjp/Build/Products/Debug-iphonesimulator/PocketForecast.app/PlugIns/PocketForecastTests.xctest/PocketForecastTests normal x86_64
cd /Users/yoelgluschnaider/dev/src/Typhoon-example
export IPHONEOS_DEPLOYMENT_TARGET=7.0
export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.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 x86_64 -bundle -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator10.3.sdk -L/Users/yoelgluschnaider/Library/Developer/Xcode/DerivedData/PocketForecast-djmclrdnqtllpigcjwhqcmwytbjp/Build/Products/Debug-iphonesimulator -F/Users/yoelgluschnaider/Library/Developer/Xcode/DerivedData/PocketForecast-djmclrdnqtllpigcjwhqcmwytbjp/Build/Products/Debug-iphonesimulator -F/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator10.3.sdk/Developer/Library/Frameworks -F/Applications/Xcode.app/Contents/Developer/Library/Frameworks -F/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Frameworks -filelist /Users/yoelgluschnaider/Library/Developer/Xcode/DerivedData/PocketForecast-djmclrdnqtllpigcjwhqcmwytbjp/Build/Intermediates/PocketForecast.build/Debug-iphonesimulator/PocketForecastTests.build/Objects-normal/x86_64/PocketForecastTests.LinkFileList -mios-simulator-version-min=7.0 -dead_strip -bundle_loader /Users/yoelgluschnaider/Library/Developer/Xcode/DerivedData/PocketForecast-djmclrdnqtllpigcjwhqcmwytbjp/Build/Products/Debug-iphonesimulator/PocketForecast.app/PocketForecast -Xlinker -object_path_lto -Xlinker /Users/yoelgluschnaider/Library/Developer/Xcode/DerivedData/PocketForecast-djmclrdnqtllpigcjwhqcmwytbjp/Build/Intermediates/PocketForecast.build/Debug-iphonesimulator/PocketForecastTests.build/Objects-normal/x86_64/PocketForecastTests_lto.o -Xlinker -no_deduplicate -Xlinker -objc_abi_version -Xlinker 2 -fobjc-arc -fobjc-link-runtime -Objc -all_load -ObjC -lExpecta -lOCHamcrest -lOCMockito -framework Foundation -framework XCTest -Xlinker -sectcreate -Xlinker __TEXT -Xlinker __entitlements -Xlinker /Users/yoelgluschnaider/Library/Developer/Xcode/DerivedData/PocketForecast-djmclrdnqtllpigcjwhqcmwytbjp/Build/Intermediates/PocketForecast.build/Debug-iphonesimulator/PocketForecastTests.build/PocketForecastTests.xctest.xcent -lxml2 -framework XCTest -framework UIKit -framework Foundation -lPods-PocketForecastTests -Xlinker -dependency_info -Xlinker /Users/yoelgluschnaider/Library/Developer/Xcode/DerivedData/PocketForecast-djmclrdnqtllpigcjwhqcmwytbjp/Build/Intermediates/PocketForecast.build/Debug-iphonesimulator/PocketForecastTests.build/Objects-normal/x86_64/PocketForecastTests_dependency_info.dat -o /Users/yoelgluschnaider/Library/Developer/Xcode/DerivedData/PocketForecast-djmclrdnqtllpigcjwhqcmwytbjp/Build/Products/Debug-iphonesimulator/PocketForecast.app/PlugIns/PocketForecastTests.xctest/PocketForecastTests

ld: warning: directory not found for option '-F/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator10.3.sdk/Developer/Library/Frameworks'
ld: embedded dylibs/frameworks are only supported on iOS 8.0 and later (@rpath/XCTest.framework/XCTest) for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

@jasperblues
Copy link
Member

ld: embedded dylibs/frameworks are only supported on iOS 8.0 and later (@rpath/XCTest.framework/XCTest) for architecture x86_64

We can change the deployment target?

@jasperblues
Copy link
Member

The Swift example is also broken - code is for Swift 2. I will upgrade to Swift 3 (and perhaps use Typhoon Swift) asap.

@ghost
Copy link
Author

ghost commented May 23, 2017

Thanks for the prompt response @jasperblues

@ghost
Copy link
Author

ghost commented May 23, 2017

@jasperblues I also meant to submit an issue on the Swift example after I tried upgrading it to Swift 3 but it became quite messy and I could not follow that through.

@jasperblues
Copy link
Member

I'll fix it up ASAP. Are you ok with the ObjC version now?

@ghost
Copy link
Author

ghost commented May 23, 2017

Thanks, but the ObjC version tests are failing to build even after upgrading the target to 8.0 with the following message:
Ld /Users/yoelgluschnaider/Library/Developer/Xcode/DerivedData/PocketForecast-djmclrdnqtllpigcjwhqcmwytbjp/Build/Products/Debug-iphonesimulator/PocketForecast.app/PlugIns/PocketForecastTests.xctest/PocketForecastTests normal x86_64
cd /Users/yoelgluschnaider/dev/src/Typhoon-example
export IPHONEOS_DEPLOYMENT_TARGET=7.0
export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.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 x86_64 -bundle -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator10.3.sdk -L/Users/yoelgluschnaider/Library/Developer/Xcode/DerivedData/PocketForecast-djmclrdnqtllpigcjwhqcmwytbjp/Build/Products/Debug-iphonesimulator -F/Users/yoelgluschnaider/Library/Developer/Xcode/DerivedData/PocketForecast-djmclrdnqtllpigcjwhqcmwytbjp/Build/Products/Debug-iphonesimulator -F/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator10.3.sdk/Developer/Library/Frameworks -F/Applications/Xcode.app/Contents/Developer/Library/Frameworks -F/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Frameworks -filelist /Users/yoelgluschnaider/Library/Developer/Xcode/DerivedData/PocketForecast-djmclrdnqtllpigcjwhqcmwytbjp/Build/Intermediates/PocketForecast.build/Debug-iphonesimulator/PocketForecastTests.build/Objects-normal/x86_64/PocketForecastTests.LinkFileList -mios-simulator-version-min=7.0 -dead_strip -bundle_loader /Users/yoelgluschnaider/Library/Developer/Xcode/DerivedData/PocketForecast-djmclrdnqtllpigcjwhqcmwytbjp/Build/Products/Debug-iphonesimulator/PocketForecast.app/PocketForecast -Xlinker -object_path_lto -Xlinker /Users/yoelgluschnaider/Library/Developer/Xcode/DerivedData/PocketForecast-djmclrdnqtllpigcjwhqcmwytbjp/Build/Intermediates/PocketForecast.build/Debug-iphonesimulator/PocketForecastTests.build/Objects-normal/x86_64/PocketForecastTests_lto.o -Xlinker -no_deduplicate -Xlinker -objc_abi_version -Xlinker 2 -fobjc-arc -fobjc-link-runtime -Objc -all_load -ObjC -lExpecta -lOCHamcrest -lOCMockito -framework Foundation -framework XCTest -Xlinker -sectcreate -Xlinker __TEXT -Xlinker __entitlements -Xlinker /Users/yoelgluschnaider/Library/Developer/Xcode/DerivedData/PocketForecast-djmclrdnqtllpigcjwhqcmwytbjp/Build/Intermediates/PocketForecast.build/Debug-iphonesimulator/PocketForecastTests.build/PocketForecastTests.xctest.xcent -lxml2 -framework XCTest -framework UIKit -framework Foundation -lPods-PocketForecastTests -Xlinker -dependency_info -Xlinker /Users/yoelgluschnaider/Library/Developer/Xcode/DerivedData/PocketForecast-djmclrdnqtllpigcjwhqcmwytbjp/Build/Intermediates/PocketForecast.build/Debug-iphonesimulator/PocketForecastTests.build/Objects-normal/x86_64/PocketForecastTests_dependency_info.dat -o /Users/yoelgluschnaider/Library/Developer/Xcode/DerivedData/PocketForecast-djmclrdnqtllpigcjwhqcmwytbjp/Build/Products/Debug-iphonesimulator/PocketForecast.app/PlugIns/PocketForecastTests.xctest/PocketForecastTests

ld: warning: directory not found for option '-F/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator10.3.sdk/Developer/Library/Frameworks'
ld: embedded dylibs/frameworks are only supported on iOS 8.0 and later (@rpath/XCTest.framework/XCTest) for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

@jasperblues
Copy link
Member

let me see if i can repro that . . .

@jasperblues
Copy link
Member

main app ok, but test target failed. fixing. that what you're experiencing?

@jasperblues
Copy link
Member

Setting the test deployment target to a more recent iOS fixes it for me. Also pushed a build with more recent dependencies.

@jasperblues
Copy link
Member

does it work for you now?

@ghost
Copy link
Author

ghost commented May 23, 2017

Well, the tests do run, but I get an exception for some reason. It seems that in TyphoonAssemblyBuilder.m line 32 (only in the tests) it returns something strange from [assemblyClass isSubclassOfClass:[TyphoonAssembly class]]

@jasperblues
Copy link
Member

I will get an API key and try. What about the main app, ok?

@ghost
Copy link
Author

ghost commented May 23, 2017

The main app always worked for me (after fixing the URL).
The issue with the tests might be that the PFApplicationAssembly is added in the test target as well (or at least that's what StackOverflow tells me :) )

@nicoabie
Copy link

Hi @jasperblues I'm currently using xcode version 10.2.1 and the test project does not compile.
I'm trying to see how this works in order to use it in a framework I'm developing. I could use a hand on this. Thanks in advance!

@nicoabie nicoabie mentioned this issue Apr 26, 2019
@nicoabie
Copy link

@jasperblues I got an API key for testing which is a4dbfc1c1b264a0d979185239192604

Now when is run the tests the following error is thrown.
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Class PFApplicationAssembly is not a subclass of TyphoonAssembly'

if I change how the classes are compared using

[assemblyClass superclass] != [TyphoonAssembly class]

The first attempt passes but the second one to requireInitialFactory fails.

@qtdevel
Copy link

qtdevel commented Feb 15, 2020

The problem is in Podfile. Because of PocketForecastTests target is inside of PocketForecast target body. Move PocketForecastTests target body outside of PocketForecast target body.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants