OneSignal / OneSignal-Flutter-SDK

OneSignal is a free push notification service for mobile apps. This plugin makes it easy to integrate your flutter app with OneSignal
https://www.onesignal.com
Other
615 stars 213 forks source link

[Bug]: iOS app gets crashed (Release 3.4.2) #613

Closed devmuaz closed 5 months ago

devmuaz commented 1 year ago

What happened?

The latest version v3.4.2 causes a memory crash on iOS and was unable to run the application properly until I downgraded the version back to v3.4.1 and worked just fine.

Steps to reproduce?

1. Create new flutter app
2. Add the `onesignal_flutter` package
3. Setup the notifications steps on iOS
4. Run the app and will cause a crash

What did you expect to happen?

It should run correctly as it supposed to be

OneSignal Flutter SDK version

Release 3.4.2

Which platform(s) are affected?

Relevant log output

I got these memory logs

dyld`:
    0x1d7e9aeb4 <+0>:  mov    x16, #0x209
    0x1d7e9aeb8 <+4>:  svc    #0x80
->  0x1d7e9aebc <+8>:  b.lo   0x1d7e9aedc               ; <+40>
    0x1d7e9aec0 <+12>: pacibsp 
    0x1d7e9aec4 <+16>: stp    x29, x30, [sp, #-0x10]!
    0x1d7e9aec8 <+20>: mov    x29, sp
    0x1d7e9aecc <+24>: bl     0x1d7e3771c               ; cerror_nocancel
    0x1d7e9aed0 <+28>: mov    sp, x29
    0x1d7e9aed4 <+32>: ldp    x29, x30, [sp], #0x10
    0x1d7e9aed8 <+36>: retab  
    0x1d7e9aedc <+40>: ret    

And also I got these output logs

dyld[6658]: Library not loaded: @rpath/OneSignalExtension.framework/OneSignalExtension
  Referenced from: <61C646E0-5484-305B-AB3F-AF0BA1884A80> /private/var/containers/Bundle/Application/F250D454-D344-45FF-B635-C45AFA5B3659/Runner.app/Runner
  Reason: tried: '/usr/lib/swift/OneSignalExtension.framework/OneSignalExtension' (errno=2, not in dyld cache), '/private/preboot/Cryptexes/OS/usr/lib/swift/OneSignalExtension.framework/OneSignalExtension' (errno=2), '/usr/lib/swift/OneSignalExtension.framework/OneSignalExtension' (errno=2, not in dyld cache), '/private/preboot/Cryptexes/OS/usr/lib/swift/OneSignalExtension.framework/OneSignalExtension' (errno=2), '/private/var/containers/Bundle/Application/F250D454-D344-45FF-B635-C45AFA5B3659/Runner.app/Frameworks/OneSignalExtension.framework/OneSignalExtension' (errno=2), '/private/var/containers/Bundle/Application/F250D454-D344-45FF-B635-C45AFA5B3659/Runner.app/Frameworks/OneSignalExtension.framework/OneSignalExtension' (errno=2), '/private/var/containers/Bundle/Application/F250D454-D344-45FF-B635-C45AFA5B3659/Runner.app/Frameworks/OneSignalExtension.framework/OneSignalExtension' (errno=2), '/usr/lib/swift/OneSignalExtension.framework/OneSignalExtension' (errno=2, not in dyld cache), '/private/preboot/Cryptexes/OS/usr/lib/swift/OneSignalExtension.framework/OneSignalExtension' (errno=2), '/usr/lib/swift/OneSignalExtension.framework/OneSignalExtension' (errno=2, not in dyld cache), '/private/preboot/Cryptexes/OS/usr/lib/swift/OneSignalExtension.framework/OneSignalExtension' (errno=2), '/private/var/containers/Bundle/Application/F250D454-D344-45FF-B635-C45AFA5B3659/Runner.app/Frameworks/OneSignalExtension.framework/OneSignalExtension' (errno=2), '/private/var/containers/Bundle/Application/F250D454-D344-45FF-B635-C45AFA5B3659/Runner.app/Frameworks/OneSignalExtension.framework/OneSignalExtension' (errno=2), '/private/var/containers/Bundle/Application/F250D454-D344-45FF-B635-C45AFA5B3659/Runner.app/Frameworks/OneSignalExtension.framework/OneSignalExtension' (errno=2), '/private/preboot/Cryptexes/OS@rpath/OneSignalExtension.framework/OneSignalExtension' (errno=2), '/usr/lib/swift/OneSignalExtension.framework/OneSignalExtension' (errno=2, not in dyld cache), '/private/preboot/Cryptexes/OS/usr/lib/swift/OneSignalExtension.framework/OneSignalExtension' (errno=2), '/usr/lib/swift/OneSignalExtension.framework/OneSignalExtension' (errno=2, not in dyld cache), '/private/preboot/Cryptexes/OS/usr/lib/swift/OneSignalExtension.framework/OneSignalExtension' (errno=2), '/private/var/containers/Bundle/Application/F250D454-D344-45FF-B635-C45AFA5B3659/Runner.app/Frameworks/OneSignalExtension.framework/OneSignalExtension' (errno=2), '/private/var/containers/Bundle/Application/F250D454-D344-45FF-B635-C45AFA5B3659/Runner.app/Frameworks/OneSignalExtension.framework/OneSignalExtension' (errno=2), '/private/var/containers/Bundle/Application/F250D454-D344-45FF-B635-C45AFA5B3659/Runner.app/Frameworks/OneSignalExtension.framework/OneSignalExtension' (errno=2), '/usr/lib/swift/OneSignalExtension.framework/OneSignalExtension' (errno=2, not in dyld cache), '/private/preboot/Cryptexes/OS/usr/lib/swift/OneSignalExtension.framework/OneSignalExtension' (errno=2), '/usr/lib/swift/OneSignalExtension.framework/OneSignalExtension' (errno=2, not in dyld cache), '/private/preboot/Cryptexes/OS/usr/lib/swift/OneSignalExtension.framework/OneSignalExtension' (errno=2), '/private/var/containers/Bundle/Application/F250D454-D344-45FF-B635-C45AFA5B3659/Runner.app/Frameworks/OneSignalExtension.framework/OneSignalExtension' (errno=2), '/private/var/containers/Bundle/Application/F250D454-D344-45FF-B635-C45AFA5B3659/Runner.app/Frameworks/OneSignalExtension.framework/OneSignalExtension' (errno=2), '/private/var/containers/Bundle/Application/F250D454-D344-45FF-B635-C45AFA5B3659/Runner.app/Frameworks/OneSignalExtension.framework/OneSignalExtension' (errno=2), '/System/Library/Frameworks/OneSignalExtension.framework/OneSignalExtension' (errno=2, not in dyld cache)
Library not loaded: @rpath/OneSignalExtension.framework/OneSignalExtension
  Referenced from: <61C646E0-5484-305B-AB3F-AF0BA1884A80> /private/var/containers/Bundle/Application/F250D454-D344-45FF-B635-C45AFA5B3659/Runner.app/Runner
  Reason: tried: '/usr/lib/swift/OneSignalExtension.framework/OneSignalExtension' (errno=2, not in dyld cache), '/private/preboot/Cryptexes/OS/usr/lib/swift/OneSignalExtension.framework/OneSignalExtension' (errno=2), '/usr/lib/swift/OneSignalExtension.framework/OneSignalExtension' (errno=2, not in dyld cache), '/private/preboot/Cryptexes/OS/usr/lib/swift/OneSignalExtension.framework/OneSignalExtension' (errno=2), '/private/var/containers/Bundle/Application/F250D454-D344-45FF-B635-C45AFA5B3659/Runner.app/Frameworks/OneSignalExtension.framework/OneSignalExtension' (errno=2), '/private/var/containers/Bundle/Application/F250D454-D344-45FF-B635-C45AFA5B3659/Runner.app/Frameworks/OneSignalExtension.framework/OneSignalExtension' (errno=2), '/private/var/containers/Bundle/Application/F250D
dyld config: DYLD_LIBRARY_PATH=/usr/lib/system/introspection DYLD_INSERT_LIBRARIES=/usr/lib/libBacktraceRecording.dylib:/usr/lib/libMainThreadChecker.dylib:/usr/lib/libRPAC.dylib:/Developer/Library/PrivateFrameworks/DTDDISupport.framework/libViewDebuggerSupport.dylib
(lldb) 


### Code of Conduct

- [X] I agree to follow this project's Code of Conduct

<!-- probot = {"onesignal-probot":{"response_time_in_business_days":114}} -->
aamirki commented 1 year ago

Possibly a duplicate of #608. I am running into this as well

chrisvidal commented 1 year ago

running into the same weird log during the crash on iOS with 3.4.2

devmuaz commented 1 year ago

@chrisvidal for now, you can use the previous stable version 3.4.1 which works just fine.

chrisvidal commented 1 year ago

@devmuaz same error with the 3.4.1

Exception Type:  EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note:  EXC_CORPSE_NOTIFY
Termination Reason: DYLD 1 Library missing
Library not loaded: @rpath/OneSignalExtension.framework/OneSignalExtension
image
devmuaz commented 1 year ago

@chrisvidal I believe that the version is still the same in the pubspec.lock file, you need to delete it and run:

flutter pub get

If still not working, clear the pub cache by running:

flutter pub cache clean && flutter pub get
chrisvidal commented 1 year ago

starting a blank project with 3.4.1 and see...

emawby commented 1 year ago

Make sure you are using Cocoapods 1.11.3 with ruby 2.7.5 and try the below code. We have seen this issue when using versions lower than 1.11.3 and Ruby 2.6.0, but it gets resolved after upgrading

rm Podfile.lock
pod cache clean --all
pod install --repo-update
glin94 commented 1 year ago

this work for me Go to Project --> Targets --> [Application Name] --> Frameworks, Libraries, and Embedded Content section. Click + icon --> Type OneSignal in the search box --> Select OneSignalCore.xcframework and click Add button. Do the same for OneSignalOutcomes.xcframework. Check Embed and Sign on both.

Clean build folder and build.

Снимок экрана 2022-12-21 в 00 30 33

jodymac commented 1 year ago

I couldn't get anything to work, downgrading, upgrading until I added the groups to info plist(runner and service extension) following the directions of the latest guide. I didn't have that setup.

I added those and I was able to build. Granted I did a ton of pod updates and installs, but it's working now. I also followed the steps before to update ruby and cocoapods.

GusRodrigues86 commented 1 year ago

this work for me Go to Project --> Targets --> [Application Name] --> Frameworks, Libraries, and Embedded Content section. Click + icon --> Type OneSignal in the search box --> Select OneSignalCore.xcframework and click Add button. Do the same for OneSignalOutcomes.xcframework. Check Embed and Sign on both.

Clean build folder and build.

Снимок экрана 2022-12-21 в 00 30 33

That's what worked.

AndreiMisiukevich commented 1 year ago

I am still using onesignal_flutter: 3.4.1 are there any updates on this issue? Thanks!

sv-22 commented 1 year ago

having this issue on my Intel Mac, but on on M1 chip.

sv-22 commented 1 year ago

upgrading ruby and cocoapods as well as using onesignal_flutter: 3.4.1 fixed the issue for my Intel Mac

AlexSmirnov9107 commented 1 year ago

upgrading ruby and cocoapods as well as using onesignal_flutter: 3.4.1 fixed the issue for my Intel Mac

what versions of ruby and cocoapods have you upgraded?

sv-22 commented 1 year ago

upgrading ruby and cocoapods as well as using onesignal_flutter: 3.4.1 fixed the issue for my Intel Mac

what versions of ruby and cocoapods have you upgraded?

The latest - Cocoapods 1.11.3 Ruby 3.2.1

AndreiMisiukevich commented 1 year ago

This is a critical issue blocking library upgrades. Is it possible to prioritize it?

nan-li commented 1 year ago

Hi @AndreiMisiukevich,

Did you try the steps mentioned to resolve?

We were able to reproduce the issue when we used a lower ruby version, and the error resolved after we updated.

Make sure you are using Cocoapods 1.11.3 with ruby 2.7.5 and try the below code. We have seen this issue when using versions lower than 1.11.3 and Ruby 2.6.0, but it gets resolved after upgrading

rm Podfile.lock
pod cache clean --all
pod install --repo-update
AndreiMisiukevich commented 1 year ago

Hi @nan-li, thanks for the response! I haven't tried it yet.

Do you think the steps you shared help with the latest version of OneSignal SDK? I saw this comment https://github.com/OneSignal/OneSignal-Flutter-SDK/issues/613#issuecomment-1433908773 and thought it would help only for version 3.4.1, which works like a charm for me even without any addition steps.

nan-li commented 1 year ago

Hi @AndreiMisiukevich,

I think these steps are good for 3.4.2+. I was able to personally reproduce this issue after I updated my Xcode from 14 to 14.1 and using OneSignal Flutter SDK 3.4.2. My ruby version was also 2.6.8.

Then the problem went away after I update my ruby version to 2.7.5+ and cocoapods to 1.11.3.

AndreiMisiukevich commented 1 year ago

@nan-li thanks for the explanation. Unfortunately, I can't control the ruby version since I am building my application with Codemagic which doesn't provide a way to manage the ruby version (only Pod).

emawby commented 1 year ago

@AndreiMisiukevich Cocoapods released 1.12.1 maybe that updated version will resolve the issue since it has an explicit ruby version requirement >2.7.5