I cannot build the .ipa file - ios

I'm developping an app with Flutter.
When I plug my iPhone and run the project, everything is good : I can use my app.
I want to deploy my app on the Apple Store with flutter build ipa.
When I run this command, I got errors :
Error output from Xcode build:
↳
objc[91511]: Class AMSupportURLConnectionDelegate is implemented in both /usr/lib/libauthinstall.dylib (0x20e856c10) and /System/Library/PrivateFrameworks/MobileDevice.framework/Versions/A/MobileDevice (0x1215802b8). One of the two
will be used. Which one is undefined.
objc[91511]: Class AMSupportURLSession is implemented in both /usr/lib/libauthinstall.dylib (0x20e856c60) and /System/Library/PrivateFrameworks/MobileDevice.framework/Versions/A/MobileDevice (0x121580308). One of the two will be
used. Which one is undefined.
** ARCHIVE FAILED **
Xcode's output:
↳
/Users/aymeric/Git/Baggou/mobile/ios/Runner/GeneratedPluginRegistrant.m:12:9: fatal error: module 'cloud_firestore' not found
#import cloud_firestore;
~~~~~~~^~~~~~~~~~~~~~~
1 error generated.
note: Using new build system
note: Building targets in parallel
note: Planning build
note: Analyzing workspace
note: Constructing build description
note: Build preparation complete
Encountered error while archiving for device.
I tried to deintegrate all my pods, update them ... but nothing works.
My flutter doctor :
[✓] Flutter (Channel stable, 2.5.0, on macOS 11.4 20F71 darwin-arm, locale fr-FR)
[!] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
✗ cmdline-tools component is missing
Run `path/to/sdkmanager --install "cmdline-tools;latest"`
See https://developer.android.com/studio/command-line for more details.
✗ 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
[✓] Chrome - develop for the web
[✓] Android Studio (version 4.1)
[✓] Android Studio (version 4.1)
[✓] Android Studio (version 4.1)
[✓] IntelliJ IDEA Ultimate Edition (version 2020.3.2)
[✓] VS Code (version 1.54.1)
[✓] Connected device (2 available)
! Doctor found issues in 1 category.
I don't know if it's relevant, but I use a MacBook Pro with the M1 chip.
Also, I already done this command for another flutter project with the same machine and it was working.
If you want to know my dependencies :
name: baggou
description: Ne restez plus sur la touche.
version: 0.0.40+42
environment:
sdk: ">=2.7.0 <3.0.0"
dependencies:
flutter:
sdk: flutter
# GetX
get: "3.26.0"
get_storage: any
# Firebase
firebase_core: "^1.3.0"
firebase_analytics: "^8.1.2"
firebase_auth: "^1.4.1"
google_sign_in: "5.0.4"
cloud_firestore: "^2.2.2"
firebase_storage: "^8.1.3"
firebase_messaging: "^10.0.2"
# Dependencies
fluttertoast: ^7.1.6
loading: ^1.0.2
carousel_slider: "3.0.0"
image_picker: "0.7.4"
flutter_launcher_icons: ^0.9.0
persistent_bottom_nav_bar: "4.0.2"
flutter_localizations:
sdk: flutter
cupertino_icons: ^1.0.2
flutter_phoenix: "1.0.0"
csc_picker: ^0.2.5
url_launcher: any
introduction_screen: "2.1.0"
smooth_star_rating: "1.1.1"
# Google Maps
google_maps_flutter: "2.0.10"
google_maps_place_picker: "2.1.0-nullsafety.3"
flutter_credit_card: ^2.0.0
dev_dependencies:
flutter_test:
sdk: flutter
flutter_icons:
image_path: "assets/baggou-icon.png"
android: true
ios: true

I found the solution in Xcode. Need to set the correct version.

Related

Xcode archive generate this error : Failed to package, Command PhaseScriptExecution failed with a nonzero exit code

