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

Parse Integration and Bolts #1655

Closed
4 tasks done
bvanderw opened this issue Jul 23, 2022 · 8 comments
Closed
4 tasks done

Parse Integration and Bolts #1655

bvanderw opened this issue Jul 23, 2022 · 8 comments
Labels
type:question Support or code-level question

Comments

@bvanderw
Copy link

bvanderw commented Jul 23, 2022

Xcode 13.4.1 with latest Swift
macOS 12.4
Lastest Parse 1.19.3

It is not clear at all at this point how Parse is to be integrated into a new project. What is clear is that the documentation is woefully out of date.

  1. The various zipped release frameworks do not include the Bolts framework.
  2. The ParseStarterProjects have a reference to Bolts but it is not included.
  3. I have not been able to build Bolts standalone by any means (including their own build scripts).
  4. I got away from using CocoaPods a long time ago and I am not willing to go back just to integrate Parse.
  5. Building using Carthage doesn't work. At one point awhile back, I was able to hobble together a Parse.xcframework which I have been using with a few projects, but I start seeing build errors whenever I add another library that depends on SQLite.
  6. The ParseSwift library does not have a clear migration path from this library (and I have other issues with the design as well).

If someone could give a workable integration strategy, it would really be appreciated.

New Issue Checklist

@parse-github-assistant
Copy link

parse-github-assistant bot commented Jul 23, 2022

Thanks for opening this issue!

  • ❌ Please edit your post and use the provided template when creating a new issue. This helps everyone to understand your post better and asks for essential information to quicker review the issue.

@mtrezza
Copy link
Member

mtrezza commented Jul 24, 2022

Does this work for you? #1591 (comment)

The ParseSwift library does not have a clear migration path from this library (and I have other issues with the design as well).

I suggest you open an issue in the Parse Swift SDK repository or post your questions in our community forum or chat to see whether there is anything that can be improved. cc @cbaker6

@mtrezza mtrezza added the type:question Support or code-level question label Jul 24, 2022
@bvanderw
Copy link
Author

Thanks for the response. After mucking around with this for several hours, I was finally able to get clean Carthage builds for both XCFrameworks and FAT frameworks. I did get the following at the beginning of the builds, however, it proceeded to build all the FBSDK frameworks without issue.

***  Skipped installing facebook-ios-sdk binary due to the error:
	"Incompatible Swift version - framework was built with 5.3.2 (swiftlang-1200.0.45 clang-1200.0.32.28) and the local version is 5.6.1 (swiftlang-5.6.0.323.66 clang-1316.0.20.12)."

I added all the XCFrameworks to my test project except Parse.xcframework, including Bolts, FBSDK*, ParseTwitter/FacebookUtils and ParseUI.

(Question: What is the minimum set of frameworks that need to be added to a project - keeping in mind that I am not using any of the ParseUI or use login features. Just the minimum to make basic query and update requests to the Parse Server. I always thought it was just Parse and Bolts.)

I added Parse.framework to the project. marking it as 'Do Not Embed'. I also added Carthage/Build/iOS to the Frameworks search path.

I added a Run Script build phase with copy-frameworks and Parse.framework as the input:

Screen Shot 2022-07-24 at 2 13 53 PM

The app ran successfully on a simulator. When I tried to run it on a real device, I got the following error:

Unable to install "ParseTest"
Domain: com.apple.dt.MobileDeviceErrorDomain
Code: -402620375
User Info: {
    DVTErrorCreationDateKey = "2022-07-24 17:54:14 +0000";
    IDERunOperationFailingWorker = IDEInstalliPhoneLauncher;
}

The code signature version is no longer supported.
Domain: com.apple.dt.MobileDeviceErrorDomain
Code: -402620375
User Info: {
    DVTRadarComponentKey = 261622;
    MobileDeviceErrorCode = "(0xE8008029)";
    "com.apple.dtdevicekit.stacktrace" = (
	0   DTDeviceKitBase                     0x000000011b0ac9d1 DTDKCreateNSErrorFromAMDErrorCode + 220
	1   DTDeviceKitBase                     0x000000011b0e8ce7 __90-[DTDKMobileDeviceToken installApplicationBundleAtPath:withOptions:andError:withCallback:]_block_invoke + 155
	2   DVTFoundation                       0x0000000105e707d6 DVTInvokeWithStrongOwnership + 71
	3   DTDeviceKitBase                     0x000000011b0e8a1d -[DTDKMobileDeviceToken installApplicationBundleAtPath:withOptions:andError:withCallback:] + 1422
	4   IDEiOSSupportCore                   0x000000011ac30668 __118-[DVTiOSDevice(DVTiPhoneApplicationInstallation) processAppInstallSet:appUninstallSet:installOptions:completionBlock:]_block_invoke.301 + 3414
	5   DVTFoundation                       0x0000000105fa23d4 __DVT_CALLING_CLIENT_BLOCK__ + 7
	6   DVTFoundation                       0x0000000105fa34bc __DVTDispatchAsync_block_invoke + 372
	7   libdispatch.dylib                   0x00007ff8123d90cc _dispatch_call_block_and_release + 12
	8   libdispatch.dylib                   0x00007ff8123da317 _dispatch_client_callout + 8
	9   libdispatch.dylib                   0x00007ff8123e0317 _dispatch_lane_serial_drain + 672
	10  libdispatch.dylib                   0x00007ff8123e0dfd _dispatch_lane_invoke + 366
	11  libdispatch.dylib                   0x00007ff8123eaeee _dispatch_workloop_worker_thread + 753
	12  libsystem_pthread.dylib             0x00007ff81258dfd0 _pthread_wqthread + 326
	13  libsystem_pthread.dylib             0x00007ff81258cf57 start_wqthread + 15
);
}

