Can't use UrlLauncher on iOS

511 views
Skip to first unread message

Adriano Brandão

unread,
Mar 9, 2018, 2:47:04 PM3/9/18
to Flutter Dev
Hi,

First of all: I am really loving building apps on Flutter. Native development for iOS or Android is such a pain - in fact, double pain! But Flutter is amazing.

But I'm struggling to use the UrlLauncher plugin. It's working perfectly fine on Android, but I can't run my app on iOS anymore. 

Both "flutter run" and "flutter build ios" always halt on: 

".../ios/Runner/GeneratedPluginRegistrant.m:6:9: fatal error: 'url_launcher/UrlLauncherPlugin.h' file not found
           #import <url_launcher/UrlLauncherPlugin.h>"

What I have to do in order to make this work? I've tried absolutely everything...

Cheers!

Mikkel Ravn

unread,
Mar 9, 2018, 3:55:32 PM3/9/18
to Adriano Brandão, Flutter Dev
Hi,

Thanks for your interest in Flutter!

Is the iOS portion of your app a Swift application? In that case, you may have been hit by https://github.com/flutter/flutter/issues/15099.
The issue links to a workaround that hopefully can get you unblocked.

Cheers,
Mikkel

--
You received this message because you are subscribed to the Google Groups "Flutter Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to flutter-dev+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Adriano Brandão

unread,
Mar 9, 2018, 7:15:37 PM3/9/18
to Flutter Dev
Hi Mikkel,

Thanks for your answer!

I recreated my project without Swift support and, voilà, it's working like a charm!

I tried that workaround with no success at all. I think I'll discover later whether my project will need Swift support or not. 

Cheers!

To unsubscribe from this group and stop receiving emails from it, send an email to flutter-dev...@googlegroups.com.

Adriano Brandão

unread,
Mar 10, 2018, 8:34:13 AM3/10/18
to Flutter Dev
Hi!

Michel's answer in another thread saved me.

In order to have Swift enabled on my project, I had to add some code in the Podfile:

post_install do |installer|

  installer.pods_project.targets.each do |target|

    target.build_configurations.each do |config|

      config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '9.2'

      config.build_settings['ENABLE_BITCODE'] = 'NO'

    end

  end

end


and commented one line in the Podfile:

#use_frameworks!

Cheers!

chukkr...@gmail.com

unread,
Mar 21, 2018, 1:11:20 AM3/21/18
to Flutter Dev
Try adding the following lines in pod file this will solve this issue. 
https://github.com/flutter/flutter/pull/15437/files#diff-519f1341a7393048261b00690f7c2c0e
Reply all
Reply to author
Forward
0 new messages