iOS Crashlytics not logged in firebase dashboard - swift

I have configured it for firebase in app delegate.
Change Debug Information Format to DWARF with dSYM
I write the necessary run scripts.
"${PODS_ROOT}/FirebaseCrashlytics/run"
${DWARF_DSYM_FOLDER_PATH}/${DWARF_DSYM_FILE_NAME}/Contents/Resources/DWARF/${TARGET_NAME}
$(SRCROOT)/$(BUILT_PRODUCTS_DIR)/$(INFOPLIST_PATH)
But test crashes not showing in crashlytics dashboard
Finally, when I run Crashlytics/run manually, it gives an Could not get GOOGLE_APP_ID in Google Services file from build environment error, but GoogleService-Info.plist is attached to the project and I’m sure. I deleted the GoogleService-Info.plist and added it again. Could it be related to
Could you please tell me why or idea?
Thanks in advance

I assume it's "GoogleService-Info.plist" problem
because it's the only file that has GOOGLE_APP_ID property.
first, check google plist path. put it under your project folder, and then update your script with a specific path of file:
Xcode path: build phases -> Run Script
"${PODS_ROOT}/FirebaseCrashlytics/run" -gsp "${PROJECT_DIR}/[project folder name]/GoogleService-Info.plist" -p ios
second: make sure Xcode used your script succeesfully. to check that navigate to:
Xcode path : report navigator
then select a recent ended build and from center log scroll to the end and find this:
image link
as you see in image the validation should be succesfull
if you didn't find any related log to shell in the build log make sure you unchecked this
image link

Script succeeds in report navigator but still doesn't show my test crashes in crashlytics. imageLink
And I followed these steps of firebase
In Xcode, select Product > Scheme > Edit scheme.
Select Run from the left menu, then select the Arguments tab.
In the Arguments Passed on Launch section, add -FIRDebugEnabled.
But Completed report submission did not print logs

I had a very silly problem.I solved my problem. After you build with Xcode, you have to stop xcode and open the app manually.

I was missing a most important step mentioned in the documentation
While testing for crash please build and detach the Xcode's debugger using square button right before the run button in Xcode
Please refer to this part in documentation

Related

Showing Recent Messages error: Could not get GOOGLE_APP_ID in Google Services file from build environment

Just shown up on my Xcode a couple of hours ago and none of the other stack overflow answers are working. Anybody know how to fix this? My project won't build or archive(currently using Xcode 10.2) Thank you!
To fix this error, Make sure you have firebase script above the "Copy bundle resources" in Build phases section of your target in Xcode.
I assume you are using Google Firebase.
As the error say your GOOGLE_APP_ID could not be found.
Solution
Drag "GoogleService-Info.plist" in your project folder. This configuration file is generated when creating your project. If you don't have it you might want to regenerate it again as described on Firebase Console

how to fix the issue "Command /bin/sh failed with exit code 1" in iphone

