Troubleshooting Flutter

Common setup issues with Flutter

📘

Troubleshooting Steps

Check this page first for common issues based on Flutter Setup.

For Android and/or iOS Platform issues see:

Try the example project on our Github repository.

If stuck, contact support directly or email support@onesignal.com for help.

For faster assistance, please provide:

  • Your OneSignal App Id
  • Details, logs, and/or screenshots of the issue.
  • Steps to reproduce

PBXGroup Error

You may see this error when building with Xcode 16.

RuntimeError - PBXGroup attempted to initialize an object with unknown ISA PBXFileSystemSynchronizedRootGroup from attributes: {"isa"=>"...", "exceptions"=>["//", "..."], "explicitFileTypes"=>{}, "explicitFolders"=>[], "path"=>"OneSignalNotificationServiceExtension", "sourceTree"=>"<group>"}

Check the error for the folder name under "path"

Then in your project, open your XCWorkspace folder in Xcode and open the project directory in the left sidebar.

From here, you should see the folders corresponding with the the targets you have available on this project. You should find folder that matches the "path" in the error you've received. Update the folder to "Convert to Group".

Cycle Inside Error

You may see this error when building with Xcode 15 or higher, which is caused by a Xcode 15+ default configuration change affecting cross platform systems.

Error: Cycle inside SampleProject; building could produce unreliable results.

In your project, open your XCWorkspace folder in Xcode and open the project directory in the left sidebar.

Select your app target and navigate to the "Build Phases" tab. You should have a phase called "Embed App Extensions" or "Embed Foundation Extensions". Drag and move this build phase to above "Run Script". Your error should now be resolved.

If that does not fix the error, you may need to un-check "Copy only when installing". This option can be found when you expand the build phase that you just moved.



Problems with OneSignal library at build time

If you are experiencing any type of issue related to the OneSignal library when building iOS, e.g:

ld: warning: directory not found for option '-L/example/build/ios/Debug-iphonesimulator/onesignal'
    ld: library not found for -lonesignal
    clang: error: linker command failed with exit code 1 (use -v to see invocation)

Could not build the application for the simulator.
Error launching application on iPhone 6.

Try following the following commands:

pod deintegrate
pod install

Distribution Error: Found an unexpected Mach-O header code

Both of the following solutions have been reported to work:

Solution 1

1 . Go to Runner and then to Build Settings and set Always Embed Swift Standard Libraries to YES
2 . Then go to OneSignalNotificationServiceExtension and then to Build Settings and set Always Embed Swift Standard Libraries to NO

Solution 2

  1. Set config.build_settings['ENABLE_BITCODE'] = 'YES' in your Podfile.
  2. Set all ENABLE_BITCODE = 'YES' in the Runner project
  3. Set the importance of ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = 'NO' in the Runner app.

iOS Release Build "Missing Push Capability"

First check the Flutter SDK Setup that you added Push Capability in Xcode.

If you are still having this issue, check Xcode for CODE_SIGNING_ALLOWED which might be set incorrectly not allowing signing of your app.

Using Firebase auth

We've had reports of Firebase SDK & OneSignal SDK causing IOS push notification clicks to crash or not foregrounding the mobile app.

If you are integrating both Firebase auth and OneSignal in your Flutter IOS mobile app and encountering this issue:
[FirebaseCore][I-COR000012] Could not locate configuration file: 'GoogleService-Info.plist'.

This means that your GoogleService-Info.plist is not registered in the .xcworkspace file. This will cause IOS push notification clicks to crash or not foregrounding your mobile app.

In your Xcode, right-click on the Runner-folder, choose Add Files to "Runner"..., and select the GoogleService-Info.plist file. This should resolve this issue.

See this github issue for more details. Nov 17, 2024