vsCode doesn't run flutter app on physical iPhone - ios

I just installed the latest version of flutter and xcode and I'm getting an error when I try running the flutter app on an actual iPhone. Works on ios simulator. The weird thing is that it works when I run it from xcode, but when I run it from vsCode, I get the following error:
It appears that your application still contains the default signing identifier.
Try replacing 'com.example' with your signing id in Xcode:
open ios/Runner.xcworkspace
What I tried doing:
Change the bundle identifier to myEmailAddress#gmail.com.appTitle
Clean and build the ios app
clean then ran flutter build bundle
What am I doing wrong and how can I get vsCode to run the app on an iPhone?
Here's the full error:
Launching lib/main.dart on Jessica’s iPhone in debug mode...
Automatically signing iOS for device deployment using specified development team in Xcode project: ITYTO5RCWD
Xcode build done. 25.4s
Failed to build iOS app
Error output from Xcode build:
↳
2020-04-19 13:53:51.828 xcodebuild[2046:21215] [MT] iPhoneConnect: 📱<DVTiOSDevice ...> == Underlying device preparation errors ==
2020-04-19 13:53:51.828 xcodebuild[2046:21215] [MT] iPhoneConnect: Failed _shouldMakeReadyForDevelopment check even though device is not locked by passcode.
Domain: com.apple.platform.iphoneos
Code: 5
Failure Reason: allowsSecureServices: 1. isConnected: 0. Platform: <"...platform info...">. DTDKDeviceIdentifierIsIDID: 0
User Info: {
DVTDeviceDescription = "...device info..."
}
--
2020-04-19 13:53:51.829 xcodebuild[2046:21215] [MT] iPhoneConnect: 📱<"...platform info..."> == END: Underlying device preparation errors ==
** BUILD FAILED **
Xcode's output:
↳
/Users/Jessica/Development/flutter/.pub-cache/hosted/pub.dartlang.org/audioplayers-0.15.1/darwin/Classes/AudioplayersPlugin.m:88:37: warning: incompatible pointer types sending 'FlutterEngine *' to parameter of type 'NSObject<FlutterBinaryMessenger> * _Nonnull' [-Wincompatible-pointer-types]
binaryMessenger:_headlessEngine];
^~~~~~~~~~~~~~~
In module 'Flutter' imported from /Users/Jessica/Development/flutter/.pub-cache/hosted/pub.dartlang.org/audioplayers-0.15.1/darwin/Classes/AudioplayersPlugin.h:2:
/Users/Jessica/Desktop/flutter_game2/ios/Flutter/Flutter.framework/Headers/FlutterChannels.h:178:74: note: passing argument to parameter 'messenger' here
binaryMessenger:(NSObject<FlutterBinaryMessenger>*)messenger;
^
1 warning generated.
/Users/Jessica/Desktop/flutter_game2/build/ios/Debug-iphoneos/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 precompiled application for the device.
It appears that your application still contains the default signing identifier.
Try replacing 'com.example' with your signing id in Xcode:
open ios/Runner.xcworkspace
Error launching application on Jessica’s iPhone.
Exited (sigterm)

Alright, so i solved this problem by pressing on the search icon on the top left of vscode, then searching for com.example
then i saw three search results that were in the ios folder click on it and replace all three com.example with the identifier you created in xcode.

you can change your signing identifier in Xcode
To do that, just open your workspace with app in Xcode, then go to signing and capabilities to change default com.example to anything else...

Better to use as follows to give app company / organization name
flutter create --org com.yourdomain your_app_name
Swift, Kotlin, and androidx dependencies are the default options
After just open the created project in Android Studio or in VSCode
Parameter
--org com.yourcompany
will form applicationId for Android:
com.yourcompany.yourappname
and iOS PRODUCT_BUNDLE_IDENTIFIER:
com.yourcompany.yourAppName
To explore all possible parameters type
flutter create --help

Related

How to solve "Requested but did not find extension point with identifier Xcode.IDEKit.ExtensionSentinelHostApplications for extension"