I used a cocoa static library in my application. When I compile my library I got the following error:
Shell Script invocation error:can't open input file:
/Users/sijuthomas/Library/Developer/Xcode/DerivedData/SCXML2-
bbttehupryhijphhjdiemcytkvgy/Build/Products/Debug-iphonesimulator/
libSCXMLParser.a (No such file or directory)
Command /bin/sh failed with exit code 1
How can I fix this?
Click On Run checkbox if not selected.
I had this issue because i denied keychain access and in order to solve it you need to open keychain,
Then click on the lock on top right of the screen to lock it again,
after that you can archive and it will work
Deleting "Derived Data" worked for me.
In Xcode go to File > Workspace Settings > Click the arrow next to the Derived Data file path > move the "Derived Data" folder to the trash.
Seems you are running a shell script and it can't find your specific file. Look at Target -> Build-Phases -> RunScript if you are running a script.
You can check if a script is running in your build output (in the navigator panel). If your script does something wrong, the build-phase will stop.
I had same issue got it fixed. Use below steps to resolve issue in Xcode 6.4.
Click on Show project navigator in Navigator window
Now Select project immediately below navigator window
Select Targets
Select Build Phases tab
Open Run Script drop-down option
Select Run script only when installing checkbox
Now, clean your project (cmd+shift+k) and build your project.
Cleaning the build folder (Cmd + Shift + Alt + K) worked for me
1) Delete the pod folder and .xcworkspace file
2) Open the folder in terminal
3) Type "pod install"
Did you add the .a library to the xcode projet ? (project -> build phases -> Link binary with libraries -> click on the '+' -> click 'add other' -> choose your library)
And maybe the library is not compatible with the simulator, did you try to compile for iDevice (not simulator) ?
(I've already fight with the second problem, I got a library that was not working with the simulator but with a real device it compiles...)
In My case there was space in the path that was failing the script.If you are using variables like $PROJECT_DIR or $TARGET_BUILD_DIR then replace them "$PROJECT_DIR" or "$TARGET_BUILD_DIR" respectively.After adding quotes my script ran successfully.
For me, my certificate is expired. I have created a new certificate.
I did all above and spent an hour on the issue.
Tried everything above as well as restarted Xcode.
Finally, restarted computer and everything working normally again!
I tried restarting Xcode (7) and nothing (the have you tried switching it off and on again of iOS development for me :-)). I then tried by restarting my box and that worked.
In my case the script was failing when copying a file from a location to another one. I think it could have been related to Finder screwing with writing rights over certain folders.
For me this error was occuring because I changed the version number from 1 to 1.0 and build number from 6 to 1.1 as I pulled the code from source tree. I just changed it back and changed the build number from 6 to 7and it worked fine.
just put your script in a file and run that file with 2>/dev/null at the end of command line!
This way, if there is a problem with the command whatsoever, it will not halt your xcode build
in my case I was running just a command to uninstall my previous copy of the app from a connected iphone, so it could give an error if the iphone is not there. To solve it:
$mobiledevice uninstall_app com.my.app 2>/dev/null
The only thing worked for me:
1) Delete Derived Data with CleanMyMac: System Junk -> Xcode Junk -> Xcode Derived Data
Deleting Derived Data with CleanMyMac
2) Then in Xcode: Product -> Clean
I'll list things I did that did not work for me and finally what did
First, the accepted answer of Run script only when installing did not work.
Deleting derived data did not work.
What did work:
I added a new build phase in Build Phases
New Copy Files Phase
Drag & Drop the chosen framework into the drop target
Set the 'Destination' to Frameworks
Credit due to Kevin Le's Medium post
For those who doesn't want to uncheck that option (using cocoapods for example), the problem might be with the certificate/key.
Xcode (or whatever tool you are using, like a command line tool) needs to be able to use the certificate/key from the keychain. For this open the Keychain, locate the certificate that you want to use (Usually on login keychain, My Certificates), right click on the key, select Get Info, click on Access Control tab and add the app to the list.
If this doesn't work, try unlocking the keychain.
Another option can be select Allow all applications to access this item instead of specific apps and/or move the certificate/key to System keychain which is shared between all the user accounts on that Mac.
Also check that the certificate is not expired.
1) option :
2) option : pod update, clean derive data,
In my case, one of the script (related to SwiftGen) was failing during compilation.
I fixed the issue by removing the Pods and then updating them again.
Remove the problematic pod under Pods directory or use pod deintegrate
Install / Update the pods using pod install or pod update
P.S. It is possible your dependency is Global and is not in pods. In that case you can also try to reinstall that dependency.
READ THIS IF YOU USE Crashlytics AND ARE HAVING THIS ISSUE...
I was having the same issue as above Command /bin/sh failed with exit code 1 more specifically [31merror: Could not fetch upload-symbols settings: An unknown error occurred fetching settings.[0m
The first solution (enabling the run script only when installing) allowed me to build my target in the simulator, but I could not archive my build.
I solved this Archive issue by enabling Crashlytics on firebase. I am still used to Fabric where Crashlytics is automatically enabled. Once I enabled Crashlytics in the firebase console for the corresponding GoogleService-Info.plist I was able to Archive without this error.
Remove all pods and install again.
Steps:
comment all pods and run pod install
uncomment all pods and run pod install

Xcode compiles my App, but can't run it in the simulator

when i compile my app, Xcode just says "Attaching to Projectname..." and gets stuck there.
The debugger just prints this out:
error: failed to attach to process ID 0
I tried to clean & build again and it still doesn't work out. I googled but couldn't find anything helpful.
How can I fix this problem? Thank You!
The solution for me was to delete everything Xcode has generated earlier:
the App on the Simulator...if this is not possible because you cant
reach the Homescreen, you can delete the App directly under
~/Library/Application Support/iPhoneSimulator/6.0/Applications
delete the Derived Data in the Organizer under Projects or directly
in ~/Library/Developer/Xcode/DerivedData
clean the Build Folder by choosing "Product" in the MenuBar and click
while you press the Alt-key on "Clean Build Folder"
Restart Xcode
Have you tried closing down the simulator entirely, or failing that, reset the simulator and all its contents usually does the trick.
What finally got the simulator working again for me was deleting everything under Library/Application Support/iPhone Simulator/ within the user directory. What I think caused the problem for me in the first place was trying to use a directory named 'Resources' as described here: https://stackoverflow.com/a/1265168/649
This happened to me when I had two xcode projects open with the same bundle identifier.
Solution: leave only one project open which has the same bundle id.
Lindemann's solution worked for me. Nonetheless, during further development I came across another situation that generates this problem: if you create a folder reference (blue folder on Xcode's file explorer, as opposed to the yellow ones which are just groups) called "Resources" the same issue will arise. The solution in this case is to simply rename that folder.
After this, follow Lindemann's solution.
I had similar issues when i installed XCode 4.5 on OS X Mountain Lion. I searched a while and tried some fixes but what finally solved the problem was adding "127.0.0.1 localhost" to my hosts file (/etc/hosts).
Here is what i have done:
Open a terminal shell with cmd+space > terminal
type in "cd /etc"
type in "sudo nano hosts"
type in your root password
add "127.0.0.1 localhost"
save with ctrl+o > return
close with ctrl+x
log out and log in again or restart
Ctrl-Shift-Option-K (same as holding down option and selecting Product ... Clean Build Folder) has always worked for me.
What seemed to work for me was build & run my code so that it opened the Simulator, then hold down on the Simulator Icon in the Dock and select Options -> Keep In Dock
After this I just closed the simulator and launched it from the dock and deleted the app from the home screen on the simulator.
Build & Run the app from XCode and everything seemed to be OK again.
There seems to be quite a lot of things that can cause this error, but for me it turned out to be that I was missing the key CFBundleIdentifier from my plist.
Added it back, and the simulator started normally.
Also make sure none of your file/group name collide with the projects default settings.
Things started breaking for me when I added an info.plist file to my project (Bad Idea). Same happens when you add a "Resource" Group. I don't have an exhaustive list, but if someone does please do share.
Cleaning out / Renaming these conflicting files and following the solution provided by Lindemann(https://stackoverflow.com/a/12504712/2069749) solved the problem for me.
What worked for me was that I realized i was messing with the project settings and accidently removed the info-plist section. After specifying the plist file again properly, it worked. Hope that helps someone.
You need to change the debbugger LLDB to GDB. This helped me start my program in the simulator.
If you are using a network account, you should replace the "~/Library/Application Support/iPhone Simulator" with a link to a local directory. This worked for me after trying everything else.
Make sure you do not have an invalid build rule, that will cause this error, happened to me once (I had added a build rule by mistake and left it invalid).
I had the same problem, in my case i have left the ios simulator open in one user account and switched (without logout the previous one) to another user account. I couldn't event able to open ios simulator to clear and reset its settings. [Shows could no open ios simulator OSStatus - 10829]
My solution:
I quit the simulator in the first user account and then came back to second user account, every thing is working fine.
try to do next steps:
Go to Product/Scheme/Edit Scheme then select Run section.
Select Info Tan and set Debugger None.
Run project. It must be working (without debugger)
Go back to Edit Scheme and selecet debugger LLDB
Run project. It is working.
Maybe additionally you need to delete derived data and do Product/Clean
Can't tell you how frustrated I am trying to narrow down the cause of this one. Took me hours. Trial and error here and there.. all leads to nothing until one comment in one of the threads relating to this mentioned about "Executable". Boom! I remember the plist key "Executable file" in my project plist (PROJECT-info.plist). So I got there and found out that that entry was missing. I filled it in with whatever default you see when creating new project, "Executable file" paired with "${EXECUTABLE_NAME}". Build + Run. Then it finally worked!
Btw, I did try all those deleting/resetting stuff found all over SO. None of them works.
If resetting content and settings in the Simulator doe snot work for you, make sure that there is an entry for localhost in your /etc/hosts file:
127.0.0.1 localhost
Some programs can delete the line or comment it out (#) or even delete your /etc/hosts/ file completely. I tried everything described, but once I added localhost back to the file, the simulator worked perfectly for me.
What worked for me was to select 'Delete Derived Data' from the Projects tab in the organiser.
I fixed my problem by I making a new blank project and importing all the old files.
It must have been a problem with Xcode because it worked before iOS 5.1.

Xcode: Build error: tried to link DWARF for unsupported file:

I've changed something in my project settings and now when I run this project to build and debug I get build error:
GenerateDSYMFile error: tried to link DWARF for unsupported file: "correct path to my application executable here"
but! when I press RUN once more it works like a charm and my app starts in Simulator.
so I need press cmd-R twice every time to debug my app.
it was normal in previous version of my project so I don't know what changes I've made %)
all my other projects works fine and I can just recreate this project, but I want to figured it out - what trigger this error. I tried to ask this question on Apple devforums but without any success.
any help here? thx )
ps this error shows as Xcode3 as Xcode4
There is same file name as your project name in bundle so get rid of that file by renaming it and use accordingly.
Clean the project and run the project. Good to go.
not sure if you figured out what the problem was, had the same thing happen to me. I had made a text file called the same name as my project - when I got rid of that it fixed it.
Try changing under Build Options > Debug Information Format. See if that helps.
I got it when I tried to run my app in the simulator.
Xcode said ATTACHING TO PROCESS but hung.
So had to kill XCode and restart.
When I ran project again it built ok but when I said RUN it got that link error.
I fixed it by deleting the app in the Simulator and hit run again and it worked.
In my case It was a plist file causing the error.
I renamed the file and updated Info.plist File in Target Build Settings and that fixed it.
I got the same error: "error: tried to link DWARF for unsupported file: /Volumes/..."
This error wasn't shown before up until I changed to Xcode 6 in my Jenkins server. Before we had the same setting of the App and was building without any problem.
I was building the app as Realase version via Jenkins and I had the setting to build with the following configuration "-configuration Release" and the parameter "Debug Information Format" in Build Setting of the app was set to DWARF-with-dSYM.
In order to solve this error I changed in the targets in Xcode in Build Settings in the parameter "Debug Information Format" to DWARF only and I didn't get any error from Jenkins.
The apple developer documentation says this regarding the different values of this parameter:
DEBUG_INFORMATION_FORMAT (Debug Information Format)
Description: Identifier. Identifies the format used to store the binary’s debug information.
Values:
stabs: Use the Stabs format and place the debug information in the binary.
dwarf: Use the DWARF format and place the debug information in the binary.
dwarf-with-dsym: Use the DWARF format and place the debug information in a dSYM file.
Default value:
dwarf
Prerequisite for:
“GCC_ENABLE_SYMBOL_SEPARATION (Separate PCH Symbols).”
Link: https://developer.apple.com/library/mac/documentation/developertools/Reference/XcodeBuildSettingRef/1-Build_Setting_Reference/build_setting_ref.html

Receive message "A signed resource has been added, modified, or deleted" when trying to debug an App on iPhone

While attempting to debug a build created using the 3.2 SDK on an iPhone device I receive the message "A signed resource has been added, modified, or deleted.".
I can clean, rebuild, then install with no error, but if I try to install without cleaning the error shows.
Anyone have an idea as to what might be causing this?
I found a workaround for the bug.
If you delete the .app file in build/Debug-iphoneos/ before building for the device, the app gets installed without errors.
And there is a simple way to do that before every build.
Make sure you have selected "Device" in the dropdown overview menu.
In XCode go to Project > New target...
Then find "Shell Script target" under MacOSX/Other
Name it and add it to the current project
Now, in the left navigation panel, under targets, expand your newly created target and double-click on Run Script.
In the window that opens replace "# shell script goes here" with "rm -fr build/Debug-iphoneos/*.app" (without the quotes).
Now open your main target preferences and under Direct Dependencies add your newly created target.
Build and Go! :)
This error occurs when there is a special character in the Product Name. In my case it was a "?"
If you change the Product Name it automatically updates the "Bundle Name" and "Bundle Display Name" so it is often the best choice to rename an app.
If you want to include special characters in the app name you have to manually rename the "Bundle Name" and "Bundle Display Name"
Bundle Name: This is the actual app bundle name in the file system such as "Awesome App.app". It is generally not visible to the user.
Bundle Display Name: This is a short name displayed under the app icon on the device. Since the bundle name would be truncated to "Awes…tion" you have the option to have a shorter name which fits better such as "Awesome App". It should be similar to the App Store name (set in iTunes Connect)
This is pretty clearly a bug in the 3.2 SDK, but I don't want to downgrade. I've found that doing a Clean by pushing Command+Shift+K, then Return is pretty fast before pushing Command+R to build.
Xcode 8, reason of the "A signed resource has been added, modified, or deleted." was that target was signed with an enterprise provision profile.
In my case, it happened when no changes were made. Make a change to any file and run again.
This can have several causes. The fastest way to figure out what is causing it is to go into Xcode, Window menu, Devices, then click the reveal button at the bottom of the pane to show the Console. Now attempt to run. You should see log output that names the specific files it is complaining about.
Most of the solutions previously posted are just artificial ways of getting Xcode to regenerate the contents of the build folder and/or re-sign the files.
In my case, my WatchKit extension was somehow acquiring references to Cocoapods frameworks that were only targeted toward the main app so they got signed during the build, then pruned later (as they were not used). Then on device, iOS complained that they were missing from the .appex folder for the extension. I ended up not needing any pods in the extension so I just removed them all and removed the extension as a target, then did some minor cleanup to remove the pod-related debris left in the build steps. Now everything works perfectly.
(SOLVED) This is a weird one. I tried everything I could find. Eventually I changed the product name from "Unit Tests (device)" to "Device Unit Tests" - removing the brackets. Now everything works. The spaces in it appear to be fine.
Previously on stackoverflow:
I've just run into this bug with two static library projects. One builds and tests using the GHUnit test runner on the device without a problem. The other projects will not install and gets this error. That means it's something thats different between these two projects. I've so far tried wiping the build directory, taking spaces out of the executable name, and various clean and builds as suggested here.
Same for me, thought it has something to do with multiple targets etc. because I changed a lot there. But it's highly possible that it's a Bug in the 3.2.2 release since I did not test extensively in this sdk version before the massive target changes in my project.
solved my issue!!!
I found out by accident that somehow a space " " found it's way into the Product Name of my app so it was called "First Second.app" instead of "FirstSecond.app". After deleting the space the issue was gone!
I changed it here:
right click on target
Get Info
Build Tab
Packaging Section
Product Name <- The name here will be used for the bundle (.app) name
Hope this helps, let me know!
Cheers,
nils
I could solved by changing project name.
[project]-[Rename] menu. "phase1 (new)" -> "pahse1"
I was getting this same error, but intermittently. I tried all the above and it still didn't work. Today I found what was causing it.
The error seems to occur when editing a xib in interface builder. If you try to run while the interface builder is open in xcode it will cause the above error. To solve just close the interface builder editor. i.e. just select a code file from your project so you are in the Source Editor.
The simplest (and probably most common cause) appears to be rebuilding without any changes.
So the simplest thing to cure it is to make a trivial change to a source file (such as adding a space, then deleting it), and then rebuilding.
If this doesn't work, feel free to try all the other answers here.
For months, I'd get this error without realizing it was due to such a simple cause. I'd usually do a Clean Build to get rid of it.
When I created ipa through terminal using xcodebuild commands, ipa created but while installing it I was getting same error. exportOptionsPlist solved my issue.
xcodebuild -exportArchive -archivePath projectPath/myapp.xcarchive -exportPath projectPath/myApp.ipa -exportOptionsPlist ProjectFolder/exportPlist.plist
In my case, Quit and restarting XCode worked.
For me the issue was related to the provisioning profile settings. The clue to this was that debug builds were installing ok, but release builds were not. I wanted to test a release build, so I ran the scheme with that build configuration.
I fixed it by duplicating the Release Configuration, then modifying those fields in the Build Settings to have the same provisioning stuff as if I am debugging it.
(Adding another build configuration will give you headaches if you are using Cocoapods however, then you'll have to modify your Podfile)
I'm getting the same thing, when installing on a iPod Touch. I can't link for the simulator (for other reasons), so can't say whether the problem occurs there.
Yes, rebuilding clean or deleting the app from the device allows me to install again. Neither are desirable, iterative solutions!
The minimal "cleaning" I've come across as a work around is manually deleting the Foo.app in the build/Debug-iphoneos directory.
it seems this is a bug in xcode 3.2.2:
iphonedevsdk
I had the same problem in Xcode 3.2.1 when I put a + in my app name. Specifically the "product name" in the build settings. It is fine to have a + in the bundle name in your Info.plist. The same probably applies to other punctuation characters.
Go to Window > Organizer > Projects > Find your project and delete derived data
I got this error intermittently while installing app using iPhone config utility on Windows7. Following solution works - Go to C:\Users\{lanusername}\AppData\Local\Temp and delete app specific folders (e.g. abc.app) and try installing app again.
I reported this bug on ICU (Windows versions) to Apple in June 2011. With the following workarounds:
The workaround is this ....
Win XP
1) Close ICU
2) Delete the temp folder: c:\Documents and Settings\[username]\Local Settings\Temp\[AppName].app
3) Delete the deploy folder: c:\Documents and Settings\[username]\Application Data\AppleComputer\MobileDevice
4) Restart ICU. Drag in the App and install normally.
============================
Win 7
1) Close ICU
2) Delete the temp folder: c:\Users\[username]\AppData\Local\Temp\[AppName].app
3) Delete the deploy folder: c:\Users\[username]\AppData\Local\Apple Computer\MobileDevice\Applications\[AppName].app
4) Restart ICU. Drag in the App and install normally.
=========================================================
I simply rebuilt my app, and that solved the issue.
I also faced the same issue. After wasting lot of time I realized that my product name has a special character "?" which cased the problem
Having the DerivedData folder at a network location caused this problem for me.
After trying everything else, I found out my workstation couldn't agree with the University server about what the time was. (It thought everything was always modified). I also had to clean for every rebuild to avoid that frustrating message.
In the end I gave up and built locally, changing Xcode > Preferences > Locations ... feeling altogether pretty dumb for having ever built over the network.
We ran into this issues on XCode_6.3.1. We were building a AppleWatch app, with an extension. We do have a bunch of Pods.. After debugging the issue for almost a bunch of hours, what we found was that there was an issue with the way a file was adde to the project..
It seems like some references to a unused file was sitting in the iPhone App, though it was used in the Watch App.. It turns out that the error XCode was showing was totally useless.
After removing this file and re adding it back to the project the project started working fine & was able to install to the device. To make it even harder to debug the issues, the debug version was installed without an issue, but was unable to install the norman version..
Make sure you add your files to the right target and, look at git history and see if there are lingering fragments that are added to the wrong target.
This is a very general error message indicating something is wrong during the validation process of the code signature. To find out the specific error, you can go to Xcode->Window->Devices and check your device log.
In my case, I have following console spew
Feb 1 18:53:07 iPod-touch installd[40] : 0x1001f8000 -[MICodeSigningVerifier performValidationWithError:]: 192: Failed to verify code signature of : 0xe8008017 (Signed resources have been added, removed, or modified)
Check on this 3rd party framework again, I found an extra CodeResources file under the framework root. Remove that file fixed the problem.