Trouble reading output console Flutter - ios

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

Related

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 <…>

Flutter firebase_admob not working on iOS with default app install

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

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.

Unreadble errors with Firebase Crash Reporting on ios (Symbol files)

I'm using firebase crash reporting to get crash on my iphone project.
But the logs that I receive are not readable :
Exception name: EXC_BREAKPOINT / EXC_ARM_BREAKPOINT
TPC_swift
4295841940 + 284820
TPC_swift
4295841344 + 284224
TPC_swift
4296852240 + 1295120
libdispatch.dylib
_dispatch_call_block_and_release + 5304
libdispatch.dylib
_dispatch_client_callout + 5240
libdispatch.dylib
_dispatch_main_queue_callback_4CF + 27520
CoreFoundation
__CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 920908
CoreFoundation
__CFRunLoopRun + 912308
9
CoreFoundation
CFRunLoopRunSpecific + 35916
GraphicsServices
GSEventRunModal + 49284
UIKit
UIApplicationMain + 516228
TPC_swift
4295904544 + 347424
libdyld.dylib
start + 10420
This is an issue with firebase or apple errors ?
In my Build Phases on my project, I have this script :
# Replace this path with the path to the key you just downloaded
JSON_FILE=/*****/TPC_Swift/TPC_swift/TPC_swift/Project-*****.json
# Replace this with the GOOGLE_APP_ID from your GoogleService-Info.plist file
GOOGLE_APP_ID=1:*********:ios:***************
defaults write com.google.SymbolUpload version -integer 1 # creates file if it does not exist
JSON=$(cat "${JSON_FILE}")
/usr/bin/plutil -replace "app_${GOOGLE_APP_ID//:/_}" -json "${JSON}" "$HOME/Library/Preferences/com.google.SymbolUpload.plist"
"${PODS_ROOT}"/FirebaseCrash/upload-sym
Thank you
EDIT :
On firebase, I have :
Upload symbol file to symbolicate future stack traces for UUID
68FD2AAC-F8A7-***********
I think the issue is linked to the symbol files
How to solve this ?
EDIT 2 :
I tried "dwarfdump --uuid /path/to/your/build/area/MyApp.app/MyApp"
but I can not retrieved this UUID...
Facing the same issue, this is what I got from firebase-support#google.com:
Thanks for waiting. Can you go over the following items and see it will work:
reset your OAuth credentials, run below command:
rm $HOME/Library/Preferences/com.google.SymbolUpload*
create new service account and make sure it has editor permission
Revise your script into below format:
# Replace this with the GOOGLE_APP_ID from your GoogleService-Info.plist file
GOOGLE_APP_ID=1:my:app:id
# Replace the /Path/To/ServiceAccount.json with the path to the key you just downloaded
"${PODS_ROOT}"/FirebaseCrash/upload-sym "/Path/To/ServiceAccount.json"
Please make sure your app id and json file path are correct.
I hope this helps. Let me know if you have other concern.
Did you find the answer for your question?
Your script seems to be a little different than the one recommended at the Firebase doc today (Sep 18 2016).
Have you tried this one?
# Replace this with the GOOGLE_APP_ID from your GoogleService-Info.plist file
GOOGLE_APP_ID=1:my:app:id
# Replace the /Path/To/ServiceAccount.json with the path to the key you just downloaded
"${PODS_ROOT}"/FirebaseCrash/upload-sym "/Path/To/ServiceAccount.json"

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