Analytics Event: com.apple.dt.IDERunOperationWorkerFinished : {
    "device_model" = "iPhone14,2";
    "device_osBuild" = "15.5 (19F77)";
    "device_platform" = "com.apple.platform.iphoneos";
    "launchSession_schemeCommand" = Run;
    "launchSession_state" = 1;
    "launchSession_targetArch" = arm64;
    "operation_duration_ms" = 1473;
    "operation_errorCode" = "-402620375";
    "operation_errorDomain" = "com.apple.dt.MobileDeviceErrorDomain";
    "operation_errorWorker" = IDEInstalliPhoneLauncher;
    "operation_name" = IDEiPhoneRunOperationWorkerGroup;
    "param_consoleMode" = 0;
    "param_debugger_attachToExtensions" = 0;
    "param_debugger_attachToXPC" = 1;
    "param_debugger_type" = 5;
    "param_destination_isProxy" = 0;
    "param_destination_platform" = "com.apple.platform.iphoneos";
    "param_diag_MainThreadChecker_stopOnIssue" = 0;
    "param_diag_MallocStackLogging_enableDuringAttach" = 0;
    "param_diag_MallocStackLogging_enableForXPC" = 1;
    "param_diag_allowLocationSimulation" = 1;
    "param_diag_gpu_frameCapture_enable" = 0;
    "param_diag_gpu_shaderValidation_enable" = 0;
    "param_diag_gpu_validation_enable" = 0;
    "param_diag_memoryGraphOnResourceException" = 0;
    "param_diag_queueDebugging_enable" = 1;
    "param_diag_runtimeProfile_generate" = 0;
    "param_diag_sanitizer_asan_enable" = 0;
    "param_diag_sanitizer_tsan_enable" = 0;
    "param_diag_sanitizer_tsan_stopOnIssue" = 0;
    "param_diag_sanitizer_ubsan_stopOnIssue" = 0;
    "param_diag_showNonLocalizedStrings" = 0;
    "param_diag_viewDebugging_enabled" = 1;
    "param_diag_viewDebugging_insertDylibOnLaunch" = 1;
    "param_install_style" = 0;
    "param_launcher_UID" = 2;
    "param_launcher_allowDeviceSensorReplayData" = 0;
    "param_launcher_kind" = 0;
    "param_launcher_style" = 0;
    "param_launcher_substyle" = 0;
    "param_runnable_appExtensionHostRunMode" = 0;
    "param_runnable_productType" = "com.apple.product-type.application";
    "param_runnable_swiftVersion" = "5.6.1";
    "param_runnable_type" = 2;
    "param_testing_launchedForTesting" = 0;
    "param_testing_suppressSimulatorApp" = 0;
    "param_testing_usingCLI" = 0;
    "sdk_canonicalName" = "iphoneos15.5";
    "sdk_osVersion" = "15.5";
    "sdk_variant" = iphoneos;
}

System Information

macOS Version 12.4 (Build 21F79)
Xcode 13.4.1 (20504) (Build 13F100)
Timestamp: 2022-07-24T13:54:14-04:00

I am stuck at this point (and desperate to get my hands on a set of frameworks that work).

Bruce

@mtrezza
Copy link
Member

mtrezza commented Jul 24, 2022

I always thought it was just Parse and Bolts.

I'd agree.

I am stuck at this point

Which step in #1591 (comment) did not work for you?

@cbaker6
Copy link
Contributor

cbaker6 commented Aug 17, 2022

The ParseSwift library does not have a clear migration path from this library

For anyone who's looking to switch from the Objective-C SDK to the Swift SDK, you should look at parse-community/Parse-Swift#391. This provides a seamless way of automatically logging in a user who was previously logged in using the Objective-C SDK by leveraging the session token. Note that logging in via the linked methods is the proper way to migrate to the Swift SDK as the SDK's themselves are entirely different and the Swift SDK should hydrate the _User ParseObject from the server instead of relying on the Objective-C SDK.

@mtrezza
Copy link
Member

mtrezza commented Sep 28, 2022

We now also have a migration guide (in the works) with important considerations when migration to the Parse Swift SDK.

@mtrezza
Copy link
Member

mtrezza commented Sep 28, 2022

@bvanderw I tried to replicate your steps and here is how I got it working in Xcode 14:

  1. Build with carthage using the xcframeworks flag
  2. Add the xcframework files Parse and Bolts (the minimum required to for the Parse SDK) to the project and choose "Embed and sign".
  3. Do not add a carthage build phase script and remove it if there is any, it isn't required anymore.

Important:

  • The ParseFacebookUtils won't work because they seem to look for a fat file dependency. I tried several build phase scripts to extract a specific architecture and add the fat file to the app, without success. If you need Facebook or Twitter authentication, use PFUser.linkWith().
  • The Parse ObjC SDK contains schemes for building both static and dynamic frameworks. That causes issues with carthage. Carthage builds the schemes in somewhat random order. It's necessary that it builds the static framework first, then the dynamic framework. You want the frameworks to be dynamic, otherwise you experience the error you described about the signature version. You can either run carthage a until the order is randomly correct, or run carthage update once, then open the Parse SDK in Carthage/Checkouts with Xcode and just remove the schemes for building the static framework, then run carthage build.

@mtrezza
Copy link
Member

mtrezza commented Jan 29, 2023

Closing as release 2.0.0 supports import via Swift Package Manager.

@mtrezza mtrezza closed this as completed Jan 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:question Support or code-level question
Projects
None yet
Development

No branches or pull requests

3 participants