Flutter - Xcode can't see app packages while building for Simulator - ios

Whenever I try running my app Xcode gives me this:
Launching lib/main.dart on iPhone 14 Pro Max in debug mode...
lib/main.dart:1
Xcode build done. 9.9s
Failed to build iOS app
Error output from Xcode build:
↳
** BUILD FAILED **
Xcode's output:
↳
Writing result bundle at path:
/var/folders/4m/6ntf71vx17qfqdg9kr88s2s80000gn/T/flutter_tools.V6z5EC/flutter_ios_build_temp_dirX4Qj6c/temporary_xcresult_bundle
: Error: The getter 'payload' isn't defined for the class 'NotificationAppLaunchDetails'.
lib/main.dart:57
- 'NotificationAppLaunchDetails' is from 'package:flutter_local_notifications_platform_interface/src/types.dart' ('../../flutter/.pub-cache/hosted/pub.dartlang.org/flutter_local_notifications_platform_interface-6.0.0/lib/src/types.dart').
package:flutter_local_notifications_platform_interface/src/types.dart:1
Try correcting the name to the name of an existing getter, or defining a getter or field named 'payload'.
_orderID = (notificationAppLaunchDetails.payload != null &&
^^^^^^^
: Error: The getter 'payload' isn't defined for the class 'NotificationAppLaunchDetails'.
lib/main.dart:58
- 'NotificationAppLaunchDetails' is from 'package:flutter_local_notifications_platform_interface/src/types.dart' ('../../flutter/.pub-cache/hosted/pub.dartlang.org/flutter_local_notifications_platform_interface-6.0.0/lib/src/types.dart').
package:flutter_local_notifications_platform_interface/src/types.dart:1
Try correcting the name to the name of an existing getter, or defining a getter or field named 'payload'.
notificationAppLaunchDetails.payload.isNotEmpty)
^^^^^^^
: Error: The getter 'payload' isn't defined for the class 'NotificationAppLaunchDetails'.
lib/main.dart:59
- 'NotificationAppLaunchDetails' is from 'package:flutter_local_notifications_platform_interface/src/types.dart' ('../../flutter/.pub-cache/hosted/pub.dartlang.org/flutter_local_notifications_platform_interface-6.0.0/lib/src/types.dart').
package:flutter_local_notifications_platform_interface/src/types.dart:1
Try correcting the name to the name of an existing getter, or defining a getter or field named 'payload'.
? int.parse(notificationAppLaunchDetails.payload)
^^^^^^^
: Error: The getter 'WebView' isn't defined for the class '_PaymentScreenState'.
package:flutter_sixvalley_ecommerce/…/payment/payment_screen.dart:46
- '_PaymentScreenState' is from 'package:flutter_sixvalley_ecommerce/view/screen/payment/payment_screen.dart' ('lib/view/screen/payment/payment_screen.dart').
package:flutter_sixvalley_ecommerce/…/payment/payment_screen.dart:1
.
. (goes on like this for the rest of the packages)
.
Failed to package /Users/abdelrahmanmohamed/development/FlutterProjects/valley_userapp.
Command PhaseScriptExecution failed with a nonzero exit code
note: Building targets in dependency order
warning: Run script build phase 'Run Script' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'Runner' from project 'Runner')
warning: Run script build phase 'Thin Binary' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'Runner' from project 'Runner')
Result bundle written to path:
/var/folders/4m/6ntf71vx17qfqdg9kr88s2s80000gn/T/flutter_tools.V6z5EC/flutter_ios_build_temp_dirX4Qj6c/temporary_xcresult_bundle
Could not build the application for the simulator.
Error launching application on iPhone 14 Pro Max.
Exited
No matter how much I do flutter clean and arch -x86_64 pod install. It keeps doing this.
I am using a mac silicon machine. And this is a project I didn't run before on it. So its new.
I am using Flutter 3.3.10. And I am able to build and run other Flutter apps.

So running dat analyze as #Alaindeseine suggested revealed in the code editor that these were actually errors in code.
The assets were old and when I updated them it didn't reflect in the code editor.