Project run well on iOS simulator but doesn't work on real device nor archiving via xcode , it gives me this error
"Command PhaseScriptExecution failed with a nonzero exit code"
script name?
/bin/sh -c /Users/Amr/Library/Developer/Xcode/DerivedData/Runner-ahbetghgyehinuhheozsxpjhchwh/Build/Intermediates.noindex/ArchiveIntermediates/Runner/IntermediateBuildFilesPath/Runner.build/Release-iphoneos/Runner.build/Script-9740EEB61CF901F6004384FC.sh
Xcode log:
Failed to package /project.
Command PhaseScriptExecution failed with a nonzero exit code
flutter doctor log:
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 2.10.3, on macOS 12.2.1 21D62 darwin-x64, locale en-SA)
[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 13.3)
[✓] Android Studio (version 2021.1)
[✓] Connected device (1 available)
! Error: Amr’s iPhone is not connected. Xcode will continue when Amr’s iPhone is connected. (code -13)
[✓] HTTP Host Availability
• No issues found!
pubspec.yaml
cupertino_icons: ^1.0.2
http: ^0.13.3
introduction_screen: ^3.0.0
flutter_zoom_drawer: ^2.1.1
shared_preferences: ^2.0.7
device_info_plus: ^3.1.0
sms_autofill: ^2.0.1
sizer: ^2.0.13
flutter_spinkit: ^5.0.0
local_auth: ^1.1.7
flutter_contacts: ^1.1.1
share_plus: ^3.0.0
path_provider: ^2.0.4
flutter_page_indicator: ^0.0.3
json_annotation: ^4.4.0
json_serializable: ^6.1.5
build_runner: ^2.1.7
intl: ^0.17.0
smooth_page_indicator: ^1.0.0+2
circular_countdown_timer: ^0.2.0
circular_bottom_navigation: ^2.0.0
custom_navigation_bar: ^0.8.2
flutter_svg: ^1.0.3
flutter_svg_provider: ^1.0.3
tab_indicator_styler: ^2.0.0
flutter_rating_bar: ^4.0.0
flutter_staggered_grid_view: ^0.4.0
responsive_framework: ^0.1.4
url_launcher: ^6.0.10
webview_flutter: ^3.0.1
pie_chart: ^5.0.1
select_form_field: ^2.2.0
syncfusion_flutter_charts: ^19.3.44+1
cool_alert: ^1.1.0
image_picker: ^0.8.4+1
flutter_sound: ^9.1.7
just_audio: ^0.9.18
record: ^3.0.0
provider: ^6.0.1
permission_handler:
flutter_cached_pdfview:
loading:
git:
url: git://github.com/leonzone/loading.git
path: loading
ref: 8f5a63f
flutter_slidable: ^1.1.0
direct_select_flutter: ^1.1.1
pull_to_refresh: ^2.0.0
flutter_icons:
image_path: "assets/images/appicon.png"
android: true
ios: true
dev_dependencies:
flutter_test:
sdk: flutter
& xcode version: Version 13.3 (13E113)
Also getting this on terminal using "flutter build ios --release" command
Xcode's output:
↳
Writing result bundle at path:
/var/folders/p_/vscnsc151p94y69x5gpnshv40000gp/T/flutter_tools.Iz0teh/flutter_ios_build_temp_dirrfh0Oh/temporary_xcresult_bundle
Failed to package /Users/Amr/Developer/taqati.
Command PhaseScriptExecution failed with a nonzero exit code
note: Using new build system
note: Planning
note: Build preparation complete
note: Building targets in dependency order
Result bundle written to path:
/var/folders/p_/vscnsc151p94y69x5gpnshv40000gp/T/flutter_tools.Iz0teh/flutter_ios_build_temp_dirrfh0Oh/temporary_xcresult_bundle
[Xcode image is attached below][1]
Just make sure that your Project's Runner has all the configuration set.If any of the set is missing , please select it and rebuild again.
[1]: https://i.stack.imgur.com/UYobQ.png

Error building iOS app with Flutter - Missing DVTPlugInCompatibilityUUID plugin

