Flutter webview_flutter build is failing - flutter

I am trying to install webview_flutter plugin but somehow my build is failing every time
Launching lib/main.dart on iPhone 11 Pro in debug mode...
Running Xcode build...
├─Assembling Flutter resources... 10.2s
└─Compiling, linking and signing... 2.1s
Xcode build done.
17.5s
Failed to build iOS app
Error output from Xcode build:
↳
** BUILD FAILED **
Xcode's output:
↳
<path_to_project>ios/Runner/GeneratedPluginRegistrant.m:10:9: fatal
error: module 'webview_flutter' not found
#import webview_flutter;
~~~~~~~^~~~~~~~~~~~~~~
1 error generated.
note: Using new build system
note: Building targets in parallel
note: Planning build
note: Constructing build description
Could not build the application for the simulator.
Error launching application on iPhone 11 Pro.
pubspec.yml
dependencies:
flutter:
sdk: flutter
webview_flutter: ^0.3.19+8
I tried running but it did not solve it.
flutter clean
flutter pub cache repair

Have you follow all the installation for iOS for this plugin?
This is from the webview_flutter page itself:
To use this plugin on iOS you need to opt-in for the embedded views
preview by adding a boolean property to the app's Info.plist file,
with the key io.flutter.embedded_views_preview and the value YES.
This also seems to be related, take a look: https://github.com/flutter/flutter/issues/50190

In my case, the issue was that I had manually edited the podfile to add in my own (non-flutter) pod to the project. However, the flutter build would make no attempt to edit (or overwrite) the podfile, (maybe this is good) so the podfile would not have the changes necessary to support webview_flutter. I figured this all out by creating a brand new flutter project and comparing the new project's generated podfile against my current version. They looked significantly different.

flutter upgrade solved problem for me

Related

Flutter - The Xcode project defines schemes: Flutter Assemble, Runner

While running from android studio, I am facing this error.
Launching lib/main_staging.dart on macOS in debug mode...
Running pod install...
The Xcode project defines schemes: Flutter Assemble, Runner
Exception: You must specify a --flavor option to select one of the available schemes.
What is the proper way to run the app on MacOS?
Add the exact xcode scheme name to your Builf flavor in your edit configuration, as shown below

Codemagic builed failed on flutter app on windows with platform error?

I'm trying to build my flutter app with codemagic for ios but it fails building with this error:
[!] Automatically assigning platform iOS with version 9.0 on target Runner because no platform was specified. Please specify a platform for this target in your Podfile. See https://guides.cocoapods.org/syntax/podfile.html#platform.
Error running pod install
Build failed :| Failed to build for iOS
exactly like on this thread:
Error while building flutter app for ios on codemagic - Automatically assigning platform `iOS` with version `8.0` on target `Runner`
but couldn't understand the solution.
I'm using windows so have no pod file as well.
I also looked inside the suggested link but it links to the cocoapod website which I don't have on windows.
Any suggestions would help!

Newly created flutter app fails to build iOS

I am using flutter to build an App for IOS and I manage to create the project smoothly. Before I put any code or dependencies I run flutter build apk and this builds the apk successfully. I then run flutter build ios and I get this error Failed to package... Command PhaseScriptExecution failed with a nonzero exit code.
I have run flutter doctor and I have no issues. I am running latest flutter version Channel stable, 2.8.0. Latest android studio version 2020.3(Arctic Fox). Latest Xcode 13.1 Release. And Latest MacOs Monterey 12.0.1.
I have tried all solutions I could google but nothing works. Why would it not run when i have not even added any of my code. Just a clean project getting stuck.
Any help is very much appreciated. Thanx

seems no-sound-null-safety parameter not work in flutter 2.2.1

