evermeer / AlamofireJsonToObjects

An Alamofire extension which converts JSON response data into swift objects using EVReflection
Other
161 stars 28 forks source link

Build error when including as CocoaPod #41

Closed BadPirate closed 7 years ago

BadPirate commented 7 years ago
0  swift                    0x00000001049483ad PrintStackTraceSignalHandler(void*) + 45
1  swift                    0x0000000104947b56 SignalHandler(int) + 790
2  libsystem_platform.dylib 0x00007fff88f9f52a _sigtramp + 26
3  libsystem_platform.dylib 0x00007f8443d83d50 _sigtramp + 3135129664
4  swift                    0x0000000101a6dc06 swift::irgen::emitWitnessTableRef(swift::irgen::IRGenFunction&, swift::CanType, llvm::Value**, swift::ProtocolConformanceRef) + 102
5  swift                    0x0000000101a6e309 void llvm::function_ref<void (swift::irgen::GenericRequirement)>::callback_fn<(anonymous namespace)::EmitPolymorphicArguments::emit(swift::CanTypeWrapper<swift::SILFunctionType>, llvm::ArrayRef<swift::Substitution>, swift::irgen::WitnessMetadata*, swift::irgen::Explosion&)::$_14>(long, swift::irgen::GenericRequirement) + 857
6  swift                    0x0000000101a6351b (anonymous namespace)::PolymorphicConvention::enumerateRequirements(llvm::function_ref<void (swift::irgen::GenericRequirement)> const&) + 299
7  swift                    0x0000000101a6de68 swift::irgen::emitPolymorphicArguments(swift::irgen::IRGenFunction&, swift::CanTypeWrapper<swift::SILFunctionType>, swift::CanTypeWrapper<swift::SILFunctionType>, llvm::ArrayRef<swift::Substitution>, swift::irgen::WitnessMetadata*, swift::irgen::Explosion&) + 472
8  swift                    0x0000000101ad0e71 (anonymous namespace)::IRGenSILFunction::visitFullApplySite(swift::FullApplySite) + 2929
9  swift                    0x0000000101abb458 swift::irgen::IRGenModule::emitSILFunction(swift::SILFunction*) + 9160
10 swift                    0x00000001019cd20f swift::irgen::IRGenerator::emitLazyDefinitions() + 6399
11 swift                    0x0000000101aa058a performIRGeneration(swift::IRGenOptions&, swift::ModuleDecl*, swift::SILModule*, llvm::StringRef, llvm::LLVMContext&, swift::SourceFile*, unsigned int) + 1802
12 swift                    0x0000000101955f31 performCompile(swift::CompilerInstance&, swift::CompilerInvocation&, llvm::ArrayRef<char const*>, int&, swift::FrontendObserver*) + 23777
13 swift                    0x000000010194e2b3 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 17859
14 swift                    0x000000010190a5cf main + 8239
15 libdyld.dylib            0x00007fff8744c5ad start + 1
Stack dump:
0.  Program arguments: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift -frontend -c -primary-file /Users/me/src/MyProject/Pods/AlamofireJsonToObjects/AlamofireJsonToObjects/AlamofireJsonToObjects.swift -target x86_64-apple-ios8.0 -enable-objc-interop -sdk /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator10.2.sdk -I /Users/me/Library/Developer/Xcode/DerivedData/Workspaces-gjylqawyfbcwxdbmcefvzjjvbhll/Build/Products/Debug-iphonesimulator/AlamofireJsonToObjects -F /Users/me/Library/Developer/Xcode/DerivedData/Workspaces-gjylqawyfbcwxdbmcefvzjjvbhll/Build/Products/Debug-iphonesimulator/AlamofireJsonToObjects -F /Users/me/Library/Developer/Xcode/DerivedData/Workspaces-gjylqawyfbcwxdbmcefvzjjvbhll/Build/Products/Debug-iphonesimulator/Alamofire -F /Users/me/Library/Developer/Xcode/DerivedData/Workspaces-gjylqawyfbcwxdbmcefvzjjvbhll/Build/Products/Debug-iphonesimulator/EVReflection -enable-testing -g -import-underlying-module -module-cache-path /Users/me/Library/Developer/Xcode/DerivedData/ModuleCache -D COCOAPODS -serialize-debugging-options -Xcc -I/Users/me/Library/Developer/Xcode/DerivedData/Workspaces-gjylqawyfbcwxdbmcefvzjjvbhll/Build/Intermediates/Pods.build/Debug-iphonesimulator/AlamofireJsonToObjects.build/swift-overrides.hmap -Xcc -iquote -Xcc /Users/me/Library/Developer/Xcode/DerivedData/Workspaces-gjylqawyfbcwxdbmcefvzjjvbhll/Build/Intermediates/Pods.build/Debug-iphonesimulator/AlamofireJsonToObjects.build/AlamofireJsonToObjects-generated-files.hmap -Xcc -I/Users/me/Library/Developer/Xcode/DerivedData/Workspaces-gjylqawyfbcwxdbmcefvzjjvbhll/Build/Intermediates/Pods.build/Debug-iphonesimulator/AlamofireJsonToObjects.build/AlamofireJsonToObjects-own-target-headers.hmap -Xcc -I/Users/me/Library/Developer/Xcode/DerivedData/Workspaces-gjylqawyfbcwxdbmcefvzjjvbhll/Build/Intermediates/Pods.build/Debug-iphonesimulator/AlamofireJsonToObjects.build/AlamofireJsonToObjects-all-non-framework-target-headers.hmap -Xcc -ivfsoverlay -Xcc /Users/me/Library/Developer/Xcode/DerivedData/Workspaces-gjylqawyfbcwxdbmcefvzjjvbhll/Build/Intermediates/Pods.build/all-product-headers.yaml -Xcc -iquote -Xcc /Users/me/Library/Developer/Xcode/DerivedData/Workspaces-gjylqawyfbcwxdbmcefvzjjvbhll/Build/Intermediates/Pods.build/Debug-iphonesimulator/AlamofireJsonToObjects.build/AlamofireJsonToObjects-project-headers.hmap -Xcc -I/Users/me/Library/Developer/Xcode/DerivedData/Workspaces-gjylqawyfbcwxdbmcefvzjjvbhll/Build/Products/Debug-iphonesimulator/AlamofireJsonToObjects/include -Xcc -I/Users/me/src/MyProject/Pods/Headers/Private -Xcc -I/Users/me/src/MyProject/Pods/Headers/Public -Xcc -I/Users/me/Library/Developer/Xcode/DerivedData/Workspaces-gjylqawyfbcwxdbmcefvzjjvbhll/Build/Intermediates/Pods.build/Debug-iphonesimulator/AlamofireJsonToObjects.build/DerivedSources/x86_64 -Xcc -I/Users/me/Library/Developer/Xcode/DerivedData/Workspaces-gjylqawyfbcwxdbmcefvzjjvbhll/Build/Intermediates/Pods.build/Debug-iphonesimulator/AlamofireJsonToObjects.build/DerivedSources -Xcc -DPOD_CONFIGURATION_DEBUG=1 -Xcc -DDEBUG=1 -Xcc -DCOCOAPODS=1 -Xcc -ivfsoverlay -Xcc /Users/me/Library/Developer/Xcode/DerivedData/Workspaces-gjylqawyfbcwxdbmcefvzjjvbhll/Build/Intermediates/Pods.build/Debug-iphonesimulator/AlamofireJsonToObjects.build/unextended-module-overlay.yaml -Xcc -working-directory/Users/me/src/MyProject/Pods -emit-module-doc-path /Users/me/Library/Developer/Xcode/DerivedData/Workspaces-gjylqawyfbcwxdbmcefvzjjvbhll/Build/Intermediates/Pods.build/Debug-iphonesimulator/AlamofireJsonToObjects.build/Objects-normal/x86_64/AlamofireJsonToObjects~partial.swiftdoc -Onone -parse-as-library -module-name AlamofireJsonToObjects -emit-module-path /Users/me/Library/Developer/Xcode/DerivedData/Workspaces-gjylqawyfbcwxdbmcefvzjjvbhll/Build/Intermediates/Pods.build/Debug-iphonesimulator/AlamofireJsonToObjects.build/Objects-normal/x86_64/AlamofireJsonToObjects~partial.swiftmodule -serialize-diagnostics-path /Users/me/Library/Developer/Xcode/DerivedData/Workspaces-gjylqawyfbcwxdbmcefvzjjvbhll/Build/Intermediates/Pods.build/Debug-iphonesimulator/AlamofireJsonToObjects.build/Objects-normal/x86_64/AlamofireJsonToObjects.dia -emit-dependencies-path /Users/me/Library/Developer/Xcode/DerivedData/Workspaces-gjylqawyfbcwxdbmcefvzjjvbhll/Build/Intermediates/Pods.build/Debug-iphonesimulator/AlamofireJsonToObjects.build/Objects-normal/x86_64/AlamofireJsonToObjects.d -emit-reference-dependencies-path /Users/me/Library/Developer/Xcode/DerivedData/Workspaces-gjylqawyfbcwxdbmcefvzjjvbhll/Build/Intermediates/Pods.build/Debug-iphonesimulator/AlamofireJsonToObjects.build/Objects-normal/x86_64/AlamofireJsonToObjects.swiftdeps -o /Users/me/Library/Developer/Xcode/DerivedData/Workspaces-gjylqawyfbcwxdbmcefvzjjvbhll/Build/Intermediates/Pods.build/Debug-iphonesimulator/AlamofireJsonToObjects.build/Objects-normal/x86_64/AlamofireJsonToObjects.o 
1.  While emitting IR SIL function @_TTVFC22AlamofireJsonToObjects18EVNetworkingObject15propertyMappingfT_GSaTGSqSS_GSqSS___ for 'propertyMapping' at /Users/me/src/MyProject/Pods/AlamofireJsonToObjects/AlamofireJsonToObjects/AlamofireJsonToObjects.swift:22:19

Using AlamofireJsonToObjects (2.4.0)

Any thoughts?

Art-Cube commented 7 years ago

I was in the middle of working on the objects in listWorkspaces and had not debugged those yet, so you might try removing that file from the project.

Rob

evermeer commented 7 years ago

This sort of problems is the reason why i have moved AlamofireJsonToObjects into EVReflection as a subspec. You can now use: pod 'EVReflection/Alamofire' There are now also subspecs for Moya, RxSwift and ReactiveSwift

The cause of this problem was the change of the function propertyMapping. It changed from:

override open func propertyMapping() -> [(String?, String?)] {
    return [("__response_statusCode", nil)]
}

To:

override open func propertyMapping() -> [(keyInObject: String?, keyInResource: String?)] {
    return [(keyInObject: "__response_statusCode", keyInResource: nil)]
}

I will push an update in a couple of minutes.

evermeer commented 7 years ago

This has now been pushed as version 2.4.1

BadPirate commented 7 years ago

2.4.1 Appears to fix the issue. Well done! @evermeer