I shipped a build before the weekend everything works fine, I come back on Monday, impossible to build. I'm stuck on this for the past few days, I've been trying most of the stuff from the internet I can't seem to find a solution.
XCode build is failing specifying missing plugins (form the base Flutter install I'm guessing):
[ ] Xcode build done. 50.6s
[ ] Failed to build iOS app
[ ] Error output from Xcode build:
↳
[ ] 2021-06-10 09:23:10.255 xcodebuild[64069:7134747] [MT] PluginLoading: Required plug-in compatibility UUID F56A1938-53DE-493D-9D64-87EE6C415E4D for plug-in at path '~/Library/Application Support/Developer/Shared/Xcode/Plug-ins/CocoaPods.xcplugin' not present in DVTPlugInCompatibilityUUIDs
2021-06-10 09:23:10.255 xcodebuild[64069:7134747] [MT] PluginLoading: Required plug-in compatibility UUID F56A1938-53DE-493D-9D64-87EE6C415E4D for plug-in at path '~/Library/Application Support/Developer/Shared/Xcode/Plug-ins/Alcatraz.xcplugin' not present in DVTPlugInCompatibilityUUIDs
** BUILD FAILED **
It then generates error concerning Riverpod
[+5009 ms] ../../flutter/.pub-cache/hosted/pub.dartlang.org/riverpod-0.12.4/lib/src/common.freezed.dart:121:4: Error: Getter not found: 'nullable'.
[ +2 ms] #nullable
[ ] ^^^^^^^^
[ +5 ms] ../../flutter/.pub-cache/hosted/pub.dartlang.org/riverpod-0.12.4/lib/src/common.freezed.dart:121:4: Error: This can't be used as an annotation; an annotation should be a reference to a compile-time constant variable, or a call to a constant constructor.
[ ] #nullable
[ ] ^
[ +1 ms] ../../flutter/.pub-cache/hosted/pub.dartlang.org/riverpod-0.12.4/lib/src/common.freezed.dart:206:4: Error: Getter not found: 'nullable'.
[ ] #nullable
[ ] ^^^^^^^^
[ ] ../../flutter/.pub-cache/hosted/pub.dartlang.org/riverpod-0.12.4/lib/src/common.freezed.dart:206:4: Error: This can't be used as an annotation; an annotation should be a reference to a compile-time constant variable, or a call to a constant constructor.
[ ] #nullable
[ ] ^
What I have tried so far:
flutter clean
flutter pub cache repair
Rebuilding the iOS folder
cleaning the build folder
pod update && pod install
flutter upgrade
check the use of !use_frameworks in podfile
And other configuration changes in XCode such as the script 'for install only', etc...
The only thing I see would be that the problem is coming from a package that I'm using, such as Firebase Core. They had a similar problem a year ago or so where we had to downgrade the package version in order to build and the error was similar, the problem here is that I tried to downgrade from 1.2.1 to 0.7.0 but the problem persists until it generates dependencies issues.
Same kind of issue happended with flutter_svg I think, it was due to a breaking change making it mandatory to either update flutter_svg or downgrade flutter.
Also, could it be that I have not migrated to sound null safety yet ?
If you have an idea on how to debug this, that would be very helpful. (Some stuff that I can run to have more infos regarding the error for example).
Here are my flutter doctor and pubspec files:
Flutter doctor:
[✓] Flutter (Channel stable, 2.2.1, on macOS 11.3 20E232 darwin-x64, locale en-FR)
• Flutter version 2.2.1 at /Users/Wapazz/Development/flutter
• Framework revision 02c026b03c (2 weeks ago), 2021-05-27 12:24:44 -0700
• Engine revision 0fdb562ac8
• Dart version 2.13.1
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
• Android SDK at /Users/Wapazz/Library/Android/sdk
• Platform android-30, build-tools 29.0.2
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)
• All Android licenses accepted.
[✓] 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 3.5)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 42.1.1
• Dart plugin version 191.8593
• Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)
[✓] Connected device (2 available)
• iPhone 11 (mobile) • 519E686E-DEDD-4859-8D8D-EA775DB7149D • ios • com.apple.CoreSimulator.SimRuntime.iOS-14-5 (simulator)
• Chrome (web) • chrome • web-javascript • Google Chrome 91.0.4472.77
• No issues found!
Pubspec.yaml:
dependencies:
flutter:
sdk: flutter
cloud_firestore: ^2.2.2
country_code_picker: ^2.0.1
dropdown_formfield: ^0.1.3
file_picker: ^3.0.2+2
firebase_auth: ^1.4.1
firebase_core: ^1.3.0
firebase_storage: ^8.1.3
flat_segmented_control: ^0.1.0
flutter_dialogs: ^1.1.0
flutter_keyboard_visibility: ^5.0.2
flutter_radar_chart: ^0.2.0
flutter_riverpod: ^0.12.4 #^0.14.0+3
flutter_svg: ^0.22.0
google_fonts: ^2.1.0
image_picker: ^0.8.0+3
introduction_screen: ^2.1.0
modal_bottom_sheet: ^2.0.0
shimmer: ^2.0.0
video_player: ^2.1.6
youtube_player_flutter: ^8.0.0
EDIT: It seems to be coming from riverpod 0.12.4.
Updating it to the latest version generated another error but that requires code refactoring, I will update if the issue is resolved after the refactoring.
After reviewing every dependencies one by one I found the culprit.
The issue was coming from riverpod 0.12.4, updating it to the latest version fixed the issue.
In addition a refactor was necessary in order to make the app working and fix the breaking changes due to the new 0.14.0 version.
Github issue regarding riverpod
Migration guide

