parse-community / Parse-SDK-iOS-OSX

The Apple SDK for Parse Platform (iOS, macOS, watchOS, tvOS)
https://parseplatform.org
Other
2.81k stars 864 forks source link

Parse Integration and Bolts #1655

Closed bvanderw closed 1 year ago

bvanderw commented 2 years ago

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). 3) I got away from using CocoaPods a long time ago and I am not willing to go back just to integrate Parse. 4) 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. 5) 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[bot] commented 2 years ago

Thanks for opening this issue!

mtrezza commented 2 years ago

Does this work for you? https://github.com/parse-community/Parse-SDK-iOS-OSX/issues/1591#issuecomment-1017454197

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

bvanderw commented 2 years ago

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 commented 2 years ago

I always thought it was just Parse and Bolts.

I'd agree.

I am stuck at this point

Which step in https://github.com/parse-community/Parse-SDK-iOS-OSX/issues/1591#issuecomment-1017454197 did not work for you?

cbaker6 commented 2 years ago

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 https://github.com/parse-community/Parse-Swift/pull/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 commented 1 year ago

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

mtrezza commented 1 year ago

@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:

mtrezza commented 1 year ago

Closing as release 2.0.0 supports import via Swift Package Manager.