From faeb19f0a3ce6ff839ae981c54009c441785eb42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eloy=20Dur=C3=A1n?= Date: Mon, 13 Aug 2012 20:48:16 +0200 Subject: [PATCH 01/11] Finish podspec. --- HockeySDK.podspec | 43 ++++++++++++++++++++++++------------------- 1 file changed, 24 insertions(+), 19 deletions(-) diff --git a/HockeySDK.podspec b/HockeySDK.podspec index f0ac0f6ca7..4533eff471 100644 --- a/HockeySDK.podspec +++ b/HockeySDK.podspec @@ -6,30 +6,35 @@ Pod::Spec.new do |s| s.summary = 'Distribute beta apps and collect crash reports with HockeyApp.' s.homepage = 'http://hockeyapp.net/' s.author = { 'Andreas Linde' => 'mail@andreaslinde.de', 'Thomas Dohmke' => "thomas@dohmke.de" } - s.source = { :git => 'https://github.com/bitstadium/HockeySDK-iOS', :tag => '2.5.0' } + s.source = { :git => 'https://github.com/bitstadium/HockeySDK-iOS.git', :tag => '2.5.0' } - s.description = 'HockeyApp is a server to distribute beta apps and collect crash reports. ' \ - 'It improves the testing process dramatically and can be used for both beta ' \ - 'and App Store builds. Only beta builds will notify users about a new version ' \ - 'NOTE: You will need to add a dependency on JSONKit, SBJson or YAJL yourself. If you ' \ - 'want the framework to try again when a network is available, add a dependency ' \ + s.description = 'HockeyApp is a server to distribute beta apps and collect crash reports. ' \ + 'It improves the testing process dramatically and can be used for both beta ' \ + 'and App Store builds. Only beta builds will notify users about a new version ' \ + 'NOTE: You will need to add a dependency on JSONKit, SBJson or YAJL yourself. If you ' \ + 'want the framework to try again when a network is available, add a dependency ' \ 'on Reachability and send a notification with the name `BITHockeyNetworkDidBecomeReachable` ' \ 'yourself when the network becomse reachable.' s.source_files = 'Classes' s.requires_arc = false - s.resources = 'Resources/HockeySDKResources.bundle' - s.frameworks = 'QuartzCore', 'SystemConfiguration', 'CrashReporter', 'CoreGraphics.framework', 'UIKit.framework' - s.xcconfig = { 'FRAMEWORK_SEARCH_PATHS' => '"$(BUILT_PRODUCTS_DIR)/Pods/Frameworks"' } + s.preserve_paths = 'Resources', 'Support', 'Vendor' + s.frameworks = 'QuartzCore', 'SystemConfiguration', 'CrashReporter', 'CoreGraphics', 'UIKit' + s.xcconfig = { 'FRAMEWORK_SEARCH_PATHS' => '"$(PODS_ROOT)/HockeySDK/Vendor"', + 'GCC_PREPROCESSOR_DEFINITIONS' => %{BITHOCKEY_VERSION="@\\"#{s.version}\\""} } def s.post_install(target_installer) - # Add a copy build phase and make it copy the CrashReporter.framework to the shared BUILT_PRODUCTS_DIR, - # so that both the Pods project and the user's project will pick it up. - phase = target_installer.target.buildPhases.add(Xcodeproj::Project::PBXCopyFilesBuildPhase, 'dstPath' => 'Pods/Frameworks') - file = target_installer.project.main_group.files.new('path' => 'HockeySDK/Vendor/CrashReporter.framework') - phase.files << file.buildFiles.new - phases = target_installer.target.attributes['buildPhases'] - phases.delete(phase.uuid) - phases.insert(1, phase.uuid) - end -end \ No newline at end of file + puts "\nGenerating HockeySDK resources bundle\n".yellow if config.verbose? + Dir.chdir File.join(config.project_pods_root, 'HockeySDK/Support') do + command = "xcodebuild -project HockeySDK.xcodeproj -target HockeySDKResources CONFIGURATION_BUILD_DIR=../Resources" + command << " 2>&1 > /dev/null" unless config.verbose? + unless system(command) + raise ::Pod::Informative, "Failed to generate HockeySDK resources bundle" + end + end + File.open(File.join(config.project_pods_root, target_installer.target_definition.copy_resources_script_name), 'a') do |file| + file.puts "install_resource 'HockeySDK/Resources/HockeySDKResources.bundle'" + end + end +end + From d616018f390263f318b71113c7cbfd505f142d6a Mon Sep 17 00:00:00 2001 From: Andreas Linde Date: Mon, 13 Aug 2012 23:30:02 +0200 Subject: [PATCH 02/11] Fix typo in BITHockeyManagerDelegate method Must be all time favorite, thanks to Evan for letting us know :-D --- Classes/BITHockeyManager.m | 10 +++++----- Classes/BITHockeyManagerDelegate.h | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Classes/BITHockeyManager.m b/Classes/BITHockeyManager.m index dcbedb40d1..0e53a29440 100644 --- a/Classes/BITHockeyManager.m +++ b/Classes/BITHockeyManager.m @@ -36,7 +36,7 @@ @interface BITHockeyManager () -- (BOOL)shouldUseLiveIdenfitier; +- (BOOL)shouldUseLiveIdentifier; - (void)configureJMC; @@ -117,7 +117,7 @@ _delegate = delegate; [_appIdentifier release]; - if ([self shouldUseLiveIdenfitier]) { + if ([self shouldUseLiveIdentifier]) { _appIdentifier = [liveIdentifier copy]; } else { @@ -178,10 +178,10 @@ #pragma mark - Private Instance Methods -- (BOOL)shouldUseLiveIdenfitier { +- (BOOL)shouldUseLiveIdentifier { BOOL delegateResult = NO; - if ([_delegate respondsToSelector:@selector(shouldUseLiveIdenfitier)]) { - delegateResult = [(NSObject *)_delegate shouldUseLiveIdenfitier]; + if ([_delegate respondsToSelector:@selector(shouldUseLiveIdentifier)]) { + delegateResult = [(NSObject *)_delegate shouldUseLiveIdentifier]; } return (delegateResult) || (_appStoreEnvironment); diff --git a/Classes/BITHockeyManagerDelegate.h b/Classes/BITHockeyManagerDelegate.h index ee97da9953..727cc9772b 100644 --- a/Classes/BITHockeyManagerDelegate.h +++ b/Classes/BITHockeyManagerDelegate.h @@ -46,13 +46,13 @@ the App Store. Example: - - (BOOL)shouldUseLiveIdenfitier { + - (BOOL)shouldUseLiveIdentifier { #ifdef (CONFIGURATION_Release) return YES; #endif return NO; } */ -- (BOOL)shouldUseLiveIdenfitier; +- (BOOL)shouldUseLiveIdentifier; @end \ No newline at end of file From 42abb23c412727e550abbc8dcb575882f21d9b82 Mon Sep 17 00:00:00 2001 From: Stefan Haubold Date: Tue, 14 Aug 2012 01:06:55 +0300 Subject: [PATCH 03/11] Added Troubleshooting Section to Migration Guide --- docs/Guide-Migration-Kits-template.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/Guide-Migration-Kits-template.md b/docs/Guide-Migration-Kits-template.md index 3b4cfbfd93..c9f4546912 100644 --- a/docs/Guide-Migration-Kits-template.md +++ b/docs/Guide-Migration-Kits-template.md @@ -100,6 +100,12 @@ Now follow the steps described in our [setup guide](http://support.hockeyapp.net After you have finished the setup guide make sure everything works as expected and then delete the out commented lines from above. +## Troubleshooting + +### ld: warning: directory not found for option '....QuincyKit.....' + +This warning means there is still a `Framework Search Path` pointing to the folder of the old SDK. Open the `Project Navigator` (⌘+1) and go to the tab `Build Settings`. In the search field enter the name of the folder mentioned in the warning (for example "QuincyKit") . If the search finds something in `Framework Search Paths` you should double click that entry and remove the line which points to the old folder. + ## Advanced Migration If you used any optional API calls, for example adding a custom description to a crash report, migrating those would exceed the scope of this guide. Please have a look at the [API documentation](https://github.com/bitstadium/HockeySDK-iOS/downloads). From 40041ad88252d3c1146a1c8e23966853428bbc76 Mon Sep 17 00:00:00 2001 From: Andreas Linde Date: Tue, 14 Aug 2012 12:04:41 +0200 Subject: [PATCH 04/11] Fix a crash if the notification BITHockeyNetworkDidBecomeReachableNotification is being sent --- Classes/BITCrashManager.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Classes/BITCrashManager.m b/Classes/BITCrashManager.m index 6f6897e302..75baa7f4b4 100644 --- a/Classes/BITCrashManager.m +++ b/Classes/BITCrashManager.m @@ -117,7 +117,7 @@ [_fileManager removeItemAtPath:_analyzerInProgressFile error:&error]; } - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(startManager) name:BITHockeyNetworkDidBecomeReachableNotification object:nil]; + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(invokeDelayedProcessing) name:BITHockeyNetworkDidBecomeReachableNotification object:nil]; if (!BITHockeyBundle()) { NSLog(@"WARNING: %@ is missing, will send reports automatically!", BITHOCKEYSDK_BUNDLE); From ece5f8bc4998b278d105cf72f2093b995bda6d30 Mon Sep 17 00:00:00 2001 From: Andreas Linde Date: Tue, 14 Aug 2012 12:16:53 +0200 Subject: [PATCH 05/11] Make sure PLCrashReporter only gets initialized once, even on manually invoking the method multiple times And also catch the exception PLCrashReporter throws, if the develop is somehow trying to initialize it multiple times. --- Classes/BITCrashManager.h | 1 + Classes/BITCrashManager.m | 34 +++++++++++++++++++++++----------- 2 files changed, 24 insertions(+), 11 deletions(-) diff --git a/Classes/BITCrashManager.h b/Classes/BITCrashManager.h index 4edbfe6dd6..ca40c43e57 100644 --- a/Classes/BITCrashManager.h +++ b/Classes/BITCrashManager.h @@ -93,6 +93,7 @@ static NSString *kBITCrashManagerStatus = @"BITCrashManagerStatus"; NSURLConnection *_urlConnection; BOOL _sendingInProgress; + BOOL _isSetup; } diff --git a/Classes/BITCrashManager.m b/Classes/BITCrashManager.m index 75baa7f4b4..6ac77ebfc9 100644 --- a/Classes/BITCrashManager.m +++ b/Classes/BITCrashManager.m @@ -75,6 +75,7 @@ _delegate = nil; _showAlwaysButton = NO; + _isSetup = NO; _crashIdenticalCurrentVersion = YES; _urlConnection = nil; @@ -422,18 +423,29 @@ - (void)startManager { if (_crashManagerStatus == BITCrashManagerStatusDisabled) return; - PLCrashReporter *crashReporter = [PLCrashReporter sharedReporter]; - NSError *error = NULL; - - // Check if we previously crashed - if ([crashReporter hasPendingCrashReport]) { - _didCrashInLastSession = YES; - [self handleCrashReport]; + if (!_isSetup) { + PLCrashReporter *crashReporter = [PLCrashReporter sharedReporter]; + NSError *error = NULL; + + // Check if we previously crashed + if ([crashReporter hasPendingCrashReport]) { + _didCrashInLastSession = YES; + [self handleCrashReport]; + } + + // PLCrashReporter is throwing an NSException if it is being enabled again + // even though it already is enabled + @try { + // Enable the Crash Reporter + if (![crashReporter enableCrashReporterAndReturnError: &error]) + NSLog(@"WARNING: Could not enable crash reporter: %@", [error localizedDescription]); + } + @catch (NSException * e) { + NSLog(@"WARNING: %@", [e reason]); + } + + _isSetup = NO; } - - // Enable the Crash Reporter - if (![crashReporter enableCrashReporterAndReturnError: &error]) - NSLog(@"WARNING: Could not enable crash reporter: %@", [error localizedDescription]); [self performSelector:@selector(invokeDelayedProcessing) withObject:nil afterDelay:0.5]; } From 58e7dc28a13d5739559e57e1c9ac51ae0e0270f3 Mon Sep 17 00:00:00 2001 From: Andreas Linde Date: Tue, 14 Aug 2012 12:19:19 +0200 Subject: [PATCH 06/11] Fix a typo --- Classes/BITCrashManager.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Classes/BITCrashManager.m b/Classes/BITCrashManager.m index 6ac77ebfc9..3da6337ed8 100644 --- a/Classes/BITCrashManager.m +++ b/Classes/BITCrashManager.m @@ -444,7 +444,7 @@ NSLog(@"WARNING: %@", [e reason]); } - _isSetup = NO; + _isSetup = YES; } [self performSelector:@selector(invokeDelayedProcessing) withObject:nil afterDelay:0.5]; From 2b17dba7c1f2e4de4a27221144aa1b48059d3db6 Mon Sep 17 00:00:00 2001 From: Andreas Linde Date: Tue, 14 Aug 2012 12:58:49 +0200 Subject: [PATCH 07/11] Fix setting the default delegate for UpdateManager (another typo) --- Classes/BITHockeyManager.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Classes/BITHockeyManager.m b/Classes/BITHockeyManager.m index 0e53a29440..7a760b09a4 100644 --- a/Classes/BITHockeyManager.m +++ b/Classes/BITHockeyManager.m @@ -201,7 +201,7 @@ BITHockeyLog(@"Setup UpdateManager"); _updateManager = [[BITUpdateManager alloc] initWithAppIdentifier:_appIdentifier isAppStoreEnvironemt:_appStoreEnvironment]; - _crashManager.delegate = _delegate; + _updateManager.delegate = _delegate; // Only if JMC is part of the project if ([[self class] isJMCPresent]) { From 56751b063461c646b38f75c396c285170000e15c Mon Sep 17 00:00:00 2001 From: Andreas Linde Date: Tue, 14 Aug 2012 14:12:24 +0200 Subject: [PATCH 08/11] Update version number to 2.5.1 --- Support/buildnumber.xcconfig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Support/buildnumber.xcconfig b/Support/buildnumber.xcconfig index 80d0d5005e..4515edad46 100644 --- a/Support/buildnumber.xcconfig +++ b/Support/buildnumber.xcconfig @@ -1,3 +1,3 @@ BUILD_NUMBER = 1 -VERSION_STRING = 2.5.0 -GCC_PREPROCESSOR_DEFINITIONS = $(inherited) BITHOCKEY_VERSION="@\"2.5.0\"" +VERSION_STRING = 2.5.1 +GCC_PREPROCESSOR_DEFINITIONS = $(inherited) BITHOCKEY_VERSION="@\"2.5.1\"" From 69a966c4277b774e572faf13c85301e1080f5c70 Mon Sep 17 00:00:00 2001 From: Andreas Linde Date: Tue, 14 Aug 2012 14:12:44 +0200 Subject: [PATCH 09/11] Update change log --- README.md | 14 +++++++++++++- docs/Changelog-template.md | 12 ++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index cc95ed4288..e43f201003 100644 --- a/README.md +++ b/README.md @@ -38,7 +38,19 @@ This documentation provides integrated help in Xcode for all public APIs and a s ## Changelog -### Version 2.5 +### Version 2.5.1 + +- General: + + - [BUGFIX] Typo in delegate `shouldUseLiveIdentifier` of `BITHockeyManagerDelegate` + - [BUGFIX] Default updateManager delegate wasn't set + +- Crash Reporting: + + - [BUGFIX] Crash when developer sends the notification `BITHockeyNetworkDidBecomeReachableNotification` + + +### Version 2.5.0 - General: diff --git a/docs/Changelog-template.md b/docs/Changelog-template.md index 937e8744e1..a1b61c981d 100644 --- a/docs/Changelog-template.md +++ b/docs/Changelog-template.md @@ -1,3 +1,15 @@ +## Version 2.5.1 + +- General: + + - [BUGFIX] Typo in delegate `shouldUseLiveIdentifier` of `BITHockeyManagerDelegate` + - [BUGFIX] Default updateManager delegate wasn't set + +- Crash Reporting: + + - [BUGFIX] Crash when developer sends the notification `BITHockeyNetworkDidBecomeReachableNotification` + + ## Version 2.5 - General: From 4a42c03c959f4045235619a2c19ae3d573fc9db5 Mon Sep 17 00:00:00 2001 From: Andreas Linde Date: Tue, 14 Aug 2012 14:16:34 +0200 Subject: [PATCH 10/11] Also update build number --- Support/buildnumber.xcconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Support/buildnumber.xcconfig b/Support/buildnumber.xcconfig index 4515edad46..4ed940094b 100644 --- a/Support/buildnumber.xcconfig +++ b/Support/buildnumber.xcconfig @@ -1,3 +1,3 @@ -BUILD_NUMBER = 1 +BUILD_NUMBER = 2 VERSION_STRING = 2.5.1 GCC_PREPROCESSOR_DEFINITIONS = $(inherited) BITHOCKEY_VERSION="@\"2.5.1\"" From 11eaba17f1e24d99cff2a304b12ba809e3c60252 Mon Sep 17 00:00:00 2001 From: Andreas Linde Date: Tue, 14 Aug 2012 14:19:28 +0200 Subject: [PATCH 11/11] Update pod spec to use the new 2.5.1 tag --- HockeySDK.podspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/HockeySDK.podspec b/HockeySDK.podspec index 4533eff471..22383a4e74 100644 --- a/HockeySDK.podspec +++ b/HockeySDK.podspec @@ -6,7 +6,7 @@ Pod::Spec.new do |s| s.summary = 'Distribute beta apps and collect crash reports with HockeyApp.' s.homepage = 'http://hockeyapp.net/' s.author = { 'Andreas Linde' => 'mail@andreaslinde.de', 'Thomas Dohmke' => "thomas@dohmke.de" } - s.source = { :git => 'https://github.com/bitstadium/HockeySDK-iOS.git', :tag => '2.5.0' } + s.source = { :git => 'https://github.com/bitstadium/HockeySDK-iOS.git', :tag => '2.5.1' } s.description = 'HockeyApp is a server to distribute beta apps and collect crash reports. ' \ 'It improves the testing process dramatically and can be used for both beta ' \