I am upgrade my flutter to version 2.2.1, but it seems --no-sound-null-safety no longer avaliable when build the ios package. I am build the project using this command:
~/apps/flutter/bin/flutter build ios --release --no-codesign --no-sound-null-safety
but the output still tell me some package did not support null safety:
Changing current working directory to: /Users/dolphin/source/cruise-open
Warning: Building for device with codesigning disabled. You will have to manually codesign before deploying to device.
Building com.earth.dolphin for device (ios-release)...
Running Xcode build...
Xcode build done. 36.6s
Failed to build iOS app
Error output from Xcode build:
↳
** BUILD FAILED **
Xcode's output:
↳
2 warnings generated.
2 warnings generated.
Error: Cannot run with sound null safety, because the following dependencies
don't support null safety:
- package:state_notifier
- package:fish_redux
- package:flutter_icons
For solutions, see https://dart.dev/go/unsound-null-safety
Command PhaseScriptExecution failed with a nonzero exit code
note: Using new build system
note: Building targets in parallel
note: Planning build
note: Analyzing workspace
note: Constructing build description
note: Build preparation complete
note: Removed stale file
Encountered error while building for device.
is there any solution with this problem? I am search from flutter issue but no one confirm this problem(https://github.com/flutter/flutter/issues/84199), is it a bug of new version?(Because I am using this command works fine until I upgrade to version 2.2.1). is there other way to pass no-sound-null-safety parameter? I have tried many version and found some version works fine, some version did not works. Maybe a flutter bug.
flutter 2.0.1 works
flutter 2.0.3 works
flutter 2.0.6 works
flutter 2.2.0 not works
flutter 2.2.1 not works
flutter 2.2.2 not works
flutter 2.2.3 not works
seem a bug, will fixed next release:https://github.com/flutter/flutter/pull/84372

producing flutter (Xcode) testflight archive fails with multiple commands produce

need to produce an archive so we can upload to TestFlight so followed instructions in https://flutter.dev/docs/deployment/ios . my flutter runs on both real iPhone and simulator with no problem. so I produce a release version as required then open the resultant Xcode project (runner). immediately see the error
:-1: Multiple commands produce '/Users/jmcfet/Library/Developer/Xcode/DerivedData/Runner-cwxykfeiijpirmgbtrkzktdrahbt/ArchiveIntermediates/Runner/InstallationBuildProductsLocation/Applications/Runner.app/Frameworks/Flutter.framework':
1) Target 'Runner' has copy command from '/Users/jmcfet/AndroidStudioProjects/sis/ios/Flutter/Flutter.framework' to '/Users/jmcfet/Library/Developer/Xcode/DerivedData/Runner-cwxykfeiijpirmgbtrkzktdrahbt/ArchiveIntermediates/Runner/InstallationBuildProductsLocation/Applications/Runner.app/Frameworks/Flutter.framework'
2) That command depends on command in Target 'Runner': script phase “[CP] Embed Pods Frameworks”
now this does not happen when I do the same against the "Flutter Hello world" app so wondering what is messed up in my Flutter app
no luck :
johns-MacBook-Air:ios jmcfet$ pod install
Analyzing dependencies
Fetching podspec for Flutter from .symlinks/flutter/ios
Fetching podspec for video_player from .symlinks/plugins/video_player/ios
Downloading dependencies
Using Flutter (1.0.0)
Using video_player (0.0.1)
Generating Pods project
Integrating client project
Pod installation complete! There are 2 dependencies from the Podfile and 2 total pods installed.
[!] Automatically assigning platform ios with version 8.0 on target Runner because no platform was specified. Please specify a platform for this target in your Podfile. See https://guides.cocoapods.org/syntax/podfile.html#platform.
[!] CocoaPods did not set the base configuration of your project because your project already has a custom config set. In order for CocoaPods integration to work at all, please either set the base configurations of the target Runner to Pods/Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig or include the Pods/Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig in your build configuration (Flutter/Release.xcconfig).
not an IOS expert but looks like the install was not successful. little confused as the Xcode project was generated by Flutter so why is Flutter generating a bad config file. if so looks like a bug to me