I am trying to run an old project but its keep raising me this error.
Here's my error:
$flutter run
Changing current working directory to: /Users/cemilfatih/Desktop/readyProjects/Elektron-2-main
Launching lib/main.dart on iPhone SE (3rd generation) in debug mode...
Running Xcode build...
Xcode build done. 8.5s
Failed to build iOS app
Error output from Xcode build:
2023-02-16 11:28:11.882 xcodebuild[8152:68293] Requested but did not find extension point with identifier Xcode.IDEKit.ExtensionSentinelHostApplications for extension
Xcode.DebuggerFoundation.AppExtensionHosts.watchOS of plug-in com.apple.dt.IDEWatchSupportCore
2023-02-16 11:28:11.883 xcodebuild[8152:68293] Requested but did not find extension point with identifier Xcode.IDEKit.ExtensionPointIdentifierToBundleIdentifier for
extension Xcode.DebuggerFoundation.AppExtensionToBundleIdentifierMap.watchOS of plug-in com.apple.dt.IDEWatchSupportCore
** BUILD FAILED **
Xcode's output:
Writing result bundle at path:
/var/folders/q7/vdz85krd0b16dmvx5q0h91l00000gn/T/flutter_tools.Z7UJv2/flutter_ios_build_temp_dirl5lgbb/temporary_xcresult_bundle
../../../src/flutter/.pub-cache/hosted/pub.dartlang.org/fluttertoast-8.1.3/lib/fluttertoast.dart:165:28: Error: Member not found: 'Overlay.maybeOf'.
var _overlay = Overlay.maybeOf(context!);
^^^^^^^
../../../src/flutter/.pub-cache/hosted/pub.dartlang.org/fluttertoast-8.1.3/lib/fluttertoast.dart:154:18: Error: The getter 'mounted' isn't defined for the class
'BuildContext'.
- 'BuildContext' is from 'package:flutter/src/widgets/framework.dart' ('../../../src/flutter/packages/flutter/lib/src/widgets/framework.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'mounted'.
if (context?.mounted != true) {
^^^^^^^
Failed to package /Users/cemilfatih/Desktop/readyProjects/Elektron-2-main.
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/q7/vdz85krd0b16dmvx5q0h91l00000gn/T/flutter_tools.Z7UJv2/flutter_ios_build_temp_dirl5lgbb/temporary_xcresult_bundle
Could not build the application for the simulator. Error launching application on iPhone SE (3rd generation).
I've tried to reset pod file, change the runner target but none of them worked.

Xcode build fails and repetitive requires command line developer tools install

I have updated Xcode to Version 13.4.1 (13F100),
Then tried to run a flutter project
Launching lib/main.dart on iPhone SE (3rd generation) in debug mode...
Xcode build done. 2.9s
Failed to build iOS app
Error output from Xcode build:
↳
2022-06-11 12:51:51.546 xcodebuild[45221:416597] Requested but did not find extension point with identifier Xcode.IDEKit.ExtensionSentinelHostApplications for extension Xcode.DebuggerFoundation.AppExtensionHosts.watchOS of plug-in com.apple.dt.IDEWatchSupportCore
2022-06-11 12:51:51.547 xcodebuild[45221:416597] Requested but did not find extension point with identifier Xcode.IDEKit.ExtensionPointIdentifierToBundleIdentifier for extension Xcode.DebuggerFoundation.AppExtensionToBundleIdentifierMap.watchOS of plug-in com.apple.dt.IDEWatchSupportCore
2022-06-11 12:51:51.625 xcodebuild[45221:416597] [MT] DVTPlugInExtensionFaulting: Failed to fire fault for extension (null): (null)
2022-06-11 12:51:51.628 xcodebuild[45221:416597] [MT] DVTPlugInExtensionFaulting: Failed to fire fault for extension (null): (null)
** BUILD FAILED **
Xcode's output:
↳
Writing result bundle at path:
/var/folders/l6/zr2yb4p1787b1cbhjdn2ltvr0000gn/T/flutter_tools.tQVcwl/flutter_ios_build_temp_dirmZJ1FK/temporary_xcresult_bundle
note: Using new build system
note: Planning
note: Build preparation complete
note: Building targets in dependency order
error: failed to read asset tags: The command `(cd /Volumes/Code/Git/svg/ios && /usr/bin/actool --print-asset-tag-combinations --output-format xml1 /Volumes/Code/Git/svg/ios/Runner/Assets.xcassets)` exited with status 72. The command's standard error was:
actool: error: Failed to locate 'actool'.
xcode-select: Failed to locate 'actool', requesting installation of command line developer tools.
(in target 'Runner' from project 'Runner')
Result bundle written to path:
/var/folders/l6/zr2yb4p1787b1cbhjdn2ltvr0000gn/T/flutter_tools.tQVcwl/flutter_ios_build_temp_dirmZJ1FK/temporary_xcresult_bundle
Error (Xcode): failed to read asset tags: The command `(cd /Volumes/Code/Git/svg/ios && /usr/bin/actool --print-asset-tag-combinations --output-format xml1 /Volumes/Code/Git/svg/ios/Runner/Assets.xcassets)` exited with status 72. The command's standard error was:
actool: error: Failed to locate 'actool'.
xcode-select: Failed to locate 'actool', requesting installation of command line developer tools.
Could not build the application for the simulator.
Error launching application on iPhone SE (3rd generation).
Exited
with an alert
The "actool" command requires the command line developer tools. Would
you like to install the tools now?
And if I run it from Xcode it gives me this error:
Showing All Messages
failed to read asset tags: The command `(cd /Volumes/Code/Git/svg/ios && /usr/bin/actool --print-asset-tag-combinations --output-format xml1 /Volumes/Code/Git/svg/ios/Runner/Assets.xcassets)` exited with status 72. The command's standard error was:
actool: error: Failed to locate 'actool'.
xcode-select: Failed to locate 'actool', requesting installation of command line developer tools.
This repetitively occurs even if I press the "Install" button.
Same issue here, but with git instead of actool. Another coworker just also got this but with clang... what is going on over at apple?
What just fixed mine was actually opening up xcode and having it run its installer there instead of allowing the automatic pop-up to continue to "install" and then ask again in a few minutes.

Unable to run Flutter App on iOS when using Firebase. Android seems to be working but iOS throws multiple errors

So I followed the instructions on adding Firebase to Flutter and although things work on Android, I am unable to build on the ios emulator. I get some xcode errors. I have tried deleting both ios/Pods directory and the Podfile.lock file, then using the flutter clean command. But I still get these errors. I have tried doing research but nothing I have found has helped. Here are the errors i get when I try to test on the iOS emulator.
Thank you in advance for the help.
Errors From Flutter Run:
Launching lib/main.dart on iPhone 12 Pro Max in debug mode...
Running pod install...
Running Xcode build...
Xcode build done. 130.2s
Failed to build iOS app
Error output from Xcode build:
↳
2021-03-26 18:45:52.768 xcodebuild[15465:79135] DVTAssertions: Warning in /Library/Caches/com.apple.xbs/Sources/DVTiOSFrameworks/DVTiOSFrameworks-17705/DTDeviceKitBase/DTDKRemoteDeviceData.m:371
Details: (null) deviceType from 00008101-001945163408001E was NULL when -platform called.
Object: <DTDKMobileDeviceToken: 0x7f963f7d3f80>
Method: -platform
Thread: <NSThread: 0x7f963b713cc0>{number = 3, name = (null)}
Please file a bug at https://feedbackassistant.apple.com with this warning message and any useful information you can provide.
2021-03-26 18:45:52.947 xcodebuild[15465:79134] DVTAssertions: Warning in /Library/Caches/com.apple.xbs/Sources/DVTiOSFrameworks/DVTiOSFrameworks-17705/DTDeviceKitBase/DTDKRemoteDeviceData.m:371
Details: (null) deviceType from 00008101-001945163408001E was NULL when -platform called.
Object: <DTDKMobileDeviceToken: 0x7f963f7d3f80>
Method: -platform
Thread: <NSThread: 0x7f963f725360>{number = 7, name = (null)}
Please file a bug at https://feedbackassistant.apple.com with this warning message and any useful information you can provide.
** BUILD FAILED **
Xcode's output:
↳
While building module 'firebase_core' imported from /Users/dev/development/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_auth-1.0.1/ios/Classes/FLTFirebaseAuthPlugin.m:5:
In file included from <module-includes>:1:
In file included from /Users/dev/AndroidStudioProjects/aul/ios/Pods/Target Support Files/firebase_core/firebase_core-umbrella.h:13:
In file included from /Users/dev/development/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_core-1.0.2/ios/Classes/FLTFirebaseCorePlugin.h:11:
/Users/dev/development/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_core-1.0.2/ios/Classes/FLTFirebasePlugin.h:9:9: error: include of non-modular header inside framework module 'firebase_core.FLTFirebasePlugin': '/Users/dev/AndroidStudioProjects/aul/ios/Pods/Headers/Public/FirebaseCore/FirebaseCore.h' [-Werror,-Wnon-modular-include-in-framework-module]
#import <FirebaseCore/FirebaseCore.h>
^
1 error generated.
/Users/dev/development/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_auth-1.0.1/ios/Classes/FLTFirebaseAuthPlugin.m:5:9: fatal error: could not build module 'firebase_core'
#import <firebase_core/FLTFirebasePluginRegistry.h>
~~~~~~~^
2 errors generated.
note: Using new build system
note: Building targets in parallel
note: Planning build
note: Constructing build description
warning: Capabilities for Signing & Capabilities may not function correctly because its entitlements use a placeholder team ID. To resolve this, select a development team in the Runner editor. (in target 'Runner' from project 'Runner')
Could not build the application for the simulator.
Error launching application on iPhone 12 Pro Max.
Errors from Xcode:
/Users/dev/AndroidStudioProjects/aul/build/ios/Debug-iphonesimulator/firebase_core/firebase_core.framework/Headers/FLTFirebasePlugin.h:9:9: Include of non-modular header inside framework module 'firebase_core.FLTFirebasePlugin': '/Users/dev/AndroidStudioProjects/aul/ios/Pods/Headers/Public/FirebaseCore/FirebaseCore.h'
/Users/dev/AndroidStudioProjects/aul/build/ios/Debug-iphonesimulator/firebase_auth/firebase_auth.framework/Headers/FLTFirebaseAuthPlugin.h:12:9: Could not build module 'firebase_core'
/Users/dev/AndroidStudioProjects/aul/ios/Runner/GeneratedPluginRegistrant.m:8:9: Could not build module 'firebase_auth'
In my iOS/Runner/AppDelegate.swift file I was initiating Firebase there, which is not needed. I also added the the firebase pod plugins to my Podfile. Once I removed these things it started to work.

Flutter - Codemagic - IOS build fail

I'm trying to build an app for IOS made with Flutter.
I have no mac device to do the job so I'm trying to generate my IPA file from codemagic.io .
I created an account for Apple Developer Program and paid the bill.
I followed the instructions for using Codemagic, including instructions for iOS code signing : https://docs.codemagic.io/code-signing/ios-code-signing/ .
I created a repository on GitHub and generated a configuration file (codemagic.yaml).
So when I try to build my app (release version), I have the following problem:
Building iOS
1m 23s
== Building for iOS ==
> /usr/local/bin/flutter build ios --release --no-codesign
/Users/builder/clone/ios/Runner/Info.plist: Property List error: Found non-key inside <dict> at line 44 / JSON error: JSON text did not start with array or object and option to allow fragments not set.
Warning: Building for device with codesigning disabled. You will have to manually codesign before deploying to device.
Building fr.remax.franckehrart for device (ios-release)...
Project base configurations detected, removing.
Running pod install...
6.2s
/Users/builder/clone/ios/Runner/Info.plist: Property List error: Found non-key inside <dict> at line 44 / JSON error: JSON text did not start with array or object and option to allow fragments not set.
Running Xcode build...
Xcode build done. 48.3s
Failed to build iOS app
Error output from Xcode build:
↳
** BUILD FAILED **
Xcode's output:
↳
../programs/flutter/.pub-cache/hosted/pub.dartlang.org/neumorphic-0.3.2/lib/src/components/selection_controls.dart:182:10: Error: The method '_NeuSelectionControls.buildToolbar' has fewer positional arguments than those of overridden method 'TextSelectionControls.buildToolbar'.
Widget buildToolbar(
^
../programs/flutter/packages/flutter/lib/src/widgets/text_selection.dart:136:10: Context: This is the overridden method ('buildToolbar').
Widget buildToolbar(
^
../programs/flutter/.pub-cache/hosted/pub.dartlang.org/neumorphic-0.3.2/lib/src/components/selection_controls.dart:222:59: Error: Too few positional arguments: 2 required, 1 given.
handleCopy: canCopy(delegate) ? () => handleCopy(delegate) : null,
^
Command PhaseScriptExecution failed with a nonzero exit code
note: Using new build system
note: Building targets in parallel
note: Planning build
note: Constructing build description
Encountered error while building for device.
Build failed :|
Failed to build for iOS
I don't understand. Is it a problem with code signing ?
On my Apple Developer Account I can see that a certificate has been generated.
The previous step on Codemagic seems to be ok :
== Fetch code signing files from Apple Developer Portal ==
Automatically detected bundle identifier "fr.remax.franckehrart" from project
Fetch App Store signing files for bundle identifier "fr.remax.franckehrart"
Initializing Apple Developer Portal session with david.matoska#gmail.com
Using Apple Developer Portal team david matoska (HBD2Z7384F) to fetch signing files
Found App ID "fr remax franckehrart" for bundle identifier "fr.remax.franckehrart"
Found code signing certificate "Apple Push Services: fr.remax.franckehrart"
Found code signing certificate "iOS Distribution: david matoska"
Found iOS Distribution provisioning profile "fr remax franckehrart app_store 1597698130"
> keychain initialize
Initialize new keychain to store code signing certificates at /var/folders/r7/d9twdq011sb8d3q1p8f39cdr0000gn/T/build_4qw6y93s.keychain
Create keychain /var/folders/r7/d9twdq011sb8d3q1p8f39cdr0000gn/T/build_4qw6y93s.keychain
Set keychain /var/folders/r7/d9twdq011sb8d3q1p8f39cdr0000gn/T/build_4qw6y93s.keychain timeout to "no timeout"
Set keychain /var/folders/r7/d9twdq011sb8d3q1p8f39cdr0000gn/T/build_4qw6y93s.keychain to system default keychain
Unlock keychain /var/folders/r7/d9twdq011sb8d3q1p8f39cdr0000gn/T/build_4qw6y93s.keychain
> keychain add-certificates --certificate /tmp/aps_uiasoh6i.p12 --certificate-password #env:CERTIFICATE_PASSWORD
Add certificates to keychain /private/var/folders/r7/d9twdq011sb8d3q1p8f39cdr0000gn/T/build_4qw6y93s.keychain
Searching for files matching /tmp/aps_uiasoh6i.p12
Add certificate /tmp/aps_uiasoh6i.p12 to keychain /private/var/folders/r7/d9twdq011sb8d3q1p8f39cdr0000gn/T/build_4qw6y93s.keychain
1 identity imported.
> keychain add-certificates --certificate /tmp/ios_distribution_ln2czakc.p12 --certificate-password #env:CERTIFICATE_PASSWORD
Add certificates to keychain /private/var/folders/r7/d9twdq011sb8d3q1p8f39cdr0000gn/T/build_4qw6y93s.keychain
Searching for files matching /tmp/ios_distribution_ln2czakc.p12
Add certificate /tmp/ios_distribution_ln2czakc.p12 to keychain /private/var/folders/r7/d9twdq011sb8d3q1p8f39cdr0000gn/T/build_4qw6y93s.keychain
1 identity imported.
== Install Flutter dependencies ==
> /usr/local/bin/flutter packages pub get
Resolving dependencies...
> async 2.4.2 (was 2.4.1) (2.5.0-nullsafety available)
+ characters 1.0.0 (1.1.0-nullsafety.2 available)
+ clock 1.0.1 (1.1.0-nullsafety available)
> collection 1.14.13 (was 1.14.12) (1.15.0-nullsafety.2 available)
+ fake_async 1.1.0 (1.2.0-nullsafety available)
> matcher 0.12.8 (was 0.12.6) (0.12.9 available)
> path 1.7.0 (was 1.6.4) (1.8.0-nullsafety available)
> stack_trace 1.9.5 (was 1.9.3) (1.10.0-nullsafety available)
> test_api 0.2.17 (was 0.2.15) (0.2.18 available)
> typed_data 1.2.0 (was 1.1.6) (1.3.0-nullsafety.2 available)
These packages are no longer being depended on:
- quiver 2.1.3
Downloading flutter_rename_app 1.0.0...
Downloading flutter_launcher_icons 0.7.5...
Downloading neumorphic 0.3.2...
Downloading curved_navigation_bar 0.3.3...
Downloading ansicolor 1.0.2...
Downloading process_run 0.10.12+1...
Downloading image 2.1.12...
Downloading xml 3.6.1...
Downloading petitparser 2.4.0...
Downloading crypto 2.1.4...
Changed 11 dependencies!
Can you please help me ?
So ... It worked :) !!!!!!
I had to change my pubspec.yaml file.
I took the 0.4.0 version of Neumorphic (versus 0.3.2 version).
#Captivity , thank you again for your help with the info.plist file.
Bye.
Okey, Your 'key' UIViewControllerBasedStatusBarAppearance there is no assigned value.

Flutter.io (dart) app fails to launch on iOS simulator

I have up-to-date OSX Sierra, up-to-date XCode with applicable plugins, and an iPhone 6 simulator open and ready.
I have followed all the directions at https://flutter.io/setup-macos/#ios-setup.
When I "flutter run" from Terminal, the app fails to install on the simulator with message:
Could not build the application for the simulator.
Error launching application on iPhone 6.
Here is what Terminal said...
Launching lib/main.dart on iPhone 6 in debug mode...
Running pod install... 8.5s
Running Xcode build... 24.1s
Failed to build iOS app
Error output from Xcode build:
↳
2017-11-22 13:13:38.122 xcodebuild[47659:25935636] DVTAssertions: Warning in /Library/Caches/com.apple.xbs/Sources/IDEXcode3ProjectSupport/IDEXcode3ProjectSupport-13510/Xcode3Core/LegacyProjects/Frameworks/DevToolsCore/DevToolsCore/BuildSystem/Runtime/PBXTargetBuildContext.mm:757
Details: unexpected successful exit code from cancelled command <C0009:'CpResource app.flx':P12>
Object: <PBXTargetBuildContext: 0x7fccf1235200>
Method: -createCommandInvocationRecordFromInvocation:
Thread: <NSThread: 0x7fccf2847ea0>{number = 16, name = (null)}
Please file a bug at http://bugreport.apple.com with this warning message and any useful information you can provide.
** BUILD FAILED **
The following build commands failed:
CopyPlistFile /Users/deborah/Desktop/chq_emulator/build/ios/Debug-iphonesimulator/Runner.app/GoogleService-Info.plist Runner/GoogleService-Info.plist
(1 failure)
Xcode's output:
↳
Build settings from command line:
ARCHS = x86_64
BUILD_DIR = /Users/deborah/Desktop/chq_emulator/build/ios
ONLY_ACTIVE_ARCH = YES
SDKROOT = iphonesimulator11.1
=== CLEAN TARGET leveldb-library OF PROJECT Pods WITH CONFIGURATION Debug ===
... list of subsidiary infomation ...
Could not build the application for the simulator.
Error launching application on iPhone 6.
Anyone else out there with advice for how to get Flutter going on the simulator?
Try running your Xcode first and make sure that it's up-to-date. Open the {flutter_project}/ios build on Xcode then try to run the iOS project on the Simulator from there.
If you're still having issues, you can run this command on your Terminal. This should set the path for the active developer directory.
sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer

Resources