Flutter iOS App Rejected due to UIWebView are no longer accepted

I'm using latest Flutter version and latest plugins but still my app is rejecting due to
ITMS-90809: Deprecated API Usage - New apps that use UIWebView are no longer accepted. Instead, use WKWebView for improved security and reliability. Learn more (https://developer.apple.com/documentation/uikit/uiwebview).
Flutter Doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 2.2.2, on macOS 11.4 20F71 darwin-x64, locale
en-PK)
[!] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
✗ 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
[✓] Chrome - develop for the web
[✓] Android Studio (version 4.2)
[✓] VS Code (version 1.57.1)
[✓] Connected device (3 available)
pubspec.yaml file
version: 1.0.0+1
environment:
sdk: ">=2.7.0 <3.0.0"
dependencies:
flutter:
sdk: flutter
cupertino_icons: ^1.0.2
http: ^0.13.3
shared_preferences: ^2.0.6
flutter_rating_bar: ^3.2.0+1
dotted_border: ^2.0.0
image_picker: ^0.8.0+3
flutter_html: ^2.1.0
jiffy: ^4.1.0
geocoder: ^0.2.1
geolocator: ^7.1.0
url_launcher: ^6.0.6
flutter_facebook_login: ^3.0.0
android_intent: ^2.0.2
badges: ^1.1.6
google_static_maps_controller: ^0.4.1
percent_indicator: ^2.1.9
fluttertoast: ^7.1.6
async: ^2.4.2
multiselect_formfield: ^0.1.5
google_maps_flutter: ^2.0.6
firebase_core: ^1.3.0
firebase_messaging: ^10.0.2
firebase_auth: ^1.4.1
google_sign_in: ^5.0.4
flutter_twitter_login: ^1.1.0
data_connection_checker: ^0.3.4
social_share: ^2.1.1
screenshot: ^0.3.0
flutter_launcher_icons: ^0.9.0
html_editor_enhanced: ^2.1.1
webview_flutter: ^2.0.8
flutter_icons:
android: "launcher_icon"
ios: true
image_path: "assets/launcher_icon.png"
dev_dependencies:
flutter_test:
sdk: flutter
I searched it on xCode also, but it will not show any UIWebView.
Please help me in that, I'm facing this issue from couple of days.
Thank you please.
Well, that is a lot of dependencies you're relying on and some of those dependencies certainly use UIWebView. Flutter uses WKWebView and has completely migrated its APIs (the once that were using UIWebView) to WKWebView for IOS.
So, you need to find out which dependency you have out of the many there is actually still using UIWebView and remove it or replace it.
Edit: possible way to find the dependency causing issue is opening xCode, select the search tab on the left panel, and search UIWebView. See what packages there match your dependencies listed here.

Could not build the application for the simulator after adding cloud_firestore to pubspec Flutter

