chat-sdk / chat-sdk-ios

Chat SDK iOS - Open Source Mobile Messenger
http://sdk.chat
Other
913 stars 276 forks source link

IPhone app crash #509

Closed ronaldo-triibo closed 4 months ago

ronaldo-triibo commented 1 year ago
  1. Is the bug present in the demo Chat SDK project? No

  2. What modifications have you made to the Chat SDK? Installed as a static pod.

  3. iOS Version? Device or simulator? iOS 16, both device and simulator

  4. Steps taken to reproduce the problem: Install pod as static and try to run project.

  5. Expected result: Open app and chat be available.

  6. Actual result: App crashes.

  7. Comments: App crashes on BCoreDataStorageAdapter.m on managedObjectModel because it cannot find: bCoreDataBundle @"Frameworks/ChatSDK.framework/ChatCoreData" \250\253\267c\370(null)libc++abi: terminating with uncaught exception of type NSException terminating with uncaught exception of type NSException

Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: ' -[NSURL initFileURLWithPath:]: nil string parameter' CoreSimulator 857.14 - Device: iPhone 14 (DCF8E0D9-749B-476F-B9AC-8D1B587E92EE) - Runtime: iOS 16.2 (20C52) - DeviceType: iPhone 14

bensmiley commented 1 year ago

Can you check the latest version and tell me if this is still a problem?

ronaldo-triibo commented 1 year ago

Hi, thanks for your reply! I've tried with version 5.2.1 (which is the latest I found using pod search) and the issue still happens.

mahesh-ivy commented 4 months ago

I have installed latest version of this and same issue happening to me in iOS simulator and device. Any solution would be helpful.

ronaldo-triibo commented 4 months ago

This week I came back to my project and actually managed to get it working by doing the following:

  1. Upgraded my React Native version to 0.70.15 (using https://react-native-community.github.io/upgrade-helper)
  2. Setting hermes_enabled to false in my Podfile.
  3. Since my project uses static frameworks in its Podfile (use_frameworks! :linkage => :static), I've created a new define for dynamic ones as follows:
    def dynamic_pods
    use_frameworks! :linkage => :dynamic
    pod 'AFNetworking'
    pod 'ChatSDK', '5.1.5'
    ...
    end

    And called it in my target:

    target 'MyProject' do
    static_pods
    dynamic_pods
    end

Hope it helps!

mahesh-ivy commented 4 months ago

That was great help brother. Many many thank you. Will try this now.