rohit1814 / flutter_open_whatsapp

A Flutter plugin to open WhatsApp and send message to single number.
MIT License
22 stars 23 forks source link

Builds are failing due to forced casts - iOS #12

Closed miltondavila closed 4 years ago

miltondavila commented 4 years ago

Hi, I have been trying to use this package for a Flutter iOS app, but I am getting the following warnings that do not let the app build successfully:

/.pub-cache/hosted/pub.dartlang.org/flutter_open_whatsapp-0.1.2/ios/Classes/SwiftFlutterOpenWhatsappPlugin.swift:30:58: warning: forced cast from 'NSURL?' to 'URL' only unwraps and bridges; did you mean to use '!' with 'as'? if UIApplication.shared.canOpenURL(whatsAppUrl as! URL) {


                                                            !as

/.pub-cache/hosted/pub.dartlang.org/flutter_open_whatsapp-0.1.2/ios/Classes/SwiftFlutterOpenWhatsappPlugin.swift:31:58: warning: forced cast from 'NSURL?' to 'URL' only unwraps and bridges; did you mean to use '!' with 'as'?
                    UIApplication.shared.openURL(whatsAppUrl as! URL)
                                                 ~~~~~~~~~~~ ^~~ ~~~
                                                            !as

I am trying to run the app from Android Studio 3.6.3 and building the iOS version with XCode 11.4.1.

What could the problem be?  Thanks for your help.
miltondavila commented 4 years ago

The build is working now. There was another issue with my app, not related to this package. However, sometimes Android Studio is showing the warning message that I shared in this issue report.

praharshbhatt commented 3 years ago

Facing this issue right now. How did you solve this?

Xcode's output:
↳
    /Users/superuser/.development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_open_whatsapp-0.1.2/ios/Cl
    asses/SwiftFlutterOpenWhatsappPlugin.swift:30:58: warning: forced cast from 'NSURL?' to 'URL' only unwraps
    and bridges; did you mean to use '!' with 'as'?
              if UIApplication.shared.canOpenURL(whatsAppUrl as! URL) {
                                                 ~~~~~~~~~~~ ^~~ ~~~
                                                            !as
    /Users/superuser/.development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_open_whatsapp-0.1.2/ios/Cl
    asses/SwiftFlutterOpenWhatsappPlugin.swift:31:58: warning: forced cast from 'NSURL?' to 'URL' only unwraps
    and bridges; did you mean to use '!' with 'as'?
                    UIApplication.shared.openURL(whatsAppUrl as! URL)
                                                 ~~~~~~~~~~~ ^~~ ~~~
                                                            !as
    ld: warning: ignoring file
    /Users/superuser/.development/flutter/.pub-cache/git/flutter_zoom_plugin-88d1fa2685f28d67410d46e094461a0a03
    0d3192/ios/MobileRTC.framework/MobileRTC, missing required architecture x86_64 in file
    /Users/superuser/.development/flutter/.pub-cache/git/flutter_zoom_plugin-88d1fa2685f28d67410d46e094461a0a03
    0d3192/ios/MobileRTC.framework/MobileRTC (2 slices)
    Undefined symbols for architecture x86_64:
      "_OBJC_CLASS_$_MobileRTCSDKInitContext", referenced from:
          objc-class-ref in SwiftFlutterZoomPlugin.o
      "_OBJC_CLASS_$_MobileRTC", referenced from:
          objc-class-ref in SwiftFlutterZoomPlugin.o
      "_kMeetingParam_MeetingPassword", referenced from:
          flutter_zoom_plugin.ZoomView.joinMeeting(call: __C.FlutterMethodCall, result: (Any?) -> ()) -> () in
          SwiftFlutterZoomPlugin.o
      "_kMeetingParam_Username", referenced from:
          flutter_zoom_plugin.ZoomView.joinMeeting(call: __C.FlutterMethodCall, result: (Any?) -> ()) -> () in
          SwiftFlutterZoomPlugin.o
      "_OBJC_CLASS_$_MobileRTCMeetingStartParam4WithoutLoginUser", referenced from:
          objc-class-ref in SwiftFlutterZoomPlugin.o
      "_kMeetingParam_MeetingNumber", referenced from:
          flutter_zoom_plugin.ZoomView.joinMeeting(call: __C.FlutterMethodCall, result: (Any?) -> ()) -> () in
          SwiftFlutterZoomPlugin.o
    ld: symbol(s) not found for architecture x86_64
    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: Constructing build description
    warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of
    supported deployment target versions is 9.0 to 14.1.99. (in target 'apple_sign_in' from project 'Pods')
    warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of
    supported deployment target versions is 9.0 to 14.1.99. (in target 'webview_flutter' from project 'Pods')
    warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of
    supported deployment target versions is 9.0 to 14.1.99. (in target 'video_player' from project 'Pods')
    warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of
    supported deployment target versions is 9.0 to 14.1.99. (in target 'url_launcher' from project 'Pods')
    warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of
    supported deployment target versions is 9.0 to 14.1.99. (in target 'shared_preferences' from project
    'Pods')
    warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of
    supported deployment target versions is 9.0 to 14.1.99. (in target 'share_extend' from project 'Pods')
    warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of
    supported deployment target versions is 9.0 to 14.1.99. (in target 'share' from project 'Pods')
    warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of
    supported deployment target versions is 9.0 to 14.1.99. (in target 'path_provider' from project 'Pods')
    warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of
    supported deployment target versions is 9.0 to 14.1.99. (in target 'native_contact_picker' from project
    'Pods')
    warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of
    supported deployment target versions is 9.0 to 14.1.99. (in target 'nanopb' from project 'Pods')
    warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of
    supported deployment target versions is 9.0 to 14.1.99. (in target 'package_info' from project 'Pods')
    warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of
    supported deployment target versions is 9.0 to 14.1.99. (in target 'in_app_purchase' from project 'Pods')
    warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of
    supported deployment target versions is 9.0 to 14.1.99. (in target 'image_picker' from project 'Pods')
    warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of
    supported deployment target versions is 9.0 to 14.1.99. (in target 'google_sign_in' from project 'Pods')
    warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of
    supported deployment target versions is 9.0 to 14.1.99. (in target 'get_version' from project 'Pods')
    warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of
    supported deployment target versions is 9.0 to 14.1.99. (in target 'flutter_zoom_plugin' from project
    'Pods')
    warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of
    supported deployment target versions is 9.0 to 14.1.99. (in target 'flutter_webview_plugin' from project
    'Pods')
    warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of
    supported deployment target versions is 9.0 to 14.1.99. (in target 'flutter_secure_storage' from project
    'Pods')
    warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of
    supported deployment target versions is 9.0 to 14.1.99. (in target 'flutter_open_whatsapp' from project
    'Pods')
    warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of
    supported deployment target versions is 9.0 to 14.1.99. (in target 'flutter_local_notifications' from
    project 'Pods')
    warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of
    supported deployment target versions is 9.0 to 14.1.99. (in target 'flutter_email_sender' from project
    'Pods')
    warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of
    supported deployment target versions is 9.0 to 14.1.99. (in target 'flutter_clipboard_manager' from project
    'Pods')
    warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of
    supported deployment target versions is 9.0 to 14.1.99. (in target 'firebase_messaging' from project
    'Pods')
    warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of
    supported deployment target versions is 9.0 to 14.1.99. (in target 'firebase_in_app_messaging' from project
    'Pods')
    warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of
    supported deployment target versions is 9.0 to 14.1.99. (in target 'firebase_dynamic_links' from project
    'Pods')
    warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of
    supported deployment target versions is 9.0 to 14.1.99. (in target 'firebase_crashlytics' from project
    'Pods')
    warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of
    supported deployment target versions is 9.0 to 14.1.99. (in target 'firebase_auth' from project 'Pods')
    warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of
    supported deployment target versions is 9.0 to 14.1.99. (in target 'firebase_analytics' from project
    'Pods')
    warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of
    supported deployment target versions is 9.0 to 14.1.99. (in target 'file_picker' from project 'Pods')
    warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of
    supported deployment target versions is 9.0 to 14.1.99. (in target 'firebase_core' from project 'Pods')
    warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of
    supported deployment target versions is 9.0 to 14.1.99. (in target 'credit_card_input_form' from project
    'Pods')
    warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of
    supported deployment target versions is 9.0 to 14.1.99. (in target 'camera' from project 'Pods')
    warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of
    supported deployment target versions is 9.0 to 14.1.99. (in target 'SwiftyGif' from project 'Pods')
    warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of
    supported deployment target versions is 9.0 to 14.1.99. (in target 'SDWebImage' from project 'Pods')
    warning: The use of Swift 3 @objc inference in Swift 4 mode is deprecated. Please address deprecated @objc
    inference warnings, test your code with “Use of deprecated Swift 3 @objc inference” logging enabled, and
    then disable inference by changing the "Swift 3 @objc Inference" build setting to "Default" for the
    "Runner" target. (in target 'Runner' from project 'Runner')
    warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of
    supported deployment target versions is 9.0 to 14.1.99. (in target 'Protobuf' from project 'Pods')
    warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of
    supported deployment target versions is 9.0 to 14.1.99. (in target 'GoogleUtilities' from project 'Pods')
    warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of
    supported deployment target versions is 9.0 to 14.1.99. (in target 'GoogleDataTransportCCTSupport' from
    project 'Pods')
    warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of
    supported deployment target versions is 9.0 to 14.1.99. (in target 'GoogleDataTransport' from project
    'Pods')
    warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of
    supported deployment target versions is 9.0 to 14.1.99. (in target 'GTMSessionFetcher' from project 'Pods')
    warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of
    supported deployment target versions is 9.0 to 14.1.99. (in target 'GTMAppAuth' from project 'Pods')
    warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of
    supported deployment target versions is 9.0 to 14.1.99. (in target 'FirebaseMessaging' from project 'Pods')
    warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of
    supported deployment target versions is 9.0 to 14.1.99. (in target 'FirebaseInstanceID' from project
    'Pods')
    warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of
    supported deployment target versions is 9.0 to 14.1.99. (in target 'FirebaseInstallations' from project
    'Pods')
    warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of
    supported deployment target versions is 9.0 to 14.1.99. (in target 'FirebaseDynamicLinks' from project
    'Pods')
    warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of
    supported deployment target versions is 9.0 to 14.1.99. (in target 'FirebaseCoreDiagnostics' from project
    'Pods')
    warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of
    supported deployment target versions is 9.0 to 14.1.99. (in target 'FirebaseCore' from project 'Pods')
    warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of
    supported deployment target versions is 9.0 to 14.1.99. (in target 'FirebaseAuth' from project 'Pods')
    warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of
    supported deployment target versions is 9.0 to 14.1.99. (in target 'FirebaseABTesting' from project 'Pods')
    warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of
    supported deployment target versions is 9.0 to 14.1.99. (in target 'FBSDKLoginKit' from project 'Pods')
    warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of
    supported deployment target versions is 9.0 to 14.1.99. (in target 'FBSDKCoreKit' from project 'Pods')
    warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of
    supported deployment target versions is 9.0 to 14.1.99. (in target 'AppAuth' from project 'Pods')
    warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of
    supported deployment target versions is 9.0 to 14.1.99. (in target 'Crashlytics' from project 'Pods')
    warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of
    supported deployment target versions is 9.0 to 14.1.99. (in target 'GoogleAppMeasurement' from project
    'Pods')
    warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of
    supported deployment target versions is 9.0 to 14.1.99. (in target 'FirebaseAuthInterop' from project
    'Pods')
    warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of
    supported deployment target versions is 9.0 to 14.1.99. (in target 'Flutter' from project 'Pods')
    warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of
    supported deployment target versions is 9.0 to 14.1.99. (in target 'GoogleSignIn' from project 'Pods')
    warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of
    supported deployment target versions is 9.0 to 14.1.99. (in target 'FirebaseAnalytics' from project 'Pods')
    warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of
    supported deployment target versions is 9.0 to 14.1.99. (in target 'FirebaseCoreDiagnosticsInterop' from
    project 'Pods')
    warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of
    supported deployment target versions is 9.0 to 14.1.99. (in target 'FirebaseAnalyticsInterop' from project
    'Pods')
    warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of
    supported deployment target versions is 9.0 to 14.1.99. (in target 'Fabric' from project 'Pods')