I added dependencies to my pubspec.yaml file and pubget ran without errors, then I entered flutter run and i got this error, before adding any of the dependencies the application ran fine on the ios emulator:
////////////////////////////////////////////////////
Launching lib/main.dart on iPhone X in debug mode...
Running pod install... 54.9s
Running Xcode build...
Xcode build done. 164.4s
Failed to build iOS app
Error output from Xcode build:
↳
** BUILD FAILED **
Xcode's output:
↳
/Users/kev/flutter/.pub-cache/hosted/pub.dartlang.org/cloud_firestore-0.12.11/ios/Cl
asses/CloudFirestorePlugin.m:155:24: error: no visible #interface for 'FIRQuery'
declares the selector 'queryWhereField:arrayContainsAny:'
query = [query queryWhereField:fieldName arrayContainsAny:value];
~~~~~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/kev/flutter/.pub-cache/hosted/pub.dartlang.org/cloud_firestore-0.12.11/ios/Cl
asses/CloudFirestorePlugin.m:157:24: error: no visible #interface for 'FIRQuery'
declares the selector 'queryWhereFieldPath:arrayContainsAny:'
query = [query queryWhereFieldPath:fieldPath arrayContainsAny:value];
~~~~~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/kev/flutter/.pub-cache/hosted/pub.dartlang.org/cloud_firestore-0.12.11/ios/Cl
asses/CloudFirestorePlugin.m:163:24: error: no visible #interface for 'FIRQuery'
declares the selector 'queryWhereField:in:'
query = [query queryWhereField:fieldName in:value];
~~~~~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/kev/flutter/.pub-cache/hosted/pub.dartlang.org/cloud_firestore-0.12.11/ios/Cl
asses/CloudFirestorePlugin.m:165:24: error: no visible #interface for 'FIRQuery'
declares the selector 'queryWhereFieldPath:in:'
query = [query queryWhereFieldPath:fieldPath in:value];
~~~~~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/kev/flutter/.pub-cache/hosted/pub.dartlang.org/cloud_firestore-0.12.11/ios/Cl
asses/CloudFirestorePlugin.m:764:16: warning: 'timestampsInSnapshotsEnabled' is
deprecated [-Wdeprecated-declarations]
settings.timestampsInSnapshotsEnabled =
(bool)call.arguments[#"timestampsInSnapshotsEnabled"];
^
In module 'FirebaseFirestore' imported from
/Users/kev/Documents/flutterprojects/shopapp/ios/Pods/Headers/Public/Firebase/Fireba
se.h:45:
/Users/kev/Documents/flutterprojects/shopapp/ios/Pods/FirebaseFirestore/Firestore/So
urce/Public/FIRFirestoreSettings.h:69:20: note: 'timestampsInSnapshotsEnabled' has
been explicitly marked deprecated here
__attribute__((deprecated));
^
1 warning and 4 errors generated.
note: Using new build systemnote: Planning buildnote: Constructing build description
Could not build the application for the simulator.
Error launching application on iPhone X.
/////////////////////////////////////////
this is what my pubspec file looks like:
dependencies:
flutter:
sdk: flutter
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cloud_firestore: ^0.12.11
cupertino_icons: ^0.1.2
firebase_core: ^0.4.2+1
firebase_analytics: ^5.0.6
firebase_auth: ^0.15.1
this is flutter doctor results:
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, v1.9.1+hotfix.6, on Mac OS X 10.13.6 17G9016, locale en-US)
[!] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
! Some Android licenses not accepted. To resolve this, run: flutter doctor
--android-licenses
[✓] Xcode - develop for iOS and macOS (Xcode 10.1)
[✓] Android Studio (version 3.5)
[✓] VS Code (version 1.40.2)
[✓] Connected device (1 available)
! Doctor found issues in 1 category.
Github issue link
In the Flutter terminal try this:
cd ios
pod update Firebase/Firestore
For me works perfectly after that.
1- Open xcode for the iOS project by clicking on Runner.xcworkspace file located in ios directory
2- Click Runner (on the left of the xcode)
3- Click on Build Settings tab (in the middle of xcode)
4- Change iOS Deployment Target to 12.1 for example
5- Save your action
6- Run flutter clean then run your app
From flutter terminal, try this:
flutter clean
cd ios
pod update Firebase/Firestore
Now flutter run will work as expected.

How to fix "pub get failed(1)"

i wanted to build a Flutter App which is using firestore. I implement Firestore and when i am click on "Packages get" this error came.
The current Dart SDK version is 2.1.0-dev.9.4.flutter-f9ebf21297.
Because kegel_app requires SDK version >=1.19.0 <2.0.0-dev.infinity, version solving failed.
pub get failed (1)
How can i fix this? :/
Pubspec.yaml
version: 1.0.0+1
environment:
sdk: ">=2.0.0-dev.68.0 <3.0.0"
dependencies:
flutter:
sdk: flutter
cupertino_icons: ^0.1.2
cloud_firestore: ^0.2.6
dev_dependencies:
flutter_test:
sdk: flutter
flutter:
uses-material-design: true
kegel_app is a dependency
Because kegel_app requires SDK version >=1.19.0 <2.0.0-dev.infinity"
this tells that this package depends on a very old Flutter version that used Dart 1 or Dart 2 pre-releases.
<2.0.0- (with - after the build number) means only Dart versions that are <2.0.0 or == 2.0.0 but pre-releases.
This package is not compatible with recent Flutter versions and needs to be updated.
kegel_app is your project
Change the SDK version constraint in pubspec.yaml to
environment:
sdk: ">=2.0.0-dev.68.0 <3.0.0"

Resources