You can use dart anayze command to display info, warnings, errors and deprecateds. It may help finding what is going wrong with you code.
You can alos use dart fix --dry-runcommand to list and dart fix --apply to fix problems.

Related

Error build ipa from android studio, but work well on xcode

i need to build .ipa fila from flutter project on my Macbook.
I always get error when run build .ipa from android studio, but when i try on xcode it can success build and export .ipa file.
This is error log for that :
rahmad#Rahmads-MacBook-Air ios % flutter build ipa --flavor dev -t lib/main_dev.dart
Changing current working directory to: /Users/rahmad/work/mantra-flutter-enterprise
💪 Building with sound null safety 💪
Archiving com.cdn.mantra.dev...
Automatically signing iOS for device deployment using specified development team in Xcode project: J8FAKZW
Running pod install... 2,147ms
Running Xcode build...
Xcode archive done. 37.3s
Failed to build iOS app
Error output from Xcode build:
↳
** ARCHIVE FAILED **
Xcode's output:
↳
Writing result bundle at path:
/var/folders/kp/vm23k0rx5r7cwwn73dmdcs640000gn/T/flutter_tools.xjy4ef/flutter_ios_build_temp_dirpFWZuS/temporary_xcresult_bundle
/var/folders/kp/vm23k0rx5r7cwwn73dmdcs640000gn/T/SchemeScriptAction-GQ6JxC.sh: line 3: /.envfile: Read-only file system
/var/folders/kp/vm23k0rx5r7cwwn73dmdcs640000gn/T/SchemeScriptAction-GQ6JxC.sh: line 4: /.symlinks/plugins/flutter_config/ios/Classes/BuildXCConfig.rb: No such file or directory
/Users/rahmad/work/mantra-flutter-enterprise/ios/Pods/TOCropViewController/Objective-C/TOCropViewController/TOCropViewController.m:87:14: warning: 'automaticallyAdjustsScrollViewInsets' is deprecated: first deprecated in iOS 11.0 - Use UIScrollView's contentInsetAdjustmentBehavior instead
[-Wdeprecated-declarations]
self.automaticallyAdjustsScrollViewInsets = NO;
^
In module 'UIKit' imported from /Users/rahmad/work/mantra-flutter-enterprise/ios/Pods/Target Support Files/TOCropViewController/TOCropViewController-prefix.pch:2:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIViewController.h:260:34: note: 'automaticallyAdjustsScrollViewInsets' has been explicitly marked deprecated here
#property(nonatomic,assign) BOOL automaticallyAdjustsScrollViewInsets API_DEPRECATED("Use UIScrollView's contentInsetAdjustmentBehavior instead", ios(7.0,11.0),tvos(7.0,11.0)); // Defaults to YES
^
/Users/rahmad/work/mantra-flutter-enterprise/ios/Pods/TOCropViewController/Objective-C/TOCropViewController/TOCropViewController.m:1299:36: warning: 'topLayoutGuide' is deprecated: first deprecated in iOS 11.0 - Use view.safeAreaLayoutGuide.topAnchor instead of topLayoutGuide.bottomAnchor
[-Wdeprecated-declarations]
statusBarHeight = self.topLayoutGuide.length;
^
In module 'UIKit' imported from /Users/rahmad/work/mantra-flutter-enterprise/ios/Pods/Target Support Files/TOCropViewController/TOCropViewController-prefix.pch:2:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIViewController.h:505:58: note: 'topLayoutGuide' has been explicitly marked deprecated here
#property(nonatomic,readonly,strong) id<UILayoutSupport> topLayoutGuide API_DEPRECATED("Use view.safeAreaLayoutGuide.topAnchor instead of topLayoutGuide.bottomAnchor", ios(7.0,11.0), tvos(7.0,11.0));
^
2 warnings generated.
/Users/rahmad/work/mantra-flutter-enterprise/ios/Pods/DKPhotoGallery/DKPhotoGallery/DKPhotoGalleryContentVC.swift:39:52: warning: using 'class' keyword to define a class-constrained protocol is deprecated; use 'AnyObject' instead
internal protocol DKPhotoGalleryContentDataSource: class {
^~~~~
AnyObject
/Users/rahmad/work/mantra-flutter-enterprise/ios/Pods/DKPhotoGallery/DKPhotoGallery/DKPhotoGalleryContentVC.swift:55:50: warning: using 'class' keyword to define a class-constrained protocol is deprecated; use 'AnyObject' instead
internal protocol DKPhotoGalleryContentDelegate: class {
^~~~~
AnyObject
/Users/rahmad/work/mantra-flutter-enterprise/ios/Pods/DKPhotoGallery/DKPhotoGallery/DKPhotoGalleryContentVC.swift:107:14: warning: 'automaticallyAdjustsScrollViewInsets' was deprecated in iOS 11.0: Use UIScrollView's contentInsetAdjustmentBehavior instead
self.automaticallyAdjustsScrollViewInsets = false
^
/Users/rahmad/work/mantra-flutter-enterprise/ios/Pods/DKImagePickerController/Sources/DKImagePickerController/View/DKAssetGroupDetailVC.swift:344:14: warning: 'frameInterval' was deprecated in iOS 10.0: preferredFramesPerSecond
link.frameInterval = 1
^
/Users/rahmad/work/master/flutter3_0_0/flutter/.pub-cache/hosted/pub.dartlang.org/file_picker-4.6.1/ios/Classes/FilePickerPlugin.m:357:1: warning: implementing deprecated method [-Wdeprecated-implementations]
- (void)documentPicker:(UIDocumentPickerViewController *)controller didPickDocumentAtURL:(NSURL *)url{
^
In module 'UIKit' imported from /Users/rahmad/work/mantra-flutter-enterprise/ios/Pods/Target Support Files/file_picker/file_picker-prefix.pch:2:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIDocumentPickerViewController.h:27:1: note: method 'documentPicker:didPickDocumentAtURL:' declared here
- (void)documentPicker:(UIDocumentPickerViewController *)controller didPickDocumentAtURL:(NSURL *)url API_DEPRECATED_WITH_REPLACEMENT("documentPicker:didPickDocumentsAtURLs:", ios(8.0, 11.0));
^
1 warning generated.
/Users/rahmad/work/master/flutter3_0_0/flutter/.pub-cache/hosted/pub.dartlang.org/file_picker-4.6.1/ios/Classes/FileUtils.m:133:30: warning: unused variable 'exportError' [-Wunused-variable]
NSError *exportError = exporter.error;
^
1 warning generated.
../master/flutter3_0_0/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_core-2.4.0/lib/src/firebase_app.dart:18:25: Error: Member not found: 'FirebaseAppPlatform.verifyExtends'.
FirebaseAppPlatform.verifyExtends(_delegate);
^^^^^^^^^^^^^
../master/flutter3_0_0/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_messaging-14.2.0/lib/src/messaging.dart:128:22: Error: A value of type 'Future<bool>' can't be returned from a function with return type 'bool'.
- 'Future' is from 'dart:async'.
return _delegate.isSupported();
^
Failed to package /Users/rahmad/work/mantra-flutter-enterprise.
Command PhaseScriptExecution failed with a nonzero exit code
note: Building targets in dependency order
warning: Run script build phase 'Run Script' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target
'Runner' from project 'Runner')
warning: Run script build phase 'Thin Binary' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in
target 'Runner' from project 'Runner')
warning: Run script build phase 'Copy GoogleInfoPlist' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase.
(in target 'Runner' from project 'Runner')
Result bundle written to path:
/var/folders/kp/vm23k0rx5r7cwwn73dmdcs640000gn/T/flutter_tools.xjy4ef/flutter_ios_build_temp_dirpFWZuS/temporary_xcresult_bundle
Uncategorized (Xcode): Exited with status code 127
Encountered error while archiving for device.
I have 2 weeks for try solving this, but still not have solution.
I hope you can help me to build .ipa from android studio successfully.

How come flutter build ios --obfuscate --split-debug-info= failed with warnings, but flutter build ios works?

Please know that flutter build ios works perfectly without any warning or error.
But when I do flutter build ios --obfuscate --split-debug-info=/_app/obfuscate
it failed with this error :
Building com.x.app for device (ios-release)...
Automatically signing iOS for device deployment using specified development team in Xcode project: YSHDK23K
Running pod install...                                             18.9s
Running Xcode build...                                                  
                                                   
Xcode build done.                                           515.9s
Failed to build iOS app
Error output from Xcode build:
↳
    ** BUILD FAILED **
Xcode's output:
↳
   /_app/ios/Pods/libwebp/src/dsp/dec_neon.c:1462:38: warning:
    variable 'sum_left' may be uninitialized when used here [-Wconditional-uninitialized]
        const uint16x8_t sum = vaddq_u16(sum_left, sum_top);
                                         ^~~~~~~~
   /_app/ios/Pods/libwebp/src/dsp/dec_neon.c:1426:3: note: variable
    'sum_left' is declared here
      uint16x8_t sum_left;
      ^
   /_app/ios/Pods/libwebp/src/dsp/dec_neon.c:1462:48: warning:
    variable 'sum_top' may be uninitialized when used here [-Wconditional-uninitialized]
        const uint16x8_t sum = vaddq_u16(sum_left, sum_top);
                                                   ^~~~~~~
   /_app/ios/Pods/libwebp/src/dsp/dec_neon.c:1425:3: note: variable
    'sum_top' is declared here
      uint16x8_t sum_top;
     
...... ======= <Warnings Truncated> ========= .......
    /Applications/flutter/.pub-cache/hosted/pub.flutter-io.cn/flutter_image_compress-0.6.5+1/ios/Classes/SYP
    ictureMetadata/SYMetadataExif.m:9:9: warning: non-portable path to file '"SYMetadataExif.h"'; specified path differs in
    case from file name on disk [-Wnonportable-include-path]
    #import "SYMetadataEXIF.h"
            ^~~~~~~~~~~~~~~~~~
            "SYMetadataExif.h"
    1 warning generated.
    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.
I got an error from Stackoverflow thus cannot submit without truncating the warnings, thus I cut it off in the middle. If you need more of those warnings please ask me and I will send it to you..
What am I missing here? The app and all works fine even in release mode. It is only when I add the --obfuscate flag it is like this.
Finally I solved this problem. But the solution is tedious and I'm not sure if this is the best solution. But I think this is the robust solution:
Delete Flutter entirely from your computer
Reinstall flutter with the latest version.
In the ios folder of your project directory, delete "Podfile" file, "Podfile.lock" file, and "Pods" directory.
Do flutter clean in your project directory.
Then rerun the app as intended.
Then it works... at least for me.
Anyone else has other solution?
Clean all unwanted files,
run this command from a terminal
flutter clean && rm ios/Podfile ios/Podfile.lock pubspec.lock && rm -rf ios/Pods ios/Runner.xcworkspace

vsCode doesn't run flutter app on physical iPhone

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

React Native: Bundle Identifier does not exist

I have a project in React Native that has two different build schemes and uses cocoapods. To compile it I run:
react-native run-ios --scheme="RNProject-(SCHEME_NAME)"
The resulting apps are for example:
./build/Build/Products/Debug/iphonesimulator/RNProject-customer1.app
./build/Build/Products/Debug/iphonesimulator/RNProject-customer2.app
Using the command it builds for one of the build schemes, but not for the other
Xcode always builds the project for both build schemes
Furthermore, build/Build/Products/Debug-iphonesimulator/RNProject-customer1.app/Info.plist exists in that path and the file contains valid CFBundleIdentifier (it matches General > Identity > Bundle Identifier for each of the two build schemes)
Project settings seem to be correct for both schemes (after checking ios/RNProject.xcodeproj/project.pbxproj)
Schema-specific settings are located in ios/Pods/Target Support Files/Pods-RNProject-customer1 and ios/Pods/Target Support Files/Pods-RNProject-customer2
I tried different ways to solve it:
Running sudo react-native
Restarting RN packager
Manually editing Info.plist
Changing build locations
Console:
** BUILD SUCCEEDED **
Installing build/Build/Products/Debug-iphonesimulator/RNProject.app
An error was encountered processing the command (domain=NSPOSIXErrorDomain, code=2):
Failed to install the requested application
An application bundle was not found at the provided path.
Provide a valid path to the desired application bundle.
Print: Entry, ":CFBundleIdentifier", Does Not Exist
child_process.js:509
throw err;
^
Error: Command failed: /usr/libexec/PlistBuddy -c Print:CFBundleIdentifier build/Build/Products/Debug-iphonesimulator/RNProject.app/Info.plist
Print: Entry, ":CFBundleIdentifier", Does Not Exist
at checkExecSyncError (child_process.js:486:13)
at Object.execFileSync (child_process.js:506:13)
at ChildProcess.xcodeBuildProcess.on.code (node_modules/react-native/local-cli/runIOS/runIOS.js:109:36)
at emitTwo (events.js:106:13)
at ChildProcess.emit (events.js:191:7)
at maybeClose (internal/child_process.js:852:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:215:5)
The problem was with how React Native names labels the executable files.
My Xcode project created two executable files with different names based on Xcode project settings.
React Native on the other hand forms the executable filename from .xcworkspace filename in this script (./node_modules/react-native/local-cli/runIOS/runIOS.js:57):
const inferredSchemeName = path.basename(xcodeProject.name, path.extname(xcodeProject.name));
The two approaches are different and lead to two different executable file names (e.g. Xcode build/Build/Products/Debug-iphonesimulator/RNProject-customer1.app vs React Native build/Build/Products/Debug-iphonesimulator/RNProject.app).
I had set custom value for inferredSchemeNameto match the filename created by Xcode.
My solution is similar:
open ./node_modules/react-native/local-cli/runIOS.js file
change the build path from:
const getBuildPath = function(configuration = 'Debug', appName, isDevice) {
return `build/Build/Products/${configuration}-${isDevice ? 'iphoneos' : 'iphonesimulator'}/${appName}.app`;
};
to
const getBuildPath = function(configuration = 'Debug', appName, isDevice) {
return `build/Build/Products/${configuration}-${isDevice ? 'iphoneos' : 'iphonesimulator'}/${appName}.app`;
};
remove "Build" in the path.
I'm using Xcode-beta 8.2

Project stops building when adding a new test target

I want to create a test target for my app
Before adding the test target, the app builds and runs fine
When I add the test target this is what is displayed when i try to build
GenerateDSYMFile /Users/dev1/Library/Developer/Xcode/DerivedData/MyApp-apigviljomlmendsdvrgealzkevw/Build/Products/Debug-iphoneos/MyApp\
Tests.xctest.dSYM
/Users/dev1/Library/Developer/Xcode/DerivedData/MyApp-apigviljomlmendsdvrgealzkevw/Build/Products/Debug-iphoneos/MyApp\
Tests.xctest/MyApp\ Tests
cd /Users/dev1/Dev/IOSworkspace/MyApp
export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/dsymutil
/Users/dev1/Library/Developer/Xcode/DerivedData/MyApp-apigviljomlmendsdvrgealzkevw/Build/Products/Debug-iphoneos/MyApp\
Tests.xctest/MyApp\ Tests -o
/Users/dev1/Library/Developer/Xcode/DerivedData/MyApp-apigviljomlmendsdvrgealzkevw/Build/Products/Debug-iphoneos/MyApp\
Tests.xctest.dSYM
error: unable to open executable '/Users/dev1/Library/Developer/Xcode/DerivedData/MyApp-apigviljomlmendsdvrgealzkevw/Build/Products/Debug-iphoneos/MyApp
Tests.xctest/MyApp Tests'
How do I fix it ?
The answer is... :
The Mach-O Linker flag in the test target was set to "executable" instead of "bundle".
as found on this page: https://stackoverflow.com/a/19325817/2136812

Resources