Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when build ios app with Flutter 2.0.6 and null safety #389

Closed
rovkinmax opened this issue May 4, 2021 · 27 comments
Closed

Error when build ios app with Flutter 2.0.6 and null safety #389

rovkinmax opened this issue May 4, 2021 · 27 comments

Comments

@rovkinmax
Copy link

rovkinmax commented May 4, 2021

Description:
After migrating to null-safety and flutter 2 I get problem with ios build:
I run flutter clean; rm ios/Podfile.lock pubspec.lock; rm -rf ios/Pods ios/Runner.xcworkspace; flutter run --flavor dev -t lib/main_dev.dart

Environment

onesignal_flutter: ^3.0.0-beta2
firebase_crashlytics: ^2.0.2
firebase_core: ^1.1.0
google_maps_flutter: ^2.0.3
flutter doctor --verbose
[✓] Flutter (Channel stable, 2.0.6, on macOS 11.1 20C69 darwin-x64, locale ru-RU)
    • Flutter version 2.0.6 at /Users/my_user/Library/flutter
    • Framework revision 1d9032c7e1 (3 дня назад), 2021-04-29 17:37:58 -0700
    • Engine revision 05e680e202
    • Dart version 2.12.3

[!] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    • Android SDK at /Users/my_user/Library/Android/sdk
    • Platform android-30, build-tools 30.0.3
    • ANDROID_HOME = /Users/my_user/Library/Android/sdk
    • Java binary at: /Applications/Android Studio 4.2 Preview.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.8+10-b944.6916264)
    ✗ Android license status unknown.
      Run `flutter doctor --android-licenses` to accept the SDK licenses.
      See https://flutter.dev/docs/get-started/install/macos#android-setup for more details.

[✓] Xcode - develop for iOS and macOS
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 12.5, Build version 12E262
    • CocoaPods version 1.10.1

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 4.2)
    • Android Studio at /Applications/Android Studio 4.2 Preview.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.8+10-b944.6916264)

[✓] Connected device (2 available)

! Doctor found issues in 1 category.

Steps to Reproduce Issue:

  1. Create project with custom configurations(prod and dev in my case) with the Flutter 2.0.6.
  2. Install OneSignal with the official tutorial
  3. Try run and get the error

Anything else:
Also I found this issue but I don't understand solution from it
#374

Logcat output

Cleaning Xcode workspace...                                         9,8s
Deleting build...                                                   60ms
Deleting .dart_tool...                                               0ms
Deleting .packages...                                                0ms
Deleting Generated.xcconfig...                                       0ms
Deleting flutter_export_environment.sh...                            0ms
Deleting Flutter.podspec...                                          0ms
Deleting .flutter-plugins-dependencies...                            0ms
Deleting .flutter-plugins...                                         0ms
Running "flutter pub get" in my_app...                          3,3s
Launching lib/main_dev.dart on iPhone (Maxim) in debug mode...
Automatically signing iOS for device deployment using specified development team in Xcode project: <TEAM_ID>
Running pod install...                                              5,1s
Running Xcode build...                                                 ⣽
Xcode build done.                                           31,0s
Failed to build iOS app
Error output from Xcode build:
↳
    ** BUILD FAILED **


