Flutter stuck on Building Dart code after doing flutter build ios - ios

I'm trying to build an archive by doing flutter build ios but I encounter a problem on Starting Xcode build
$ flutter build ios
Building com.example.example for the device (ios-release)...
Automatically signing iOS for device deployment using specified
development team in Xcode project: XXXXXX
Running pod install...
Starting Xcode build...
├─Building Dart code...
I already build an archive one (last week) and it was working. Maybe this is due to flutter upgrade ?
$ flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel beta, v0.11.3, on Mac OS X 10.14.1 18B75, locale
en-GB)
[✓] Android toolchain - develop for Android devices (Android SDK
28.0.3)
[✓] iOS toolchain - develop for iOS devices (Xcode 10.1)
[✓] Android Studio (version 3.2)
[✓] VS Code (version 1.29.1)

That's an issue that was fixed very recently and the fix should already be available in the master channel.
flutter channel master
flutter doctor
You can also try dev channel, but I'm not sure if it landed there already.
The fix will of course be included in the next beta channel, but a beta release just came out last week, so it will probably take a while to the next.
See also https://github.com/flutter/flutter/issues/24139

Related

Flutter iOS project Flutter.h file not found after adding Share Extension

I am stuck with this build issue
ios/Runner/GeneratedPluginRegistrant.h:10:9: error: 'Flutter/Flutter.h' file not found
#import <Flutter/Flutter.h>
^
1 error generated.
:0: error: failed to emit precompiled header
It occurs after carefully adding a Share Extension to the Xcode workspace and configuring it according to this article:
https://medium.com/flutter-community/receive-sharing-files-to-flutter-app-from-another-app-7a84c0c0cd88
The "solutions" appear to be limited to deleting the iOS folder, and then recreating it.
I have done that, however as soon as I then add back in the share extension, I am left with the same problem.
I have so far tried the following, as well as many others since forgotten, and in many different combinations:
flutter clean
delete DerivedData folder
rm Podfile.lock and rm -rf Pods, follow by arch -x86_64 pod install --repo-update
Cocoapods updated
I am running on an M1 Macbook Pro
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.0.0, on macOS 12.2 21D49 darwin-arm, locale en-GB)
[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 13.3.1)
[✓] Chrome - develop for the web
[!] Android Studio
✗ Unable to find bundled Java version.
[✓] Android Studio (version 4.1)
[✓] IntelliJ IDEA Ultimate Edition (version 2021.3)
[✓] VS Code (version 1.67.1)
[✓] Connected device (5 available)
[✓] HTTP Host Availability
I have seen the project build and run for the Simulator, but I cannot reliably say what changed or why, and right now it is back to not even building for simulator after I attempted a device build (which failed as above).
Additional notes
My targets (Runner, ShareExtension, Pods) are all set to build for iOS14
ShareExtension has the same bundle id as the Runner project with "Share-Extension" appended.
Bitcode not enabled
Thanks in advance for any help

Flutter deployment error when testing on physical device: : errSecInternalComponent

I am trying to test my flutter application on my iPad, and iPhone, and I have tried everything that I've read from forums.
It will run on an emulator, but not a physical device.
I have tried:
Cleaning and rebuilding.
Restarting my computer.
Updating all of the software on both my computer and the devices.
Creating a unique bundle id.
Choosing different teams for signing.
Changing iOS development target.
Changing the bundle id to my email.
I'm just not sure what to fix at this point.
this is the output of flutter doctor:
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel master, 1.19.0-4.0.pre.108, on Mac OS X 10.15.5 19F101, locale en-US)
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
[✓] Xcode - develop for iOS and macOS (Xcode 11.5)
[✓] Android Studio (version 4.0)
[✓] VS Code (version 1.45.1)
[✓] Connected device (1 available)
• No issues found!
There is something up with Xcode and my computer, because I downgraded to Xcode 11.3 and it worked.

Flutter: iOS build fails

I have an issue with Flutter. I can't run my app on an iOS simulator. I've tried to create a new certificate under the Mac keychain and that didn't help me much. Does anyone know how I can fix this problem?
(base) seroaslan#Seros-MBP Desktop % flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, v1.12.13+hotfix.9, on Mac OS X 10.15.4 19E287, locale da-DK)
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
[✓] Xcode - develop for iOS and macOS (Xcode 11.4.1)
[✓] Android Studio (version 3.5)
[!] IntelliJ IDEA Ultimate Edition (version 2020.1.1)
✗ Flutter plugin not installed; this adds Flutter specific functionality.
✗ Dart plugin not installed; this adds Dart specific functionality.
[✓] VS Code (version 1.44.2)
[✓] Connected device (1 available)
! Doctor found issues in 1 category.
(base) seroaslan#Seros-MBP tutorial % flutter run
Launching lib/main.dart on iPhone 8 in debug mode...
Running Xcode build...
├─Assembling Flutter resources... 2,8s
└─Compiling, linking and signing... 3,0s
Xcode build done. 9,2s
Failed to build iOS app
Error output from Xcode build:
↳
** BUILD FAILED **
Xcode's output:
↳
/Users/seroaslan/Desktop/tutorial/build/ios/Debug-iphonesimulator/Runner.app: resource fork, Finder
information, or similar detritus not allowed
Command CodeSign failed with a nonzero exit code
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 8.
The answer is in your flutter doctor:
✗ Flutter plugin not installed; this adds Flutter specific functionality.
✗ Dart plugin not installed; this adds Dart specific functionality.
You will need to fix these issues by setting it all up again as shown here: https://flutter.io/setup-macos/

Flutter - iOS Simulator "not supported devices connected"

For some reason, iOS Simulator stopped working. I can open iOS Simulator, but Android Studio not recognizes it. I've already tried to run via terminal, but it says not supported devices connected.
When I run flutter doctor it returns:
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, v1.12.13+hotfix.8, on Mac OS X 10.12.6 16G2136, locale pt-US)
[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
[!] Xcode - develop for iOS and macOS (Xcode 9.2)
✗ Flutter requires a minimum Xcode version of 11.0.0.
Download the latest version or update via the Mac App Store.
[✓] Android Studio (version 3.4)
[✓] VS Code (version 1.43.2)
[!] Connected device
! No devices available
! Doctor found issues in 2 categories.
Since I'm on a Macbook 2011, I won't be able to upgrade Xcode. Is it possible to downgrade Flutter and Xcode to an older stable version? Would this solve the problem?
Thanks
If Android Studio does not recognize ios simulator even though you can separately open simulator on your Mac, you have to add command line tool on Xcode.
open Xcode then go to Xcode > preferences > select Locations tab. Then select Xcode version from the drop-down menu.
Open ios simulator again. Then Android Studio will recognize your device.

Flutter installed but failed to start-up on real IOS device

Flutter failed to start-up on real IOS device (not emulator), its working fine on the IOS emulator but when I connect my device its installed but fails to launch without printing any message on flutter application log.
Launching lib/main.dart on XXXX in debug mode...
Automatically signing iOS for device deployment using specified development team in Xcode project: XXXXX
Running Xcode build...
└─Compiling, linking and signing... 10.7s
Xcode build done. 20.1s
Installing and launching...
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel master, v1.15.4-pre.262, on Mac OS X 10.14.6 18G3020, locale en-GB)
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
[✓] Xcode - develop for iOS and macOS (Xcode 11.3.1)
[✓] Android Studio (version 3.5)
[✓] IntelliJ IDEA Ultimate Edition (version 2019.3.1)
[✓] Connected device (1 available)
• No issues found!
could you please help!
There was an issue on Flutter repository as mentioned by #amer rawashdeh.
iOS 13.4 is now available, please update your iOS device and Xcode to v11.4 to keep your project newly working.
If you are on Flutter stable channel you need also to apply this guide to keep you project working with v11.4 Xcode
It seems the problem with ISO version 13.3.1 only
check it out:
https://github.com/flutter/flutter/issues/49504#issuecomment-581554697
The application was working on IOS emulator version 13.3

Resources