Flutter firebase_admob not working on iOS with default app install - ios

Steps to reproduce:
create a default app in Android Studio
build and run the app successfully in iOS simulator through Android Studio
add dependency firebase_admob: ^0.9.0+2 in pubspec.yaml
app builds successfully but crashes on startup
follow instructions to add GADApplicationIdentifier with test ID code into ios/Runner/info.plist file
The app still crashes on startup. Instructions were followed for setting up on iOS as detailed here: https://pub.dev/packages/firebase_admob.
As far as I can see, I've done everything as instructed so no idea why it doesn't work with a default app.
The error I get after all steps above is:
Xcode build done. 8.5s
Configuring the default Firebase app...
6.4.0 - [Firebase/Core][I-COR000004] App with name __FIRAPP_DEFAULT does not exist.
6.4.0 - [Firebase/Core][I-COR000012] Could not locate configuration file: 'GoogleService-Info.plist'.
6.4.0 - [Firebase/Core][I-COR000005] No app has been configured yet.
6.4.0 - [Firebase/Core][I-COR000005] No app has been configured yet.
*** First throw call stack: ( 0 CoreFoundation 0x0000000113b521bb
__exceptionPreprocess + 331 1 libobjc.A.dylib 0x00000001130f0735
objc_exception_throw + 48 2 CoreFoundation 0x0000000113b52015 +
[NSException raise:format:] + 197 3 Runner 0x000000010bd33af0 +[FIRApp
configure] + 576 4 Runner 0x000000010bd7f1c5 -[FLTFirebaseAdMobPlugin
init] + 261 5 Runner 0x000000010bd7ef2e +[FLTFirebaseAdMobPlugin
registerWithRegistrar:] + 78 6 Runner 0x000000010bd333fb +
[GeneratedPluginRegistrant registerWithRegistry:] + 123 7 Runner <…>

I believe this medium post is the most comprehensive ios Firebase setup guide, however point 1 can be skipped - I have an app using firebase_admob 0.8.0+3 and it works flawlessly under iOS, once all other steps are completed.

You need to add GoogleService-Info.plist from firebase to your project.
Check this links:
https://support.google.com/firebase/answer/7015592
https://firebase.google.com/docs/ios/setup

Related

All framework error when launch framework/Info.plist: No such file or directory

I have a project on react native,
I'm Stack all day with this error I try a lot of things but nothing works, build successfully but the application is not launched on device or simulator here is the error I got
Could not install at this time.
Failed to load Info.plist from bundle at path /Users/BT/Library/Developer/CoreSimulator/Devices/32A76497-8C7B-4639-B3F9-80379AF5CB9A/data/Library/Caches/com.apple.mobile.installd.staging/temp.SEVqpI/extracted/XXXXXX.app/Frameworks/RCTVibration.framework; Extra info about Info.plist: Couldn't stat /Users/BT/Library/Developer/CoreSimulator/Devices/32A76497-8C7B-4639-B3F9-80379AF5CB9A/data/Library/Caches/com.apple.mobile.installd.staging/temp.SEVqpI/extracted/XXXXX.app/Frameworks/RCTVibration.framework/Info.plist: No such file or directory
Even I reset to the old version of the project witch worked perfectly I'm getting the error
When I add a info.plist to RCTVibration other library has the same problem as 20 library
I tried to clean project, close xcode, delete derived data, restart Mac i tried Embded Framework copy only when installing ... but still stuck i can't delete use_frameworks! because i have dynamic and no dynamic framework
On device i'm getting a different error :
Details
Unable to install "XXXXX"
Domain: com.apple.dt.MobileDeviceErrorDomain
Code: -402653103
Could not inspect the application package.
Domain: com.apple.dt.MobileDeviceErrorDomain
Code: -402653103
User Info: {
DVTRadarComponentKey = 282703;
MobileDeviceErrorCode = "(0xE8000051)";
"com.apple.dtdevicekit.stacktrace" = (
0 DTDeviceKitBase 0x0000000129dbe93f DTDKCreateNSErrorFromAMDErrorCode + 220
1 DTDeviceKitBase 0x0000000129dfd124 __90-[DTDKMobileDeviceToken installApplicationBundleAtPath:withOptions:andError:withCallback:]_block_invoke + 155
2 DVTFoundation 0x000000010d9a1b43 DVTInvokeWithStrongOwnership + 71
3 DTDeviceKitBase 0x0000000129dfce65 -[DTDKMobileDeviceToken installApplicationBundleAtPath:withOptions:andError:withCallback:] + 1440
4 IDEiOSSupportCore 0x0000000129c6dd28 __118-[DVTiOSDevice(DVTiPhoneApplicationInstallation) processAppInstallSet:appUninstallSet:installOptions:completionBlock:]_block_invoke.292 + 3513
5 DVTFoundation 0x000000010dad02aa DVT_CALLING_CLIENT_BLOCK + 7
6 DVTFoundation 0x000000010dad1ecc __DVTDispatchAsync_block_invoke + 1191
7 libdispatch.dylib 0x00007fff6d0416c4 _dispatch_call_block_and_release + 12
8 libdispatch.dylib 0x00007fff6d042658 _dispatch_client_callout + 8
9 libdispatch.dylib 0x00007fff6d047c44 _dispatch_lane_serial_drain + 597
10 libdispatch.dylib 0x00007fff6d0485d6 _dispatch_lane_invoke + 363
11 libdispatch.dylib 0x00007fff6d051c09 _dispatch_workloop_worker_thread + 596
12 libsystem_pthread.dylib 0x00007fff6d29ca3d _pthread_wqthread + 290
13 libsystem_pthread.dylib 0x00007fff6d29bb77 start_wqthread + 15
);
}
System Information
macOS Version 10.15.7 (Build 19H2)
Xcode 12.0.1 (17220)
any help will be appreciated
I tried even uninstall xcode and install again another version, also pull project git on a new location, create new simulator, restart device nothing worked
What worked for is adding for every framework, click on choose info.plist file like image show it and pods-Project-info.plist and it will be filled with correct information
It's not the best solution because it takes me a lot of time to associate all plist file, but it's the only solution that worked for me
Try running your project with npx react-native run-ios.
After hours of struggling and trying everything I found (cleaning derived data, erasing content and settings of simulators, reinstalling Xcode...)
This is the only thing that made it work, I was even able to build with Xcode after running the build with npx.
I was getting a similar error even after the builds passed and the simulator popped up. But the app was prevented from opening as it seems there was some .plist file missing in the frameworks.
I rechecked and set the Embed mode to "Do not Embed" for each of the frameworks added in the .xcworkspace target > General.
I also might had Clean the build folder (Cmd + Shift + K), closed the xcode, deleted DerivedData, pod deintegrate && pod update before shooting the Run in xcode again.
Other Info: Xcode-13.2.1, React Native project, M1Pro mac, Xcode running in Rosetta, Excluded Architecture - arch64 (in target & project Build Settings)
Clean drive data in XCODE preferences, clean and then rebuild the project. Hope it works!
One probable solution is following the steps:
Run pod install command in your terminal
Before installing App again delete content of your Derived Data
folder
Build and run to install the app.
Moreover if the above 2 steps doesn't work the try removing use_frameworks! from your Podfile and follow steps 1 & 2.
I also tried all the methods mentioned above, but they didn't work, and when I debugged all the Cocoapod and XcodeProj in Ruby, it was confirmed that the problem occurred due to the special setting. It may be a unique case, but it is very simple to check, so I recommend you to try it...
if ENV['INFOPLIST_FILE'] has a file for any Info.plist,
CocoaPods doesn't make Info.plist for Pod targets.
reference: https://github.com/CocoaPods/Xcodeproj/blob/29cd0821d47f864abbd1ca80f23ff2aded0adfed/lib/xcodeproj/project/object/build_configuration.rb#L115
I put this phrase in for the test and I was able to confirm that the file existed.
puts "#{ENV['INFOPLIST_FILE']}"
Finally, I could solved adding this line on top of Podfile.
ENV['INFOPLIST_FILE'] = nil
By the way, I don't know how I ended up assigning a specific Info.plist file to ENV...

Step to configure ML Kit library model in podfile - flutter apps

I am new in using ios, and right now I am using this package https://pub.dev/packages/firebase_ml_vision to do face detection... here is said that
If you're using one of the on-device APIs, include the corresponding ML Kit library model in your Podfile. Then run pod update in a terminal within the same directory as your Podfile. and right now I am using 'Firebase/MLVisionFaceModel' and I need to do pod 'Firebase/MLVisionFaceModel'... since I am new in using ios, I am trying to find a tutorial how to configure it in ios, but I still don't find yet... what I don't understand here is how to include the corresponding ML Kit library model in my Podfile... should I edit it inside Xcode or inside ios folder in my flutter project?... is anyone here know how step by step to configure it?
and here is what I get when I didn't set that up
Xcode build done. 26.9s
Configuring the default Firebase app...
*** First throw call stack:
(
0 CoreFoundation 0x00007fff23c7127e __exceptionPreprocess + 350
1 libobjc.A.dylib 0x00007fff513fbb20 objc_exception_throw + 48
2 CoreFoundation 0x00007fff23c710bc +[NSException raise:format:] + 188
3 Runner 0x00000001064aafca +[FIRApp configure] + 138
4 Runner 0x0000000106a6dab6 -[FLTFirebaseMlVisionPlugin init] + 214
5 Runner 0x0000000106a6d8f3 +[FLTFirebaseMlVisionPlugin registerWithRegistrar:] + 211
6 Runner 0x00000001064a5bf5 +[GeneratedPluginRegistrant registerWithRegistry:] + 309
7 Runner <…>

Trouble reading output console Flutter

I'm following the tutorial on flutter_bloc firebase login.
First I tried downloading the repo, adding my reversed Key in the Info.plist, my own GoogleService_Info.plist and launching the example it works.
Then I started again from scratch, but I get this output which I can't understand and the app doesn't start on iPhone simulator:
Xcode build done. 41.0s
Configuring the default Firebase app...
*** First throw call stack: ( 0 CoreFoundation 0x00000001082e46fb __exceptionPreprocess + 331 1 libobjc.A.dylib
0x0000000107888ac5 objc_exception_throw + 48 2 CoreFoundation
0x00000001082e4555 +[NSException raise:format:] + 197 3 Runner
0x0000000103ae64da +[FIRApp configure] + 138 4 Runner
0x0000000103bdae86 -[FLTFirebaseAuthPlugin init] + 214 5 Runner
0x0000000103bdac38 +[FLTFirebaseAuthPlugin registerWithRegistrar:] +
184 6 Runner 0x0000000103a8bbc0
+[GeneratedPluginRegistrant registerWithRegistry:] + 112 7 Runner <…>
I did put the reverse Key in the Info.plist and added my own GoogleService-Info.plist file in Runner but my app version doesn't start..
Actually when looking for the URL where to put the reverse Key I didn't see any, so I added it myself. Can it be a lead to where something gone wrong?
Thank you very much
OK found the problem.. Th GoogleService-Info.plist MUST be added to Runner through Xcode.. I must have just used Finder instead ..
Hope it helps others
Cheers

Firebase error while configuring app - unrecognized selector sent to class

I'm using Firebase in an iOS app and have two separate Firebase projects, one for production and one for development. My two .plist files are GoogleService-Info.plist and GoogleService-Info-Dev.plist, which I have been able to select based on a flag set in Targets -> Build Settings -> Other Swift Flags.
Inside AppDelegate didFinishLaunchingWithOptions:
#if DEBUG
let buildFor = "DEV"
#else
let buildFor = "PROD"
#endif
let firebasePlistFileName = buildFor == "DEV" ? "GoogleService-Info-Dev" : "GoogleService-Info"
let firebaseOptions = FIROptions(contentsOfFile: NSBundle.mainBundle().pathForResource(firebasePlistFileName, ofType: "plist"))
FIRApp.configureWithOptions(firebaseOptions) // line causing new Firebase error
This has been working fine up until today, when I had a problem with another Cocoapod project. I think it started happening when I cleaned the Xcode project or deleted Derived Data folder:
dyld: Library not loaded: #rpath/OtherPod.framework/OtherPod
Referenced from:
/Users/me/Library/Developer/CoreSimulator/Devices/12345678-E1C4-480F-B1D9-C10823DEA810/data/Containers/Bundle/Application/AE7B6EB0-43AB-CCCC-BBBB-AAAA71BF/MyApp.app/MyApp
Reason: image not found
I eventually resolved that by choosing my app under Targets -> General -> Linked Frameworks and Libraries, then added all of the choices inside the Workspace folder (7 other pod projects) and set those ones I added as optional. Ever since then, I've been facing the error described in the title of this post:
2017-02-10 17:19:29.660 MyApp[12639:182433] +[NSData gtm_dataByGzippingData:error:]: unrecognized selector sent to class 0x10a0442e8
2017-02-10 17:19:29.680 MyApp[12639:182433] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '+[NSData gtm_dataByGzippingData:error:]: unrecognized selector sent to class 0x10a0442e8'
*** First throw call stack:
(
0 CoreFoundation 0x0000000109d88d4b __exceptionPreprocess + 171
1 libobjc.A.dylib 0x00000001097f121e objc_exception_throw + 48
2 CoreFoundation 0x0000000109df8e44 +[NSObject(NSObject) doesNotRecognizeSelector:] + 132
3 CoreFoundation 0x0000000109d0e005 ___forwarding___ + 1013
4 CoreFoundation 0x0000000109d0db88 _CF_forwarding_prep_0 + 120
5 MyApp 0x0000000102d73c9d -[FIRNetwork postURL:payload:queue:usingBackgroundSession:completionHandler:] + 331
6 MyApp 0x0000000102d70e72 -[FIRClearcutLogger sendNextPendingRequestWithCompletionHandler:] + 570
7 MyApp 0x0000000102d70918 -[FIRClearcutLogger sendLogsWithCompletionHandler:] + 447
8 libdispatch.dylib 0x000000010a6ab978 _dispatch_call_block_and_release + 12
9 libdispatch.dylib 0x000000010a6d50cd _dispatch_client_callout + 8
10 libdispatch.dylib 0x000000010a6b2e17 _dispatch_queue_serial_drain + 236
11 libdispatch.dylib 0x000000010a6b3b4b _dispatch_queue_invoke + 1073
12 libdispatch.dylib 0x000000010a6b402b _dispatch_queue_override_invoke + 683
13 libdispatch.dylib 0x000000010a6b6385 _dispatch_root_queue_drain + 720
14 libdispatch.dylib 0x000000010a6b6059 _dispatch_worker_thread3 + 123
15 libsystem_pthread.dylib 0x000000010aa3a712 _pthread_wqthread + 1299
16 libsystem_pthread.dylib 0x000000010aa3a1ed start_wqthread + 13
)
libc++abi.dylib: terminating with uncaught exception of type NSException
I have tried a lot of different fixes, including adding to the Link Binary with Libraries, adding to the Other Linker Flags, and none of them have worked.
What could the unrecognized selector possibly be, and how would I change/remove it? Could this issue be due to the earlier one I was facing (library not loaded)?
For clarification, when the unrecognized selector sent to class error happens, the Xcode debug navigator is focused on Thread 7, with the FIRApp.configureWithOptions(firebaseOptions) line being highlighted.
Update
I found a temporary fix by reverting to a previous git commit (cloned my repository into a separate directory), then replacing the majority of the project contents from that old commit with the current error-producing copy, including the App-Name folder within root directory, App-Name.xcodeproj, and App-Name.xcworkspace. I only tested on the simulator (iPhone 7 running iOS 10.2), and that worked. I then successfully submitted a build to iTunes Connect and was able to run that build on my device (iPhone 5c with 10.2.1), but after deleting that and attempting to run a build from Xcode, I got the same error again. However, the error did not occur while running on the simulator. This is in contrast to the initial error scenario as it occurred on both physical device and simulator.
This made me remember that the stack trace I initially posted was that of running the app on the simulator. Running it on the device produced less output, specifically the content after *** First throw call stack: is only (0x1d01cdf7 0x1c27f077 0x1d022467 0x1d020579 0x1cf453d8 0x31ff3f 0x31d653 0x31d05d 0x1c57d57 0x1c63e63 0x1c5b205 0x1c64391 0x1c65d9f 0x1c65ba7 0x1c877937 0x1c877490) instead of the more descriptive output with file/function names.
Earlier, I have faced the same issue, I fixed the issue by reinstalling pod.
Please refer to the below-mentioned steps to resolve the issue.
Please make sure that you have added Add two-parameter in Other Linker Flags.
$(inherited)
-ObjC
Cocoapods:
Just install cocoa-pods again in the project. Please refer below command for remove and install pods.
Remove all Framework from project using below command.
pod deintegrate
pod clean
- Install framework using below pod command
pod install
Manual:
If you have added framework Manual in the project then remove it and add it into the project again.
Issue:
You have faced reference issue in your project (framework not found at
Specific Directory).
Hit the Clean and Build project. Everything worked as expected
Make sure GTMNSData+zlib.m from the GoogleToolboxForMac pod is still being built and linked into your app.
Make sure that -ObjC and -framework GoogleToolboxForMac is in the Link log:
To anyone experiencing this problem, while trying to add the firebase frameworks manually. I had the same issue, which was caused by having different versions of firebase. I tried to add additional frameworks as the readme suggested, but experienced the above mentioned error.
I resolved this by removing all the firebase frameworks from the project and build phases. Downloaded the newest version, and re-added all frameworks to the project, and the problem was resolved.
I just typed pod update and then closed out and reopened Xcode afterward. Worked for me.

Building XCTest UI tests for AWS Device Farm

I'm trying to set up our iOS XCUITests to run on AWS Device Farm, but it seems no matter how I build and upload them, the tests will not run. They execute and pass when run locally in XCode, but do not run on AWS Device Farm.
I've set up the absolute simplest app I can manage to try to isolate this issue. It consists of a single View with a single Label, and a UI Test which verifies that the label exists.
Here is the error that appears in AWS Device Farm's interface.
Digging into the log files reveals this (in the "Application Output" log file):
2016-04-03 19:07:39.842 XCTRunner[195:28521] Running tests...
2016-04-03 19:07:39.868 XCTRunner[195:28521] Unable to load configuration data from specified path ; error: The file name is invalid.
2016-04-03 19:07:39.872 XCTRunner[195:28521] Looking for test bundles in /var/mobile/Containers/Bundle/Application/883D7F70-E525-4478-9E5E-C87F72A83879/MyTestAppUITests-Runner.app/PlugIns
2016-04-03 19:07:39.875 XCTRunner[195:28521] Found test bundle at /var/mobile/Containers/Bundle/Application/883D7F70-E525-4478-9E5E-C87F72A83879/MyTestAppUITests-Runner.app/PlugIns/MyTestAppUITests.xctest
2016-04-03 19:07:39.878 XCTRunner[195:28521] Looking for configurations in /var/mobile/Containers/Bundle/Application/883D7F70-E525-4478-9E5E-C87F72A83879/MyTestAppUITests-Runner.app/PlugIns/MyTestAppUITests.xctest
2016-04-03 19:07:39.879 XCTRunner[195:28521] No configurations found, creating a default configuration that will run all tests.
2016-04-03 19:07:39.993 XCTRunner[195:28521] XCTestConfigurationHook: Using Test MyTestAppUITests/testExample
2016-04-03 19:07:39.995 XCTRunner[195:28521] XCTestConfigurationHook: Using Test MyTestAppUITests/testExample
2016-04-03 19:07:39.995 XCTRunner[195:28521] XCTestConfigurationHook: Using Test MyTestAppUITests/testExample
Test Suite 'Selected tests' started at 2016-04-03 19:07:40.008
Test Suite 'MyTestAppUITests' started at 2016-04-03 19:07:40.014
Test Case '-[MyTestAppUITests testExample]' started.
2016-04-03 19:07:40.021 XCTRunner[195:28521] *** Assertion failure in -[XCUIApplication init], /Library/Caches/com.apple.xbs/Sources/XCTest_iOS/XCTest-10112/XCTestFramework/UI Testing/XCUIApplication.m:72
2016-04-03 19:07:40.022 XCTRunner[195:28521] XCTestConfigurationHook: Ignoring skipped tests
2016-04-03 19:07:40.023 XCTRunner[195:28521] XCTestConfigurationHook: Using Test MyTestAppUITests/testExample
2016-04-03 19:07:40.025 XCTRunner[195:28521] XCTestConfigurationHook: Using Session ID 75B97C9E-6F14-4F88-A242-64B79C9A0F04
<unknown>:0: error: -[MyTestAppUITests testExample] : failed: caught "NSInternalInconsistencyException", "No target application path specified via test configuration: <XCTestConfiguration: 0x1652af60>
testBundleURL:file:///var/mobile/Containers/Bundle/Application/883D7F70-E525-4478-9E5E-C87F72A83879/MyTestAppUITests-Runner.app/PlugIns/MyTestAppUITests.xctest/
testBundleRelativePath:(null)
productModuleName:(null)
testsToSkip:(null)
testsToRun:MyTestAppUITests/testExample
reportResultsToIDE:no
sessionIdentifier:<__NSConcreteUUID 0x1655e5c0> 75B97C9E-6F14-4F88-A242-64B79C9A0F04
pathToXcodeReportingSocket:(null)
disablePerformanceMetrics:no
treatMissingBaselinesAsFailures:no
baselineFileURL:(null)
baselineFileRelativePath:(null)
targetApplicationPath:(null)
targetApplicationBundleID:(null)
reportActivities:no
testsMustRunOnMainThread:no
initializeForUITesting:no
"
(
0 CoreFoundation 0x22c90123 <redacted> + 150
1 libobjc.A.dylib 0x22436e17 objc_exception_throw + 38
2 CoreFoundation 0x22c8ffe1 <redacted> + 0
3 Foundation 0x23463b19 <redacted> + 92
4 XCTest 0x002625a1 -[XCUIApplication init] + 216
5 MyTestAppUITests 0x01d8a4b7 -[MyTestAppUITests setUp] + 182
6 XCTest 0x002433bf __24-[XCTestCase invokeTest]_block_invoke_2 + 198
7 XCTest 0x00274661 -[XCTestContext performInScope:] + 308
8 XCTest 0x002432f3 -[XCTestCase invokeTest] + 184
9 XCTest 0x00243a4f -[XCTestCase performTest:] + 566
10 XCTest 0x00241375 -[XCTestSuite performTest:] + 460
11 XCTest 0x00241375 -[XCTestSuite performTest:] + 460
12 XCTest 0x0024e88d -[XCTestObservationCenter _observeTestExecutionForBlock:] + 716
13 XCTest 0x00275c7f _XCTestMain + 1150
14 CoreFoundation 0x22c535b1 <redacted> + 12
15 CoreFoundation 0x22c5306d <redacted> + 216
16 CoreFoundation 0x22c515e1 <redacted> + 784
17 CoreFoundation 0x22ba4bf9 CFRunLoopRunSpecific + 520
18 CoreFoundation 0x22ba49e5 CFRunLoopRunInMode + 108
19 GraphicsServices 0x23df0ac9 GSEventRunModal + 160
20 UIKit 0x26e34ba1 UIApplicationMain + 144
21 XCTRunner 0x000fa255 XCTRunner + 33365
22 libdyld.dylib 0x22853873 <redacted> + 2
)
Test Case '-[MyTestAppUITests testExample]' failed (0.239 seconds).
Test Suite 'MyTestAppUITests' failed at 2016-04-03 19:07:40.256.
Executed 1 test, with 1 failure (1 unexpected) in 0.239 (0.242) seconds
Test Suite 'Selected tests' failed at 2016-04-03 19:07:40.259.
Executed 1 test, with 1 failure (1 unexpected) in 0.239 (0.251) seconds
Which to me looks like the MyAppUITests-Runner.app application hasn't included a configuration file which allows it to target the correct application. So I suspect it's something to do with the process I am using to build and upload the application and its UI Tests.
The process I am using to generate the Application ipa file is:
In Xcode, click Product > Archive
Select the Archive in the Organizer window and click the Export button
Select "Save for Ad Hoc Deployment" and click next
Select "use local signing assets" for provisioning
Select "Export one app for all compatible devices"
"Include manifest for over-the-air installation" is UN-checked
"Rebuild from bitcode" is checked
Export the ipa to a folder on desktop
The process I use to generate the UITests ipa file is (following instructions from http://docs.aws.amazon.com/devicefarm/latest/developerguide/test-types-ios-xctest-ui.html):
In Xcode, Select "Generic iOS Device" as the build target
Click Product > Build For > Testing
Open the XCode Derived Data folder for the project, go to Build > Intermediates > Debug-iphoneos. This contains 2 files: MyTestApp.app and MyTestAppUITests-Runner.app
Create a new directory called "Payload" on desktop
Copy the MyTestAppUITests-Runner.app file into the Payload directory
Right click Payload and select "Compress 'Payload'"
Rename the generated Payload.zip file to mytestapp-uitests.ipa
I have also tried including both MyTestApp.app and MyTestAppUITests-Runner.app into the mytestapp-uitests.ipa file, but this doesn't work either.
To run the tests in Device Farm:
In my testing project, click "Create a new run"
Select Android/iOS
Upload the MyTestApp.ipa file generated earlier (from Exporting the Archive) and click Next
Select "XCTest UI" from the list, and upload the mytestapp-uitests.ipa file
Select device pool which consists of iPad Air 2, iPad Air, and iPad 2 all running iOS 9.2.1
Leave Device State at default settings
Click Start Run
Note that if I use the same application ipa file and run the built-in Fuzz tests, these work with no problems -- I can see the screenshots with my test app with its single label.
I can't see anything obvious which I'm missing. What do I need to do to make this work?
I work for the AWS Device Farm team.
Your analysis quoted below is on the right path.
Which to me looks like the MyAppUITests-Runner.app application hasn't included a configuration file which allows it to target the correct application. So I suspect it's something to do with the process I am using to build and upload the application and its UI Tests.
We are currently fixing an issue where the tests are not picked up if the .xctestconfiguration file is missing from the .ipa.
A workaround for this issue until it is fixed to get you running is to run your tests locally which will generate .xctestconfiguration file under your .app/Plugins folder
Before packaging for upload to device farm just make sure that the .xctestconfiguration file is present under the .app bundle
The Fuzz tests will work because it does not use your test code. It just takes your app and runs a custom fuzz test against it.
Another note about the location of *-Runner.app is you should be able to find it under the Products folder from Xcode but as long as you can get to it things should be fine.
Update
This issue has been fixed since the original time of the post and there is no longer a need to have a .xctestconfiguration file in your tests runner.
I have the similar issue. I dig little bit more, it seems the below might be the reason for test to get failed.
"Could not receive XCTest bundle ready message from testmanagerd, error code -7”
It seems the setup and teardown methods are by default run and hence passed. I am not sure about it. But, I will try to get more information from the logs.
An easier solution to this is to change the location of the Derived data folder -
(Under Xcode Preferneces -> Locations.
eg I put it in my User folder ( similar to my documents)
this error went away immediately after battling unsucessfully for hours. ( looks like an Xcode bug)

Resources