OneSignal-Flutter-SDK icon indicating copy to clipboard operation
OneSignal-Flutter-SDK copied to clipboard

[Critical Bugs] : Build successfully but crash when the app launch in IOS

Open foongef opened this issue 3 years ago • 57 comments
trafficstars

Crash message bellow

dyld`: 0x115836984 <+0>: movl $0x2000209, %eax ; imm = 0x2000209 0x115836989 <+5>: movq %rcx, %r10 0x11583698c <+8>: syscall -> 0x11583698e <+10>: jae 0x115836998 ; <+20> 0x115836990 <+12>: movq %rax, %rdi 0x115836993 <+15>: jmp 0x1157f3150 ; cerror_nocancel 0x115836998 <+20>: retq
0x115836999 <+21>: nop
0x11583699a <+22>: nop
0x11583699b <+23>: nop

Library not loaded: @rpath/OneSignalExtension.framework/OneSignalExtension Referenced from: <0A499F0F-68C1-3D61-8D57-53B11C7D3756> /Users/kewdoo/Library/Developer/CoreSimulator/Devices/365AB081-5EF3-4C65-BB6B-4FEC478755B3/data/Containers/Bundle/Application/4737F99A-A10F-4B21-82D6-3DD1459AC1E0/Runner.app/Runner Reason: tried: '/Users/kewdoo/Library/Developer/Xcode/DerivedData/Runner-bjulrwqqasccntdscszmuvmxtian/Build/Products/Debug-production-iphonesimulator/OneSignalExtension.framework/OneSignalExtension' (errno=2), '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/swift/OneSignalExtension.framework/OneSignalExtension' (errno=2), '/usr/lib/swift/OneSignalExtension.framework/OneSignalExtension' (errno=2, no dyld cache), '/Users/kewdoo/Library/Developer/CoreSimulator/Devices/365AB081-5EF3-4C65-BB6B-4FEC478755B3/data/Containers/Bundle/Application/4737F99A-A10F-4B21-82D6-3DD1459AC1E0/ dyld config: DYLD_SHARED_CACHE_DIR=/Users/kewdoo/Library/Developer/CoreSimulator/Caches/dyld/21G72/com.apple.CoreSimulator.SimRuntime.iOS-16-0.20A360 DYLD_ROOT_PATH=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot DYLD_LIBRARY_PATH=/Users/kewdoo/Library/Developer/Xcode/DerivedData/Runner-bjulrwqqasccntdscszmuvmxtian/Build/Products/Debug-production-iphonesimulator:/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/introspection DYLD_INSERT_LIBRARIES=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libBacktraceRecording.dylib:/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libMainThreadChecker.dylib:/usr/lib/libRPAC.dylib:/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/GPUToolsCapture.framework/GPUToolsCapture:/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/Developer/Library/PrivateFrameworks/DTDDISupport.framework/libViewDebuggerSupport.dylib DYLD_FRAMEWORK_PATH=/Users/kewdoo/Library/Developer/Xcode/DerivedData/Runner-bjulrwqqasccntdscszmuvmxtian/Build/Products/Debug-production-iphonesimulator DYLD_FALLBACK_FRAMEWORK_PATH=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks DYLD_FALLBACK_LIBRARY_PATH=/Applications/Xco

foongef avatar Oct 31 '22 09:10 foongef

@foongef are you using the latest package?

onesignal_flutter: ^3.4.2

I also had the crash wih onesignal_flutter: ^3.4.1, now I am testing it with the latest.

imajercsik avatar Oct 31 '22 11:10 imajercsik

@imajercsik yes i have tried 3.4.2 and 3.4.1. Both version also crashed after built successfully.

foongef avatar Oct 31 '22 11:10 foongef

Same thing for me crashes on 3.4.2

vasilich6107 avatar Oct 31 '22 11:10 vasilich6107

Works fine for 3.4.0

vasilich6107 avatar Oct 31 '22 11:10 vasilich6107

For me it is crashing with 3.4.0, 3.4.1 and 3.4.2.

[✓] Flutter (Channel stable, 3.3.6, on macOS 13.0 22A380 darwin-x64) [✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0) [✓] Xcode - develop for iOS and macOS (Xcode 14.0.1) [✓] Chrome - develop for the web [✓] Android Studio (version 2021.3) [✓] VS Code (version 1.63.2) [✓] Connected device (3 available) [✓] HTTP Host Availability

imajercsik avatar Oct 31 '22 14:10 imajercsik

Same here, but It works fine for me on 3.4.1

[✓] Flutter (Channel stable, 3.3.6, on macOS 13.0 22A380 darwin-arm, locale en-BR) [✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0-rc1) [✓] Xcode - develop for iOS and macOS (Xcode 14.0.1) [✓] Chrome - develop for the web [✓] Android Studio (version 2021.3) [✓] IntelliJ IDEA Community Edition (version 2022.2.3) [✓] VS Code (version 1.72.2) [✓] Connected device (4 available) [✓] HTTP Host Availability

AndreHaueisen avatar Oct 31 '22 16:10 AndreHaueisen

It might be an SDK problem https://github.com/OneSignal/OneSignal-iOS-SDK/issues/1146

AndreHaueisen avatar Oct 31 '22 16:10 AndreHaueisen

3.4.0, 3.4.1, 3.4.2 also crashed. Anyone has the solution?

foongef avatar Oct 31 '22 18:10 foongef

any one found a solution? Am facing the same issue

AbedRabaia avatar Nov 01 '22 10:11 AbedRabaia

same problem here

JefersonCashway avatar Nov 01 '22 10:11 JefersonCashway

same here

walvespit avatar Nov 02 '22 17:11 walvespit

I have the exact same issue! Tested 3.4.1 and 3.4.2

hosaysg avatar Nov 03 '22 08:11 hosaysg

Same issue. Version 3.4.2. Works fine on simulator but not working on a physical device

AndyDavidJoyce avatar Nov 03 '22 15:11 AndyDavidJoyce

Same issue - Library not loaded.

This is critical and stopping the release of new versions of any apps using the library.

Please can someone from the OneSignal team chime in here ASAP?

Thanks.

daveshirman avatar Nov 03 '22 17:11 daveshirman

i'm using onesignal_flutter 3.3.1 and it works...

walvespit avatar Nov 03 '22 17:11 walvespit

Same issue. Version 3.4.2. Works fine on simulator but not working on a physical device

Mine cannot even work on simulator.

hosaysg avatar Nov 03 '22 22:11 hosaysg

Same issue - Library not loaded.

This is critical and stopping the release of new versions of any apps using the library.

Please can someone from the OneSignal team chime in here ASAP?

Thanks.

Contacted them and was told to just refer to the migration guide.

hosaysg avatar Nov 03 '22 22:11 hosaysg

What? That's kinda ridiculous, I don't see anything specific in the migration guide, unless I'm missing something? Link please?

I downgraded to 3.4.1 and it worked fine btw, so it's something to do with 3.4.2 for sure.

daveshirman avatar Nov 03 '22 22:11 daveshirman

What? That's kinda ridiculous, I don't see anything specific in the migration guide, unless I'm missing something? Link please?

I downgraded to 3.4.1 and it worked fine btw, so it's something to do with 3.4.2 for sure.

Oh.. Both 3.4.1 and 3.4.2 don't worker 2.6 and did everything necessary as indicated in the migration guide.

hosaysg avatar Nov 04 '22 06:11 hosaysg

Can you please post a link to the migration guide you're referring here?

On Fri, 4 Nov 2022, 02:38 hosaysg, @.***> wrote:

What? That's kinda ridiculous, I don't see anything specific in the migration guide, unless I'm missing something? Link please?

I downgraded to 3.4.1 and it worked fine btw, so it's something to do with 3.4.2 for sure.

Oh.. Both 3.4.1 and 3.4.2 don't worker 2.6 and did everything necessary as indicated in the migration guide.

— Reply to this email directly, view it on GitHub https://github.com/OneSignal/OneSignal-Flutter-SDK/issues/608#issuecomment-1303035985, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADM6KXVD4E7P4JABIGLBCQ3WGSVNFANCNFSM6AAAAAARS4EXMQ . You are receiving this because you commented.Message ID: @.***>

daveshirman avatar Nov 04 '22 12:11 daveshirman

Hi everyone, thank you for reporting this.

~~Looks like it may be related to our native iOS SDK as the Flutter SDK versions 3.4.0 and 3.4.1 have been released for a while now, and we didn't see reports of this until now. We will investigate and follow up as soon as we can.~~

Update: We are not able to reproduce, may be related to new Xcode/Flutter/Cocoapods versions or podfile setup.

nan-li avatar Nov 04 '22 17:11 nan-li

Hello,

@daveshirman I don't believe there will be any further information that will help in the migration guide.

Can you share your podfile please? Also is the Notification Service Extension crashing, or the app itself?

fhboswell avatar Nov 04 '22 20:11 fhboswell

Hello,

@daveshirman I don't believe there will be any further information that will help in the migration guide.

Can you share your podfile please? Also is the Notification Service Extension crashing, or the app itself?

I still don't know what migration guide you're referring to, please kindly share the link at least.

At my end with 3.4.2: App loads, immediately crashes with the error: Library not loaded. The app compiles and runs fine with 3.4.1 as I mentioned.

My Podfile

# Uncomment this line to define a global platform for your project
platform :ios, '11.0'

# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'

project 'Runner', {
  'Debug' => :debug,
  'Profile' => :release,
  'Release' => :release,
}

def flutter_root
  generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__)
  unless File.exist?(generated_xcode_build_settings_path)
    raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"
  end

  File.foreach(generated_xcode_build_settings_path) do |line|
    matches = line.match(/FLUTTER_ROOT\=(.*)/)
    return matches[1].strip if matches
  end
  raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get"
end

require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)

flutter_ios_podfile_setup

target 'Runner' do
  use_frameworks!
  use_modular_headers!

  flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
end

# post_install do |installer|
#   installer.pods_project.targets.each do |target|
#     flutter_additional_ios_build_settings(target)
#   end
# end

target 'OneSignalNotificationServiceExtension' do
  use_frameworks!
  pod 'OneSignalXCFramework', '>= 3.4.3', '< 4.0'
end

post_install do |installer|
  installer.pods_project.targets.each do |target|
    
    flutter_additional_ios_build_settings(target)

    target.build_configurations.each do |config|

      config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '11.0'
     
      config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= [
        '$(inherited)',
        'PERMISSION_PHOTOS=1',
      ]

    end
  end
end

daveshirman avatar Nov 04 '22 21:11 daveshirman

The same issue with failed loading OneSignalExtension framework. As a dirty workaround, you may link the framework directly to your project by adding it to the linked binaries list of your project (not pods project).

alpono avatar Nov 07 '22 12:11 alpono

Hello there any updates on this matter. I attempted to downgrade, but the problem persisted. anyone came up with a solution.

MeetMighty avatar Nov 08 '22 08:11 MeetMighty

Same here, did not found any solution yet :(. @nan-li do you have an update? Thanks!

imajercsik avatar Nov 08 '22 19:11 imajercsik

same here

larissamagistrali avatar Nov 10 '22 03:11 larissamagistrali

@nan-li Please check crash log file here: crash log.txt

Flutter doctor

Doctor summary (to see all details, run flutter doctor -v): Flutter (Channel stable, 3.3.6, on macOS 12.1 21C52 darwin-x64, locale en-GB) Flutter version 3.3.6 on channel stable at /Users/abc/Documents/flutter [✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3) [✓] Xcode - develop for iOS and macOS (Xcode 13.4.1) [✓] Chrome - develop for the web [✓] Android Studio (version 4.2) [✓] VS Code (version 1.72.2) [✓] Connected device (3 available) [✓] HTTP Host Availability

Already try onesignal_flutter: ^3.3.0 to latest flutter version. All of our projects were halted when this problem appeared. Please supply a solution as soon as possible. If not, we will replace OneSignal with Firebase.

MeetMighty avatar Nov 10 '22 05:11 MeetMighty

This solution work for me. Add dependencies without cap Use this onesignal_flutter: 3.4.1 instead of onesignal_flutter: ^3.4.1

MeetMighty avatar Nov 10 '22 07:11 MeetMighty

MeetMighty, can you share your podfile please?

larissamagistrali avatar Nov 10 '22 11:11 larissamagistrali