Home > Back-end >  Flutter iOS - Cannot archive project via xCode after add Notification Extension Service
Flutter iOS - Cannot archive project via xCode after add Notification Extension Service

Time:11-23

I added Notification Extension Service for push notification image purpose. It can running on read device as expected

but when I tried to archive it, some errors appears, look like the following :

Undefined Symbol : OBJC_CLASS$_FlutterBasicMessageChannel

The error message :

Could not find or use auto-linked framework 'Flutter'

Undefined symbol: _FlutterMethodNotImplemented

Undefined symbol: _OBJC_CLASS_$_FlutterBasicMessageChannel

Undefined symbol: _OBJC_CLASS_$_FlutterError

Undefined symbol: _OBJC_CLASS_$_FlutterMethodChannel

Undefined symbol: _OBJC_CLASS_$_FlutterStandardMessageCodec

Undefined symbol: _OBJC_CLASS_$_FlutterStandardReader

Undefined symbol: _OBJC_CLASS_$_FlutterStandardReaderWriter

Undefined symbol: _OBJC_CLASS_$_FlutterStandardTypedData

Undefined symbol: _OBJC_CLASS_$_FlutterStandardWriter

Undefined symbol: _OBJC_METACLASS_$_FlutterStandardReader

Undefined symbol: _OBJC_METACLASS_$_FlutterStandardReaderWriter

Undefined symbol: _OBJC_METACLASS_$_FlutterStandardWriter

I have tried some solutions that provided on internet like :

1. TargetSettings -> Build Phases -> Compile Sources -> add your .m class  ->Build and Run
2. Set development target of extension must equal to runner's development target
3. Clean and build folder for severals time, but still doesn't work

Those solutions above have no good result, still face the errors.

Just info, I got this after update to XCode 14 and add Notification Extension Services

If there's any solution that I have to try, please let me know, I appreciate it very much.

Thank you

CodePudding user response:

Please be sure that the extension does have the release variation build.

I faced this problem because I was running an "archive," the "Release" build variation is used, but the extension does not have this build variation. How can you add the release build variation to the extension? I continue creating when I add a new extension without using this build variation and the problem solved.

CodePudding user response:

After tried everything that possible, finally I able to solved my problem. The last thing that I tried was :

Change Project Runner Configuration for Release to NONE

Configuration for Runner

But, maybe this is not the final way to solve the similar problem. If above solutions don't work, the please try this solutions as well :

  1. TargetSettings -> Build Phases -> Compile Sources -> add your .m class ->Build and Run
  2. Set development target of extension must equal to runner's development target
  3. Target -> Runner -> Build Phases, scroll down and find Compile Resource -> Add your .m file
  4. Clean and build folder for severals time,

but don't forget to do Pod Update everytime you edit xcode component ( just to re-ensure everything is work )

I hope this solution can help other member who face the same issue.

Info, the issue come when i use this :

  • xCode 14
  • Notification service Extension
  • Related