parse-community / Parse-SDK-iOS-OSX

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

Xcode 16 iOS 18 crashes on Parse initialization #1809

Closed NDDev19 closed 1 month ago

NDDev19 commented 2 months ago

Issue Description

App crashes on launch when Parse is initializing.

Steps to reproduce

Create an empty app and just try to call

let parseConfig = ParseClientConfiguration {
            $0.applicationId = "id"
            $0.clientKey = "key"
            $0.server = "server address"
        }
        Parse.initialize(with: parseConfig)

Actual Outcome

*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Invalid class name. Class names cannot start with an underscore.'
*** First throw call stack:
(
    0   CoreFoundation                      0x00000001804b70ec __exceptionPreprocess + 172
    1   libobjc.A.dylib                     0x000000018008ede8 objc_exception_throw + 72
    2   CoreFoundation                      0x00000001804b6ffc -[NSException initWithCoder:] + 0
    3   ParseTraining.debug.dylib           0x000000010177b038 +[PFObject(Private) _assertValidInstanceClassName:] + 244
    4   ParseTraining.debug.dylib           0x00000001017844f0 -[PFObject init] + 512
    5   ParseTraining.debug.dylib           0x0000000101784824 -[PFObject initWithObjectState:] + 108
    6   ParseTraining.debug.dylib           0x0000000101784984 +[PFObject objectWithClassName:objectId:completeData:] + 292
    7   ParseTraining.debug.dylib           0x0000000101784ad0 +[PFObject objectWithClassName:] + 96
    8   ParseTraining.debug.dylib           0x0000000101785080 +[PFObject object] + 308
    9   ParseTraining.debug.dylib           0x00000001016e43cc __56-[PFCurrentInstallationController getCurrentObjectAsync]_block_invoke.9 + 580
    10  ParseTraining.debug.dylib           0x00000001017b8c88 __62-[BFTask continueWithExecutor:successBlock:cancellationToken:]_block_invoke + 212
    11  ParseTraining.debug.dylib           0x00000001017b8324 __55-[BFTask continueWithExecutor:block:cancellationToken:]_block_invoke + 124
    12  ParseTraining.debug.dylib           0x00000001017b46e0 __29+[BFExecutor defaultExecutor]_block_invoke_2 + 196
    13  ParseTraining.debug.dylib           0x00000001017b50a4 -[BFExecutor execute:] + 104
    14  ParseTraining.debug.dylib           0x00000001017b8788 __55-[BFTask continueWithExecutor:block:cancellationToken:]_block_invoke.15 + 60
    15  ParseTraining.debug.dylib           0x00000001017b7d5c -[BFTask runContinuations] + 544
    16  ParseTraining.debug.dylib           0x00000001017b768c -[BFTask trySetResult:] + 252
    17  ParseTraining.debug.dylib           0x00000001017b9964 -[BFTaskCompletionSource trySetResult:] + 104
    18  ParseTraining.debug.dylib           0x000000010171d2ec __28-[PFAsyncTaskQueue enqueue:]_block_invoke_2 + 280
    19  ParseTraining.debug.dylib           0x00000001017b8324 __55-[BFTask continueWithExecutor:block:cancellationToken:]_block_invoke + 124
    20  libdispatch.dylib                   0x00000001008acec0 _dispatch_call_block_and_release + 24
    21  libdispatch.dylib                   0x00000001008ae7b8 _dispatch_client_callout + 16
    22  libdispatch.dylib                   0x00000001008b15f4 _dispatch_queue_override_invoke + 1312
    23  libdispatch.dylib                   0x00000001008c23d4 _dispatch_root_queue_drain + 372
    24  libdispatch.dylib                   0x00000001008c2f7c _dispatch_worker_thread2 + 256
    25  libsystem_pthread.dylib             0x0000000100c4bb38 _pthread_wqthread + 224
    26  libsystem_pthread.dylib             0x0000000100c4a934 start_wqthread + 8
)
libc++abi: terminating due to uncaught exception of type NSException

Environment

Xcode 16 iOS 18 Parse-Server version 7.2

Client

Server

Database

Logs

Empty

parse-github-assistant[bot] commented 2 months ago

Thanks for opening this issue!

junya100 commented 2 months ago

Same here.

fantasticrahulrai commented 2 months ago

same here

Satyam-Tripathi-89 commented 2 months ago

Same here

fantasticrahulrai commented 2 months ago

The easiest fix..for me was move back to Cocoapods from SPM and change the imports from ParseCore to Parse..

NDDev19 commented 2 months ago

The easiest fix..for me was move back to Cocoapods from SPM and change the imports from ParseCore to Parse..

Using CocoaPods seems to work.

dhoerl commented 2 months ago

This issue appears related to #1792, for which a PR exists.

idefen1 commented 2 months ago

Edit: Thank you @dhoerl !!!!!!! By simply adding the following, all is working for me:

PFInstallation.registerSubclass()
PFUser.registerSubclass()
PFSession.registerSubclass()

Original: Having same issue as OP however cannot find work around. Any help would be greatly appreciated. @NDDev19 can you please give details of CocoaPods fix? I use CocoaPods but cannot find resolution. Thank you.

NDDev19 commented 1 month ago

Edit: Thank you @dhoerl !!!!!!! By simply adding the following, all is working for me:

PFInstallation.registerSubclass()
PFUser.registerSubclass()
PFSession.registerSubclass()

Original: Having same issue as OP however cannot find work around. Any help would be greatly appreciated. @NDDev19 can you please give details of CocoaPods fix? I use CocoaPods but cannot find resolution. Thank you.

When adding Parse-SDK using Swift Package Manager use this commit d2b9580db7ce44d6d4d0f626d5e388901f81f5ed instead of the latest 4.1.1 version.

dhoerl commented 1 month ago

I switched to the commit above, finally launched. I removed all the registerSubClass() calls, still launched. So that commit solves all issues for me! Thank you @NDDev19 !!!

mtrezza commented 1 month ago

Can this be closed as duplicate of https://github.com/parse-community/Parse-SDK-iOS-OSX/issues/1792?