Xcode's output:
↳
    6 warnings generated.
    6 warnings generated.
    6 warnings generated.
    6 warnings generated.
    While building module 'OneSignal' imported from /Users/my_user/Library/flutter/.pub-cache/hosted/pub.dartlang.org/onesignal_flutter-3.0.0-beta3/ios/Classes/OSFlutterInAppMessagesController.m:29:
    In file included from <module-includes>:1:
    /Users/my_user/dev/flutter/my_app/ios/Pods/OneSignal/iOS_SDK/OneSignalSDK/Framework/OneSignal.framework/Headers/OneSignal.h:491:4: warning: 'UNMutableNotificationContent' is only available on iOS 10.0 or newer [-Wunguarded-availability]
    + (UNMutableNotificationContent*)didReceiveNotificationExtensionRequest:(UNNotificationRequest* _Nonnull)request withMutableNotificationContent:(UNMutableNotificationContent* _Nullable)replacementContent;
       ^
    In module 'UserNotifications' imported from /Users/my_user/dev/flutter/my_app/ios/Pods/OneSignal/iOS_SDK/OneSignalSDK/Framework/OneSignal.framework/Headers/OneSignal.h:45:
    /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS14.5.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UNNotificationContent.h:63:12: note: 'UNMutableNotificationContent' has been marked as being
    introduced in iOS 10.0 here, but the deployment target is iOS 9.0.0
    @interface UNMutableNotificationContent : UNNotificationContent
               ^
    While building module 'OneSignal' imported from /Users/my_user/Library/flutter/.pub-cache/hosted/pub.dartlang.org/onesignal_flutter-3.0.0-beta3/ios/Classes/OSFlutterInAppMessagesController.m:29:
    In file included from <module-includes>:1:
    /Users/my_user/dev/flutter/my_app/ios/Pods/OneSignal/iOS_SDK/OneSignalSDK/Framework/OneSignal.framework/Headers/OneSignal.h:491:1: note: annotate 'didReceiveNotificationExtensionRequest:withMutableNotificationContent:' with an availability attribute to
    silence this warning
    + (UNMutableNotificationContent*)didReceiveNotificationExtensionRequest:(UNNotificationRequest* _Nonnull)request withMutableNotificationContent:(UNMutableNotificationContent* _Nullable)replacementContent;
    ^
                                                                                                                                                                                                                API_AVAILABLE(ios(10.0))
    /Users/my_user/dev/flutter/my_app/ios/Pods/OneSignal/iOS_SDK/OneSignalSDK/Framework/OneSignal.framework/Headers/OneSignal.h:491:74: warning: 'UNNotificationRequest' is only available on iOS 10.0 or newer [-Wunguarded-availability]
    + (UNMutableNotificationContent*)didReceiveNotificationExtensionRequest:(UNNotificationRequest* _Nonnull)request withMutableNotificationContent:(UNMutableNotificationContent* _Nullable)replacementContent;
                                                                             ^
    In module 'UserNotifications' imported from /Users/my_user/dev/flutter/my_app/ios/Pods/OneSignal/iOS_SDK/OneSignalSDK/Framework/OneSignal.framework/Headers/OneSignal.h:45:
    /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS14.5.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UNNotificationRequest.h:16:12: note: 'UNNotificationRequest' has been marked as being introduced
    in iOS 10.0 here, but the deployment target is iOS 9.0.0
    @interface UNNotificationRequest : NSObject <NSCopying, NSSecureCoding>
               ^
    While building module 'OneSignal' imported from /Users/my_user/Library/flutter/.pub-cache/hosted/pub.dartlang.org/onesignal_flutter-3.0.0-beta3/ios/Classes/OSFlutterInAppMessagesController.m:29:
    In file included from <module-includes>:1:
    /Users/my_user/dev/flutter/my_app/ios/Pods/OneSignal/iOS_SDK/OneSignalSDK/Framework/OneSignal.framework/Headers/OneSignal.h:491:1: note: annotate 'didReceiveNotificationExtensionRequest:withMutableNotificationContent:' with an availability attribute to
    silence this warning
    + (UNMutableNotificationContent*)didReceiveNotificationExtensionRequest:(UNNotificationRequest* _Nonnull)request withMutableNotificationContent:(UNMutableNotificationContent* _Nullable)replacementContent;
    ^
                                                                                                                                                                                                                API_AVAILABLE(ios(10.0))
    /Users/my_user/dev/flutter/my_app/ios/Pods/OneSignal/iOS_SDK/OneSignalSDK/Framework/OneSignal.framework/Headers/OneSignal.h:491:146: warning: 'UNMutableNotificationContent' is only available on iOS 10.0 or newer [-Wunguarded-availability]
    + (UNMutableNotificationContent*)didReceiveNotificationExtensionRequest:(UNNotificationRequest* _Nonnull)request withMutableNotificationContent:(UNMutableNotificationContent* _Nullable)replacementContent;
                                                                                                                                                     ^
    In module 'UserNotifications' imported from /Users/my_user/dev/flutter/my_app/ios/Pods/OneSignal/iOS_SDK/OneSignalSDK/Framework/OneSignal.framework/Headers/OneSignal.h:45:
    /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS14.5.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UNNotificationContent.h:63:12: note: 'UNMutableNotificationContent' has been marked as being
    introduced in iOS 10.0 here, but the deployment target is iOS 9.0.0
    @interface UNMutableNotificationContent : UNNotificationContent
               ^
    While building module 'OneSignal' imported from /Users/my_user/Library/flutter/.pub-cache/hosted/pub.dartlang.org/onesignal_flutter-3.0.0-beta3/ios/Classes/OSFlutterInAppMessagesController.m:29:
    In file included from <module-includes>:1:
    /Users/my_user/dev/flutter/my_app/ios/Pods/OneSignal/iOS_SDK/OneSignalSDK/Framework/OneSignal.framework/Headers/OneSignal.h:491:1: note: annotate 'didReceiveNotificationExtensionRequest:withMutableNotificationContent:' with an availability attribute to
    silence this warning
    + (UNMutableNotificationContent*)didReceiveNotificationExtensionRequest:(UNNotificationRequest* _Nonnull)request withMutableNotificationContent:(UNMutableNotificationContent* _Nullable)replacementContent;
    ^
                                                                                                                                                                                                                API_AVAILABLE(ios(10.0))
    /Users/my_user/dev/flutter/my_app/ios/Pods/OneSignal/iOS_SDK/OneSignalSDK/Framework/OneSignal.framework/Headers/OneSignal.h:492:4: warning: 'UNMutableNotificationContent' is only available on iOS 10.0 or newer [-Wunguarded-availability]
    + (UNMutableNotificationContent*)serviceExtensionTimeWillExpireRequest:(UNNotificationRequest* _Nonnull)request withMutableNotificationContent:(UNMutableNotificationContent* _Nullable)replacementContent;
       ^
    In module 'UserNotifications' imported from /Users/my_user/dev/flutter/my_app/ios/Pods/OneSignal/iOS_SDK/OneSignalSDK/Framework/OneSignal.framework/Headers/OneSignal.h:45:
    /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS14.5.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UNNotificationContent.h:63:12: note: 'UNMutableNotificationContent' has been marked as being
    introduced in iOS 10.0 here, but the deployment target is iOS 9.0.0
    @interface UNMutableNotificationContent : UNNotificationContent
               ^
    While building module 'OneSignal' imported from /Users/my_user/Library/flutter/.pub-cache/hosted/pub.dartlang.org/onesignal_flutter-3.0.0-beta3/ios/Classes/OSFlutterInAppMessagesController.m:29:
    In file included from <module-includes>:1:
    /Users/my_user/dev/flutter/my_app/ios/Pods/OneSignal/iOS_SDK/OneSignalSDK/Framework/OneSignal.framework/Headers/OneSignal.h:492:1: note: annotate 'serviceExtensionTimeWillExpireRequest:withMutableNotificationContent:' with an availability attribute to
    silence this warning
    + (UNMutableNotificationContent*)serviceExtensionTimeWillExpireRequest:(UNNotificationRequest* _Nonnull)request withMutableNotificationContent:(UNMutableNotificationContent* _Nullable)replacementContent;
    ^
                                                                                                                                                                                                               API_AVAILABLE(ios(10.0))
    /Users/my_user/dev/flutter/my_app/ios/Pods/OneSignal/iOS_SDK/OneSignalSDK/Framework/OneSignal.framework/Headers/OneSignal.h:492:73: warning: 'UNNotificationRequest' is only available on iOS 10.0 or newer [-Wunguarded-availability]
    + (UNMutableNotificationContent*)serviceExtensionTimeWillExpireRequest:(UNNotificationRequest* _Nonnull)request withMutableNotificationContent:(UNMutableNotificationContent* _Nullable)replacementContent;
                                                                            ^
    In module 'UserNotifications' imported from /Users/my_user/dev/flutter/my_app/ios/Pods/OneSignal/iOS_SDK/OneSignalSDK/Framework/OneSignal.framework/Headers/OneSignal.h:45:
    /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS14.5.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UNNotificationRequest.h:16:12: note: 'UNNotificationRequest' has been marked as being introduced
    in iOS 10.0 here, but the deployment target is iOS 9.0.0
    @interface UNNotificationRequest : NSObject <NSCopying, NSSecureCoding>
               ^
    While building module 'OneSignal' imported from /Users/my_user/Library/flutter/.pub-cache/hosted/pub.dartlang.org/onesignal_flutter-3.0.0-beta3/ios/Classes/OSFlutterInAppMessagesController.m:29:
    In file included from <module-includes>:1:
    /Users/my_user/dev/flutter/my_app/ios/Pods/OneSignal/iOS_SDK/OneSignalSDK/Framework/OneSignal.framework/Headers/OneSignal.h:492:1: note: annotate 'serviceExtensionTimeWillExpireRequest:withMutableNotificationContent:' with an availability attribute to
    silence this warning
    + (UNMutableNotificationContent*)serviceExtensionTimeWillExpireRequest:(UNNotificationRequest* _Nonnull)request withMutableNotificationContent:(UNMutableNotificationContent* _Nullable)replacementContent;
    ^
                                                                                                                                                                                                               API_AVAILABLE(ios(10.0))
    /Users/my_user/dev/flutter/my_app/ios/Pods/OneSignal/iOS_SDK/OneSignalSDK/Framework/OneSignal.framework/Headers/OneSignal.h:492:145: warning: 'UNMutableNotificationContent' is only available on iOS 10.0 or newer [-Wunguarded-availability]
    + (UNMutableNotificationContent*)serviceExtensionTimeWillExpireRequest:(UNNotificationRequest* _Nonnull)request withMutableNotificationContent:(UNMutableNotificationContent* _Nullable)replacementContent;
                                                                                                                                                    ^
    In module 'UserNotifications' imported from /Users/my_user/dev/flutter/my_app/ios/Pods/OneSignal/iOS_SDK/OneSignalSDK/Framework/OneSignal.framework/Headers/OneSignal.h:45:
    /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS14.5.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UNNotificationContent.h:63:12: note: 'UNMutableNotificationContent' has been marked as being
    introduced in iOS 10.0 here, but the deployment target is iOS 9.0.0
    @interface UNMutableNotificationContent : UNNotificationContent
               ^
    While building module 'OneSignal' imported from /Users/my_user/Library/flutter/.pub-cache/hosted/pub.dartlang.org/onesignal_flutter-3.0.0-beta3/ios/Classes/OSFlutterInAppMessagesController.m:29:
    In file included from <module-includes>:1:
    /Users/my_user/dev/flutter/my_app/ios/Pods/OneSignal/iOS_SDK/OneSignalSDK/Framework/OneSignal.framework/Headers/OneSignal.h:492:1: note: annotate 'serviceExtensionTimeWillExpireRequest:withMutableNotificationContent:' with an availability attribute to
    silence this warning
    + (UNMutableNotificationContent*)serviceExtensionTimeWillExpireRequest:(UNNotificationRequest* _Nonnull)request withMutableNotificationContent:(UNMutableNotificationContent* _Nullable)replacementContent;
    ^
                                                                                                                                                                                                               API_AVAILABLE(ios(10.0))
    6 warnings generated.
    6 warnings generated.
    While building module 'OneSignal' imported from /Users/my_user/Library/flutter/.pub-cache/hosted/pub.dartlang.org/onesignal_flutter-3.0.0-beta3/ios/Classes/OSFlutterCategories.h:28:
    In file included from <module-includes>:1:
    /Users/my_user/dev/flutter/my_app/ios/Pods/OneSignal/iOS_SDK/OneSignalSDK/Framework/OneSignal.framework/Headers/OneSignal.h:491:4: warning: 'UNMutableNotificationContent' is only available on iOS 10.0 or newer [-Wunguarded-availability]
    + (UNMutableNotificationContent*)didReceiveNotificationExtensionRequest:(UNNotificationRequest* _Nonnull)request withMutableNotificationContent:(UNMutableNotificationContent* _Nullable)replacementContent;
       ^
    In module 'UserNotifications' imported from /Users/my_user/dev/flutter/my_app/ios/Pods/OneSignal/iOS_SDK/OneSignalSDK/Framework/OneSignal.framework/Headers/OneSignal.h:45:
    /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS14.5.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UNNotificationContent.h:63:12: note: 'UNMutableNotificationContent' has been marked as being
    introduced in iOS 10.0 here, but the deployment target is iOS 9.0.0
    @interface UNMutableNotificationContent : UNNotificationContent
               ^
    While building module 'OneSignal' imported from /Users/my_user/Library/flutter/.pub-cache/hosted/pub.dartlang.org/onesignal_flutter-3.0.0-beta3/ios/Classes/OSFlutterCategories.h:28:
    In file included from <module-includes>:1:
    /Users/my_user/dev/flutter/my_app/ios/Pods/OneSignal/iOS_SDK/OneSignalSDK/Framework/OneSignal.framework/Headers/OneSignal.h:491:1: note: annotate 'didReceiveNotificationExtensionRequest:withMutableNotificationContent:' with an availability attribute to
    silence this warning
    + (UNMutableNotificationContent*)didReceiveNotificationExtensionRequest:(UNNotificationRequest* _Nonnull)request withMutableNotificationContent:(UNMutableNotificationContent* _Nullable)replacementContent;
    ^
                                                                                                                                                                                                                API_AVAILABLE(ios(10.0))
    /Users/my_user/dev/flutter/my_app/ios/Pods/OneSignal/iOS_SDK/OneSignalSDK/Framework/OneSignal.framework/Headers/OneSignal.h:491:74: warning: 'UNNotificationRequest' is only available on iOS 10.0 or newer [-Wunguarded-availability]
    + (UNMutableNotificationContent*)didReceiveNotificationExtensionRequest:(UNNotificationRequest* _Nonnull)request withMutableNotificationContent:(UNMutableNotificationContent* _Nullable)replacementContent;
                                                                             ^
    In module 'UserNotifications' imported from /Users/my_user/dev/flutter/my_app/ios/Pods/OneSignal/iOS_SDK/OneSignalSDK/Framework/OneSignal.framework/Headers/OneSignal.h:45:
    /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS14.5.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UNNotificationRequest.h:16:12: note: 'UNNotificationRequest' has been marked as being introduced
    in iOS 10.0 here, but the deployment target is iOS 9.0.0
    @interface UNNotificationRequest : NSObject <NSCopying, NSSecureCoding>
               ^
    While building module 'OneSignal' imported from /Users/my_user/Library/flutter/.pub-cache/hosted/pub.dartlang.org/onesignal_flutter-3.0.0-beta3/ios/Classes/OSFlutterCategories.h:28:
    In file included from <module-includes>:1:
    /Users/my_user/dev/flutter/my_app/ios/Pods/OneSignal/iOS_SDK/OneSignalSDK/Framework/OneSignal.framework/Headers/OneSignal.h:491:1: note: annotate 'didReceiveNotificationExtensionRequest:withMutableNotificationContent:' with an availability attribute to
    silence this warning
    + (UNMutableNotificationContent*)didReceiveNotificationExtensionRequest:(UNNotificationRequest* _Nonnull)request withMutableNotificationContent:(UNMutableNotificationContent* _Nullable)replacementContent;
    ^
                                                                                                                                                                                                                API_AVAILABLE(ios(10.0))
    /Users/my_user/dev/flutter/my_app/ios/Pods/OneSignal/iOS_SDK/OneSignalSDK/Framework/OneSignal.framework/Headers/OneSignal.h:491:146: warning: 'UNMutableNotificationContent' is only available on iOS 10.0 or newer [-Wunguarded-availability]
    + (UNMutableNotificationContent*)didReceiveNotificationExtensionRequest:(UNNotificationRequest* _Nonnull)request withMutableNotificationContent:(UNMutableNotificationContent* _Nullable)replacementContent;
                                                                                                                                                     ^
    In module 'UserNotifications' imported from /Users/my_user/dev/flutter/my_app/ios/Pods/OneSignal/iOS_SDK/OneSignalSDK/Framework/OneSignal.framework/Headers/OneSignal.h:45:
    /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS14.5.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UNNotificationContent.h:63:12: note: 'UNMutableNotificationContent' has been marked as being
    introduced in iOS 10.0 here, but the deployment target is iOS 9.0.0
    @interface UNMutableNotificationContent : UNNotificationContent
               ^
    While building module 'OneSignal' imported from /Users/my_user/Library/flutter/.pub-cache/hosted/pub.dartlang.org/onesignal_flutter-3.0.0-beta3/ios/Classes/OSFlutterCategories.h:28:
    In file included from <module-includes>:1:
    /Users/my_user/dev/flutter/my_app/ios/Pods/OneSignal/iOS_SDK/OneSignalSDK/Framework/OneSignal.framework/Headers/OneSignal.h:491:1: note: annotate 'didReceiveNotificationExtensionRequest:withMutableNotificationContent:' with an availability attribute to
    silence this warning
    + (UNMutableNotificationContent*)didReceiveNotificationExtensionRequest:(UNNotificationRequest* _Nonnull)request withMutableNotificationContent:(UNMutableNotificationContent* _Nullable)replacementContent;
    ^
                                                                                                                                                                                                                API_AVAILABLE(ios(10.0))
    /Users/my_user/dev/flutter/my_app/ios/Pods/OneSignal/iOS_SDK/OneSignalSDK/Framework/OneSignal.framework/Headers/OneSignal.h:492:4: warning: 'UNMutableNotificationContent' is only available on iOS 10.0 or newer [-Wunguarded-availability]
    + (UNMutableNotificationContent*)serviceExtensionTimeWillExpireRequest:(UNNotificationRequest* _Nonnull)request withMutableNotificationContent:(UNMutableNotificationContent* _Nullable)replacementContent;
       ^
    In module 'UserNotifications' imported from /Users/my_user/dev/flutter/my_app/ios/Pods/OneSignal/iOS_SDK/OneSignalSDK/Framework/OneSignal.framework/Headers/OneSignal.h:45:
    /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS14.5.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UNNotificationContent.h:63:12: note: 'UNMutableNotificationContent' has been marked as being
    introduced in iOS 10.0 here, but the deployment target is iOS 9.0.0
    @interface UNMutableNotificationContent : UNNotificationContent
               ^
    While building module 'OneSignal' imported from /Users/my_user/Library/flutter/.pub-cache/hosted/pub.dartlang.org/onesignal_flutter-3.0.0-beta3/ios/Classes/OSFlutterCategories.h:28:
    In file included from <module-includes>:1:
    /Users/my_user/dev/flutter/my_app/ios/Pods/OneSignal/iOS_SDK/OneSignalSDK/Framework/OneSignal.framework/Headers/OneSignal.h:492:1: note: annotate 'serviceExtensionTimeWillExpireRequest:withMutableNotificationContent:' with an availability attribute to
    silence this warning
    + (UNMutableNotificationContent*)serviceExtensionTimeWillExpireRequest:(UNNotificationRequest* _Nonnull)request withMutableNotificationContent:(UNMutableNotificationContent* _Nullable)replacementContent;
    ^
                                                                                                                                                                                                               API_AVAILABLE(ios(10.0))
    /Users/my_user/dev/flutter/my_app/ios/Pods/OneSignal/iOS_SDK/OneSignalSDK/Framework/OneSignal.framework/Headers/OneSignal.h:492:73: warning: 'UNNotificationRequest' is only available on iOS 10.0 or newer [-Wunguarded-availability]
    + (UNMutableNotificationContent*)serviceExtensionTimeWillExpireRequest:(UNNotificationRequest* _Nonnull)request withMutableNotificationContent:(UNMutableNotificationContent* _Nullable)replacementContent;
                                                                            ^
    In module 'UserNotifications' imported from /Users/my_user/dev/flutter/my_app/ios/Pods/OneSignal/iOS_SDK/OneSignalSDK/Framework/OneSignal.framework/Headers/OneSignal.h:45:
    /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS14.5.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UNNotificationRequest.h:16:12: note: 'UNNotificationRequest' has been marked as being introduced
    in iOS 10.0 here, but the deployment target is iOS 9.0.0
    @interface UNNotificationRequest : NSObject <NSCopying, NSSecureCoding>
               ^
    While building module 'OneSignal' imported from /Users/my_user/Library/flutter/.pub-cache/hosted/pub.dartlang.org/onesignal_flutter-3.0.0-beta3/ios/Classes/OSFlutterCategories.h:28:
    In file included from <module-includes>:1:
    /Users/my_user/dev/flutter/my_app/ios/Pods/OneSignal/iOS_SDK/OneSignalSDK/Framework/OneSignal.framework/Headers/OneSignal.h:492:1: note: annotate 'serviceExtensionTimeWillExpireRequest:withMutableNotificationContent:' with an availability attribute to
    silence this warning
    + (UNMutableNotificationContent*)serviceExtensionTimeWillExpireRequest:(UNNotificationRequest* _Nonnull)request withMutableNotificationContent:(UNMutableNotificationContent* _Nullable)replacementContent;
    ^
                                                                                                                                                                                                               API_AVAILABLE(ios(10.0))
    /Users/my_user/dev/flutter/my_app/ios/Pods/OneSignal/iOS_SDK/OneSignalSDK/Framework/OneSignal.framework/Headers/OneSignal.h:492:145: warning: 'UNMutableNotificationContent' is only available on iOS 10.0 or newer [-Wunguarded-availability]
    + (UNMutableNotificationContent*)serviceExtensionTimeWillExpireRequest:(UNNotificationRequest* _Nonnull)request withMutableNotificationContent:(UNMutableNotificationContent* _Nullable)replacementContent;
                                                                                                                                                    ^
    In module 'UserNotifications' imported from /Users/my_user/dev/flutter/my_app/ios/Pods/OneSignal/iOS_SDK/OneSignalSDK/Framework/OneSignal.framework/Headers/OneSignal.h:45:
    /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS14.5.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UNNotificationContent.h:63:12: note: 'UNMutableNotificationContent' has been marked as being
    introduced in iOS 10.0 here, but the deployment target is iOS 9.0.0
    @interface UNMutableNotificationContent : UNNotificationContent
               ^
    While building module 'OneSignal' imported from /Users/my_user/Library/flutter/.pub-cache/hosted/pub.dartlang.org/onesignal_flutter-3.0.0-beta3/ios/Classes/OSFlutterCategories.h:28:
    In file included from <module-includes>:1:
    /Users/my_user/dev/flutter/my_app/ios/Pods/OneSignal/iOS_SDK/OneSignalSDK/Framework/OneSignal.framework/Headers/OneSignal.h:492:1: note: annotate 'serviceExtensionTimeWillExpireRequest:withMutableNotificationContent:' with an availability attribute to
    silence this warning
    + (UNMutableNotificationContent*)serviceExtensionTimeWillExpireRequest:(UNNotificationRequest* _Nonnull)request withMutableNotificationContent:(UNMutableNotificationContent* _Nullable)replacementContent;
    ^
                                                                                                                                                                                                               API_AVAILABLE(ios(10.0))
    6 warnings generated.
    6 warnings generated.
    /Users/my_user/Library/flutter/.pub-cache/hosted/pub.dartlang.org/geolocator-7.0.3/ios/Classes/GeolocatorPlugin.m:199:11: warning: 'openURL:' is deprecated: first deprecated in iOS 10.0 [-Wdeprecated-declarations]
              openURL:[NSURL URLWithString:UIApplicationOpenSettingsURLString]];
              ^~~~~~~
              openURL:options:completionHandler:
    In module 'UIKit' imported from /Users/my_user/dev/flutter/my_app/ios/Pods/Target Support Files/geolocator/geolocator-prefix.pch:2:
    /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS14.5.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIApplication.h:123:1: note: 'openURL:' has been explicitly marked deprecated here
    - (BOOL)openURL:(NSURL*)url API_DEPRECATED_WITH_REPLACEMENT("openURL:options:completionHandler:", ios(2.0, 10.0)) NS_EXTENSION_UNAVAILABLE_IOS("");
    ^
    1 warning generated.
    /Users/my_user/dev/flutter/my_app/ios/Pods/DKPhotoGallery/DKPhotoGallery/DKPhotoGalleryContentVC.swift:39:52: warning: using 'class' keyword for protocol inheritance is deprecated; use 'AnyObject' instead
    internal protocol DKPhotoGalleryContentDataSource: class {
                                                       ^~~~~
                                                       AnyObject
    /Users/my_user/dev/flutter/my_app/ios/Pods/DKPhotoGallery/DKPhotoGallery/DKPhotoGalleryContentVC.swift:55:50: warning: using 'class' keyword for protocol inheritance is deprecated; use 'AnyObject' instead
    internal protocol DKPhotoGalleryContentDelegate: class {
                                                     ^~~~~
                                                     AnyObject
    /Users/my_user/Library/flutter/.pub-cache/hosted/pub.dartlang.org/file_picker-3.0.1/ios/Classes/FilePickerPlugin.m:225:68: warning: implicit conversion from enumeration type 'enum UIImagePickerControllerImageURLExportPreset' to different enumeration type
    'enum DKImageExportPresent' [-Wenum-conversion]
            exportConfiguration.imageExportPreset = allowCompression ? UIImagePickerControllerImageURLExportPresetCompatible : UIImagePickerControllerImageURLExportPresetCurrent;
                                                  ~                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /Users/my_user/Library/flutter/.pub-cache/hosted/pub.dartlang.org/file_picker-3.0.1/ios/Classes/FilePickerPlugin.m:225:124: warning: implicit conversion from enumeration type 'enum UIImagePickerControllerImageURLExportPreset' to different enumeration type
    'enum DKImageExportPresent' [-Wenum-conversion]
            exportConfiguration.imageExportPreset = allowCompression ? UIImagePickerControllerImageURLExportPresetCompatible : UIImagePickerControllerImageURLExportPresetCurrent;
                                                  ~                                                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /Users/my_user/Library/flutter/.pub-cache/hosted/pub.dartlang.org/file_picker-3.0.1/ios/Classes/FilePickerPlugin.m:300:1: warning: implementing deprecated method [-Wdeprecated-implementations]
    - (void)documentPicker:(UIDocumentPickerViewController *)controller didPickDocumentAtURL:(NSURL *)url{
    ^
    In module 'UIKit' imported from /Users/my_user/dev/flutter/my_app/ios/Pods/Target Support Files/file_picker/file_picker-prefix.pch:2:
    /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS14.5.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIDocumentPickerViewController.h:26:1: note: method 'documentPicker:didPickDocumentAtURL:' declared here
    - (void)documentPicker:(UIDocumentPickerViewController *)controller didPickDocumentAtURL:(NSURL *)url API_DEPRECATED_WITH_REPLACEMENT("documentPicker:didPickDocumentsAtURLs:", ios(8.0, 11.0));
    ^
    3 warnings generated.
    /Users/my_user/Library/flutter/.pub-cache/hosted/pub.dartlang.org/file_picker-3.0.1/ios/Classes/FileUtils.m:129:30: warning: unused variable 'exportError' [-Wunused-variable]
                        NSError *exportError = exporter.error;
                                 ^
    1 warning generated.
    ld: warning: linking against a dylib which is not safe for use in application extensions: /Users/my_user/dev/flutter/my_app/build/ios/Debug-dev-iphoneos/DKImagePickerController/DKImagePickerController.framework/DKImagePickerController
    ld: warning: linking against a dylib which is not safe for use in application extensions: /Users/my_user/dev/flutter/my_app/build/ios/Debug-dev-iphoneos/DKPhotoGallery/DKPhotoGallery.framework/DKPhotoGallery
    ld: warning: linking against a dylib which is not safe for use in application extensions: /Users/my_user/dev/flutter/my_app/build/ios/Debug-dev-iphoneos/PromisesObjC/FBLPromises.framework/FBLPromises
    ld: warning: linking against a dylib which is not safe for use in application extensions: /Users/my_user/dev/flutter/my_app/build/ios/Debug-dev-iphoneos/FirebaseCore/FirebaseCore.framework/FirebaseCore
    ld: warning: linking against a dylib which is not safe for use in application extensions: /Users/my_user/dev/flutter/my_app/build/ios/Debug-dev-iphoneos/FirebaseCoreDiagnostics/FirebaseCoreDiagnostics.framework/FirebaseCoreDiagnostics
    ld: warning: linking against a dylib which is not safe for use in application extensions: /Users/my_user/dev/flutter/my_app/build/ios/Debug-dev-iphoneos/FirebaseCrashlytics/FirebaseCrashlytics.framework/FirebaseCrashlytics
    ld: warning: linking against a dylib which is not safe for use in application extensions: /Users/my_user/dev/flutter/my_app/build/ios/Debug-dev-iphoneos/FirebaseInstallations/FirebaseInstallations.framework/FirebaseInstallations
    ld: warning: linking against a dylib which is not safe for use in application extensions: /Users/my_user/dev/flutter/my_app/build/ios/Debug-dev-iphoneos/GoogleDataTransport/GoogleDataTransport.framework/GoogleDataTransport
    ld: warning: linking against a dylib which is not safe for use in application extensions: /Users/my_user/dev/flutter/my_app/build/ios/Debug-dev-iphoneos/GoogleUtilities/GoogleUtilities.framework/GoogleUtilities
    ld: warning: linking against a dylib which is not safe for use in application extensions: /Users/my_user/dev/flutter/my_app/build/ios/Debug-dev-iphoneos/PhoneNumberKit/PhoneNumberKit.framework/PhoneNumberKit
    ld: warning: linking against a dylib which is not safe for use in application extensions: /Users/my_user/dev/flutter/my_app/build/ios/Debug-dev-iphoneos/SDWebImage/SDWebImage.framework/SDWebImage
    ld: warning: linking against a dylib which is not safe for use in application extensions: /Users/my_user/dev/flutter/my_app/build/ios/Debug-dev-iphoneos/SwiftyGif/SwiftyGif.framework/SwiftyGif
    ld: warning: linking against a dylib which is not safe for use in application extensions: /Users/my_user/dev/flutter/my_app/build/ios/Debug-dev-iphoneos/device_info/device_info.framework/device_info
    ld: warning: linking against a dylib which is not safe for use in application extensions: /Users/my_user/dev/flutter/my_app/build/ios/Debug-dev-iphoneos/file_picker/file_picker.framework/file_picker
    ld: warning: linking against a dylib which is not safe for use in application extensions: /Users/my_user/dev/flutter/my_app/build/ios/Debug-dev-iphoneos/flutter_keyboard_visibility/flutter_keyboard_visibility.framework/flutter_keyboard_visibility
    ld: warning: linking against a dylib which is not safe for use in application extensions: /Users/my_user/dev/flutter/my_app/build/ios/Debug-dev-iphoneos/flutter_libphonenumber/flutter_libphonenumber.framework/flutter_libphonenumber
    ld: warning: linking against a dylib which is not safe for use in application extensions: /Users/my_user/dev/flutter/my_app/build/ios/Debug-dev-iphoneos/flutter_secure_storage/flutter_secure_storage.framework/flutter_secure_storage
    ld: warning: linking against a dylib which is not safe for use in application extensions: /Users/my_user/dev/flutter/my_app/build/ios/Debug-dev-iphoneos/geolocator/geolocator.framework/geolocator
    ld: warning: linking against a dylib which is not safe for use in application extensions: /Users/my_user/dev/flutter/my_app/build/ios/Debug-dev-iphoneos/nanopb/nanopb.framework/nanopb
    ld: warning: linking against a dylib which is not safe for use in application extensions: /Users/my_user/dev/flutter/my_app/build/ios/Debug-dev-iphoneos/package_info/package_info.framework/package_info
    ld: warning: linking against a dylib which is not safe for use in application extensions: /Users/my_user/dev/flutter/my_app/build/ios/Debug-dev-iphoneos/phone_number/phone_number.framework/phone_number
    ld: warning: linking against a dylib which is not safe for use in application extensions: /Users/my_user/dev/flutter/my_app/build/ios/Debug-dev-iphoneos/shared_preferences/shared_preferences.framework/shared_preferences
    ld: warning: linking against a dylib which is not safe for use in application extensions: /Users/my_user/dev/flutter/my_app/build/ios/Debug-dev-iphoneos/url_launcher/url_launcher.framework/url_launcher
    ld: warning: Could not find or use auto-linked framework 'Flutter'
    Undefined symbols for architecture arm64:
      "_OBJC_CLASS_$_FlutterStandardTypedData", referenced from:
          objc-class-ref in google_maps_flutter(GoogleMapController.o)
      "_OBJC_CLASS_$_FlutterStandardMessageCodec", referenced from:
          objc-class-ref in google_maps_flutter(GoogleMapController.o)
      "_OBJC_CLASS_$_FlutterError", referenced from:
          objc-class-ref in firebase_core(FLTFirebasePlugin.o)
          objc-class-ref in google_maps_flutter(FLTGoogleMapsPlugin.o)
          objc-class-ref in google_maps_flutter(FLTGoogleMapTileOverlayController.o)
          objc-class-ref in google_maps_flutter(GoogleMapMarkerController.o)
          objc-class-ref in google_maps_flutter(GoogleMapController.o)
          objc-class-ref in onesignal_flutter(OSFlutterCategories.o)
      "_OBJC_CLASS_$_FlutterMethodChannel", referenced from:
          objc-class-ref in firebase_core(FLTFirebaseCorePlugin.o)
          objc-class-ref in firebase_crashlytics(FLTFirebaseCrashlyticsPlugin.o)
          objc-class-ref in google_maps_flutter(GoogleMapController.o)
          objc-class-ref in onesignal_flutter(OSFlutterOutcomeEventsController.o)
          objc-class-ref in onesignal_flutter(OneSignalPlugin.o)
          objc-class-ref in onesignal_flutter(OSFlutterTagsController.o)
          objc-class-ref in onesignal_flutter(OSFlutterInAppMessagesController.o)
          ...
      "_FlutterMethodNotImplemented", referenced from:
          -[FLTFirebaseCorePlugin handleMethodCall:result:] in firebase_core(FLTFirebaseCorePlugin.o)
          -[FLTFirebaseCrashlyticsPlugin handleMethodCall:result:] in firebase_crashlytics(FLTFirebaseCrashlyticsPlugin.o)
          ___61-[FLTTileProviderController requestTileForX:y:zoom:receiver:]_block_invoke in google_maps_flutter(FLTGoogleMapTileOverlayController.o)
          -[FLTGoogleMapController onMethodCall:result:] in google_maps_flutter(GoogleMapController.o)
          -[OSFlutterOutcomeEventsController handleMethodCall:result:] in onesignal_flutter(OSFlutterOutcomeEventsController.o)
          -[OneSignalPlugin handleMethodCall:result:] in onesignal_flutter(OneSignalPlugin.o)
          -[OSFlutterTagsController handleMethodCall:result:] in onesignal_flutter(OSFlutterTagsController.o)
          ...
    ld: symbol(s) not found for architecture arm64:
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
    note: Using new build system
    note: Building targets in parallel
    note: Planning build
    note: Analyzing workspace
    note: Constructing build description
    note: Build preparation complete
    /Users/my_user/dev/flutter/my_app/ios/Pods/Pods.xcodeproj: warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.5.99. (in target 'Flutter' from project 'Pods')
    /Users/my_user/dev/flutter/my_app/ios/Pods/Pods.xcodeproj: warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.5.99. (in target 'OneSignal' from project 'Pods')

Could not build the precompiled application for the device.
@tainanfochesatto
Copy link

I am also having the same error.

@nickscamara
Copy link

nickscamara commented May 4, 2021

Same here... Can't understand the #374 solution.

@emawby
Copy link
Contributor

emawby commented May 6, 2021

Seems similar to this Flutter issue from last year. Can you see if ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings file exists and if so try deleting it?

@rovkinmax
Copy link
Author

@emawby No, I don't have this file

@nickscamara
Copy link

@emawby I also don't have this file

@emawby
Copy link
Contributor

emawby commented May 7, 2021

@rovkinmax @nickscamara I am not able to reproduce this issue. Are you able to share the contents of your custom configurations? A sample project with this issue would also be very helpful.

@rovkinmax
Copy link
Author

@emawby Yep, check this one https://github.com/rovkinmax/OneSignalSDKProblem

@emawby
Copy link
Contributor

emawby commented May 10, 2021

@rovkinmax So from my testing some of the configs worked and some didn't. You had the Runner Scheme set to use the release-prod config when running (this is usually a debug config).
The default Debug and Release configs worked fine.
image
The other configs were broken if they had a value for the project's config instead of just the targets. For example changing the Runner project's config value from dev to None in the below image fixed the issue.
image

@rovkinmax
Copy link
Author

without OneSignal this project builds fine and I have no idea how fix it for onesignal

@emawby
Copy link
Contributor

emawby commented May 11, 2021

This is an issue with the custom configuration setup since the project runs fine with the Debug and Release configs. How were these configs generated and how are you using them?

@emawby
Copy link
Contributor

emawby commented May 11, 2021

This Flutter issue also seems similar flutter/flutter#78436

@rovkinmax
Copy link
Author

@emawby
Copy link
Contributor

emawby commented May 12, 2021

Something about those configs is making Flutter try to add onesignal_flutter to the NotificationServiceExtension when it shouldn't. The NSE only needs the OneSignal (iOS Native) SDK not the flutter SDK. If you can use the default configs instead you should. To change the run target for the scheme go to edit scheme -> run -> Build Configuration and select Debug.

@GyuriMajercsik
Copy link

GyuriMajercsik commented May 13, 2021

This error appears when I want to run the app on the simulator. I removed the extension and the app worked, and after adding it back by following the official steps, it stopped working.

Xcode's output:
↳
    ld: in /Users/gyuri/work//x-mobile/ios/Pods/OneSignal/iOS_SDK/OneSignalSDK/Framework/OneSignal.framework/OneSignal(OneSignal-arm64-master.o), 
building for iOS Simulator, but linking in object file built for iOS, file '/Users/gyuri/work/x-mobile/ios/Pods/OneSignal/iOS_SDK/OneSignalSDK/Framework/OneSignal.framework/OneSignal'
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
    note: Using new build system
    note: Building targets in parallel
    note: Planning build
    note: Analyzing workspace
    note: Constructing build description
    note: Build preparation complete

@emawby
Copy link
Contributor

emawby commented May 13, 2021

@GyuriMajercsik This appears to be an architecture issue. What is the value of the following build settings for both your app and NSE targets?
"Architectures"
"Build Active Architecture Only"
"Excluded Architectures"

@GyuriMajercsik
Copy link

Are you referring to this ?

image

@emawby
Copy link
Contributor

emawby commented May 13, 2021

Yes I am not seeing the simulator architectures there only the device ones

@GyuriMajercsik
Copy link

This one ? I'm not sure where to look at.
image

@emawby
Copy link
Contributor

emawby commented May 14, 2021

This thread has lots of good suggestions for you to try, but in addition to the build error You are using Standard Architectures (arm64, armv7). If you are not running on an Apple Silicon mac then you probably have intel based simulators (x86_64) so you need to include those architectures as well.

@jagged91
Copy link

jagged91 commented May 14, 2021

I see this issue too, but adding x86 doesn't make a difference.

Screen Shot 2021-05-14 at 5 32 27 PM

@rovkinmax
Copy link
Author

I found solution for this problem:

  1. Set up selected configurations as None
    image

  2. Check that check box is turn on
    image

@GyuriMajercsik
Copy link

This unfortunately doesn't fix the issue I'm facing. ... The release build still works but running in the simulator doesn't. Want to also mention that it did work before. Probably after updating xCode something is not compatible anymore ...

@nickscamara
Copy link

It did not work for me either...

@emawby
Copy link
Contributor

emawby commented May 18, 2021

@GyuriMajercsik if you updated from Xcode 11 to Xcode 12 you are likely experiencing one of the architecture issues that were very common upon release of Xcode 12. I don't think this issue is related to OneSignal

@GyuriMajercsik
Copy link

Might be the case, but after I removed everything OneSignal related it started to work...

@pafciu17
Copy link

@GyuriMajercsik I had very similar looking error as rovkinmax when working on Share extension (after update to flutter 2.0.6, Xcode 12.5). Removing the values in Build Settings / Other Linker Flags for the mentioned extension seemed to fix it for me.

@juandiago
Copy link

juandiago commented May 4, 2022

I found solution for this problem:

  1. Set up selected configurations as None
    image
  2. Check that check box is turn on
    image

Just a heads up, when using this solution, the second step was not necessary and it actually broke my service extension for confirmed deliveries.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants