Lickability / PinpointKit

Send better feedback
MIT License
1.13k stars 79 forks source link

iOS 12, Xcode 10, and Swift 4.2 Updates #251

Closed mliberatore closed 6 years ago

mliberatore commented 6 years ago

With the Xcode 10 GM available:

leisurehound commented 6 years ago

FWIW, in my project when I build my target with PinpointKit in Xcode 10 GM I get an obtuse error

Command CompileSwiftSources failed with a nonzero exit code

When I substitute a my fake feedback service, my target builds and runs. This compile error happens both before and after fixing the warning for

open static func takeScreenshot(of application

and changing it to:

public static func takeScreenshot(of application

mliberatore commented 6 years ago

Thanks, @leisurehound. We’ve just completed our project updates / Swift 4.2 conversion work in #252. It’s on master now if you’d like to give that a try with your project to see if it resolves the issue. Otherwise we’re going to do more testing over the next week to ensure proper compatibility prior to releasing the next version with these changes.

leisurehound commented 6 years ago

I'm still not getting this work, I'm not using CocoaPods but rather a git submodule and think I have the latest change. When I add PinpointKit to my embedded binaries and linked frameworks libraries for my target but don't reference it, I can build my project.

When I add the import PinpointKit statement (in Swift) I get a 'umbrella header 'PinpointKit.h' not found, but then build the PinpointKit target the go back and build my target I get the non-zero exit code error.

Removing the import statement and it then succeeds.

Would really like to move to Xcode 10 so I can more efficiently test on iOS 12 and appreciate any help; using my FakeFeedbackeService.swift that I built for tests gets me so far, but is a bit cumbersome moving between dev environments

joelshea commented 6 years ago

I am having the same issue as @leisurehound, but strangely only on our build server. It is fine building locally. Here is the error when built with --verbose:


    cd /tmp/agent/workspace/mobile.ios.build/Pods
    /Applications/Xcode.app/Contents/Developer/usr/bin/actool --output-format human-readable-text --notices --warnings --export-dependency-info /tmp/agent/workspace/mobile.ios.build/build/Build/Intermediates.noindex/ArchiveIntermediates/Distribution/IntermediateBuildFilesPath/Pods.build/Distribution-iphoneos/PinpointKit.build/assetcatalog_dependencies --output-partial-info-plist /tmp/agent/workspace/mobile.ios.build/build/Build/Intermediates.noindex/ArchiveIntermediates/Distribution/IntermediateBuildFilesPath/Pods.build/Distribution-iphoneos/PinpointKit.build/assetcatalog_generated_info.plist --compress-pngs --enable-on-demand-resources NO --sticker-pack-identifier-prefix org.cocoapods.PinpointKit.sticker-pack. --target-device iphone --target-device ipad --minimum-deployment-target 9.0 --platform iphoneos --product-type com.apple.product-type.framework --compile /tmp/agent/workspace/mobile.ios.build/build/Build/Intermediates.noindex/ArchiveIntermediates/Distribution/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/PinpointKit.framework /tmp/agent/workspace/mobile.ios.build/Pods/PinpointKit/PinpointKit/PinpointKit/Resources/PinpointKit.xcassets
2018-10-04 16:44:55.168 ibtoold[37201:740453] +[SimServiceContext serviceContextForDeveloperDir:error:]: unrecognized selector sent to class 0x113477c00
2018-10-04 16:44:55.232 ibtoold[37201:740453] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '+[SimServiceContext serviceContextForDeveloperDir:error:]: unrecognized selector sent to class 0x113477c00'
*** First throw call stack:
(
    0   CoreFoundation                      0x00007fff34bdc2db __exceptionPreprocess + 171
    1   libobjc.A.dylib                     0x00007fff5bd79c76 objc_exception_throw + 48
    2   CoreFoundation                      0x00007fff34c74cf4 +[NSObject(NSObject) doesNotRecognizeSelector:] + 132
    3   CoreFoundation                      0x00007fff34b52820 ___forwarding___ + 1456
    4   CoreFoundation                      0x00007fff34b521e8 _CF_forwarding_prep_0 + 120
    5   IDEInterfaceBuilderCocoaTouchIntegration 0x0000000113eef2dc __IBSharedInterfaceBuilderSpecificSimulatorServiceContext_block_invoke_2 + 162
    6   IDEInterfaceBuilderCocoaTouchIntegration 0x0000000113eef20e __IBSharedInterfaceBuilderSpecificSimulatorServiceContext_block_invoke + 28
    7   libdispatch.dylib                   0x00007fff5c959db8 _dispatch_client_callout + 8
    8   libdispatch.dylib                   0x00007fff5c959d6b dispatch_once_f + 41
    9   IDEInterfaceBuilderCocoaTouchIntegration 0x0000000113eef1ad IBSharedInterfaceBuilderSpecificSimulatorServiceContext + 1165
    10  IDEInterfaceBuilderCocoaTouchIntegration 0x0000000113dcd03e -[IBCocoaTouchIdiom trySimDeviceTypeForIdentifier:error:] + 56
    11  IDEInterfaceBuilderCocoaTouchIntegration 0x0000000113dcd1f9 -[IBCocoaTouchIdiom simDeviceTypeForToolDescription:error:] + 153
    12  IDEInterfaceBuilderCocoaTouchIntegration 0x0000000113e86ea4 -[IBCocoaTouchPlatformToolDescription preferredDeviceTypeReturningError:] + 114
    13  IDEInterfaceBuilderCocoaTouchIntegration 0x0000000113d90055 __130+[IBICAbstractCocoaTouchPlatformAdapter catalogToolForPlatformWithIdentifier:andAdditionalLaunchEnvironmentVariables:launchError:]_block_invoke_2 + 377
    14  IBFoundation                        0x00000001061c8b9c -[NSMutableDictionary(IBMutableDictionaryAdditions) ib_objectForKey:creatingIfNecessaryWithBlock:] + 100
    15  IDEInterfaceBuilderCocoaTouchIntegration 0x0000000113d8fbd9 +[IBICAbstractCocoaTouchPlatformAdapter catalogToolForPlatformWithIdentifier:andAdditionalLaunchEnvironmentVariables:launchError:] + 202
    16  IDEInterfaceBuilderCocoaTouchIntegration 0x0000000113d8d901 -[IBICAbstractCocoaTouchPlatformAdapter compileCARItems:tagSolutionSpace:options:queue:completionHandler:] + 371
    17  IDEInterfaceBuilderKit              0x0000000104fd8bad __84-[IBICAbstractPlatformAdapter compileSelectedItems:options:queue:completionHandler:]_block_invoke + 228
    18  IDEInterfaceBuilderKit              0x0000000104fdbfb4 __93-[IBICAbstractPlatformAdapter compileStandaloneCatalogItems:options:queue:completionHandler:]_block_invoke + 18
    19  DVTFoundation                       0x0000000105af945e __DVTDispatchAsync_block_invoke + 97
    20  libdispatch.dylib                   0x00007fff5c9615fa _dispatch_call_block_and_release + 12
    21  libdispatch.dylib                   0x00007fff5c959db8 _dispatch_client_callout + 8
    22  libdispatch.dylib                   0x00007fff5c965395 _dispatch_main_queue_callback_4CF + 1148
    23  CoreFoundation                      0x00007fff34b94c19 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 9
    24  CoreFoundation                      0x00007fff34b56dfa __CFRunLoopRun + 2586
    25  CoreFoundation                      0x00007fff34b56153 CFRunLoopRunSpecific + 483
    26  DVTFoundation                       0x000000010597ed3e -[NSRunLoop(DVTNSRunLoopAdditions) dvt_spinRunLoopInMode:whileBlockExecutesConcurrently:] + 457
    27  DVTFoundation                       0x000000010597f1e9 -[NSRunLoop(DVTNSRunLoopAdditions) dvt_spinRunLoopInMode:waitingForSemaphore:] + 128
    28  ibtoold                             0x0000000104d54850 -[IBCLIImageCatalogToolPersona compileCatalogCollection:withPlatformAdapter:arguments:outputDictionary:] + 1622
    29  ibtoold                             0x0000000104d56087 -[IBCLIImageCatalogToolPersona invokeArguments:outputDictionary:] + 1785
    30  ibtoold                             0x0000000104d56631 -[IBCLIImageCatalogToolPersona runSingleInvocation:outputtingToFileHandle:andVerifyingEnvironment:] + 709
    31  ibtoold                             0x0000000104d640e7 IBCLIServerRunSingleInvocation + 520
    32  ibtoold                             0x0000000104d6473e __IBCLIServerRunSingleInvocationWithIODirectedAtPipesAndUnlinkOnSuccess_block_invoke_2 + 34
    33  ibtoold                             0x0000000104d6460c __IBCLIServerRunSingleInvocationWithIODirectedAtPipesAndUnlinkOnSuccess_block_invoke + 857
    34  ibtoold                             0x0000000104d533f5 -[IBCLIErrorForwarder forwardErrorOutputToDescriptor:whileInvokingBlock:] + 110
    35  ibtoold                             0x0000000104d63c9d IBCLIServerRunSingleInvocationWithIODirectedAtPipesAndUnlinkOnSuccess + 581
    36  ibtoold                             0x0000000104d62a7d main + 2673
    37  libdyld.dylib                       0x00007fff5c993015 start + 1
    38  ???                                 0x0000000000000002 0x0 + 2
)
libc++abi.dylib: terminating with uncaught exception of type NSException
Command CompileAssetCatalog failed with a nonzero exit code```
mliberatore commented 6 years ago

Thanks for the detailed information @joelshea. Could you provide the following information if it’s not too much trouble?

  1. Is the build server using Xcode 10 or a different version?
  2. Is the build server using PinpointKit’s master branch or the latest release/specific version?
  3. What iOS version is the build server targeting (not the deployment target, but rather the simulator’s iOS version)?
joelshea commented 6 years ago
  1. Yes, it is using Xcode 10.
  2. It is using the latest release. Since @leisurehound reported that using master didn't work, I figured I would just get more details on this issue.
  3. Here is the full command: xcodebuild -workspace Moonrise.xcworkspace -scheme Distribution -configuration Distribution -destination 'generic/platform=iOS' -archivePath Archives/3.9.1/Distribution.xcarchive -derivedDataPath 'build' WTY_VERSION_NUMBER='3.9' WTY_BUILD_NUMBER='1' archive

Hope that helps.

joelshea commented 6 years ago

Okay, I figured out the issue. In order to complete the installation of a new version of Xcode, you must open the application on the desktop so it can download and install a couple more things. Because this was a headless server, that wasn't done. That's why the error says it couldn't find a particular tool. I found this solution with the help of this StackOverflow question: https://stackoverflow.com/questions/52413921/what-causes-unrecognized-selector-sent-to-class-error-on-xamarin-forms-build. (I'm not using Xamarin, which is why I didn't see this answer sooner, but turns out to be the same underlying issue.)

So turns out to be an environment issue. Sorry for the noise.

mliberatore commented 6 years ago

No worries at all, @joelshea. Thanks for following up about this!

mliberatore commented 6 years ago

@leisurehound, please try running the project I’ve attached here: PinpointKitXcode10Test.zip.

I’ve followed the manual install steps for PinpointKit found here. The project has full git history and a commit for each step that makes a change, if you’d like to reference it.

Please see if this project works for you in Xcode 10 to help rule out any issues specific to your computer. If the project builds and runs fine, it might be helpful to compare all of the build settings in your project with this example project to find a discrepancy that might be causing the error, including but not limited to the Build Options, Search Paths, and Swift Compiler categories.

Teglgaard commented 6 years ago

@mliberatore I tested it for you on xcode 10 and it compiles and the test succeeds, if that is to any help.

mliberatore commented 6 years ago

Closing as all tasks are complete.

Teglgaard commented 6 years ago

@mliberatore will this mean that it will be comitted to the master asap? I want to use the framework but am unable since it is not in the cocoapod yet.

mliberatore commented 6 years ago

Hey, @Teglgaard. Yes! We just released version 1.3.0 a couple hours ago, which has these latest changes. Please let us know if you run into any problems updating!

leisurehound commented 6 years ago

my brand new mid 2018 MacBook Pro arrived today, installed Xcode 10, cloned my project and it worked. I did not transfer my old Mac to this one, so truly clean new Mac and it worked, so its likely in the environment of my trashcan MacPro. Thanks again for the help, sorry for the noise.

I think I spent 2 days trying to find xcode->preferences->locations->derived data->legacy that was breaking things in the past, so imagine its related.