dyld: Library not loaded: #rpath/Realm.framework/Realm - swift

I'm having a problem running my Realm-based Swift app on actual hardware. I keep getting "dyld: Library not loaded: #rpath/Realm.framework/Realm" when the app starts then leads to a SIGABRT dyld`__abort_with_payload. The app runs fine on the simulator. I've followed the steps on the Realm Swift website, dragged frameworks into embedded frameworks, added build phase script, added framework path to unit test target. I'm kind of at a loss here. I'm using xcode 9, iPhone 7 iOS 11.

Here's what fixed my problem:
Log out of xcode Preferences->Account
Open keychain app on mac and delete all iOS dev certificates.
Restart mac.
Open xcode and and log back in with Apple ID Preferences->Account
Go to app Target->General and make sure "Automatically manage signing" is checked and correct team is selected.
Run the app, and a message will pop up saying that cert not found in keychain (something like that). Just continue and when it warns you that cert needs to be revoked first, select to Revoke.
At this point, the problem is gone and the app is running.
For the issue I mentioned in the comments of op, the fix for that was to click on app target->Build Phases and drag the Run Script to the bottom of the list. It has to run after Embedded Frameworks! This was a side effect from me debugging original problem and removing/adding the realm framework. After doing that, the run script was now second last in the list with embedded frameworks following it.

I have resolved this issue through simple technique.
Steps for remove this realm error:
First step:
comment the line of pod //pod 'RealmSwift'
run the command in terminal "pod install"
Second step:
uncomment the line of pod //pod 'RealmSwift'
run the command in terminal

I had the same issue in Xcode 11.4 and I fixed it by editing my pod file
platform :ios, '13.0'
target 'MoneyLeft' do
#use_frameworks! -> !!! very important
pod 'Realm', :modular_headers => true
pod 'RealmSwift', :modular_headers => true
end

Related

Pod lib lint command cannot find watchos simularor

I am writing library which I am trying to distribute via cocoa pods, but when I run pod lib lint my build fails only for watchOS, it says that can not find watch OS simulator with specific ID, but after that list all simulators and at that list there is a simulator with that ID. Please take a look at image.
why is this happening and how I can resolve it?
I've tried to keep open that watch os simulator and closed also while I am running pod lib lint command, but same result.
This issue was introduced with Xcode 14. The CocoaPods tracking issue at https://github.com/CocoaPods/CocoaPods/issues/11558.
One workaround is to use Xcode 13.
For me, changing the deployment target to a simulator version you have installed solved the issue. Here's how to download earlier simulator runtimes.

Firebase Crashlytics not showing crash report in console dashboard swift

I have setup all these steps and bundel id on Firesbase Dashboard and tried crash many times but not getting any report.
pod 'Firebase/Core'
pod 'Fabric', '~> 1.7.2'
pod 'Crashlytics', '~> 3.9.3'
In Build phase added run Script : "${PODS_ROOT}/Fabric/run"
Debug Inforation Format : DWARF with dSYM File
running in simulator with following steps
(IBAction)crashButtonTapped:(id)sender {
[[Crashlytics sharedInstance] crash];
}
Click play_arrow Build and then run the current scheme in Xcode to build your app on a device or simulator.
Click stop Stop running the scheme or action in Xcode to close the initial instance of your app. This initial instance includes a debugger that interferes with Crashlytics.
Open your app again from the simulator or device.
Touch Crash to crash the app.
I took the same steps as you and thought I had an issue until I realized there's a delay for the crashes to show up on the console. In my case it took about 40 minutes to appear.
Here's a blog post about it.
Check run script only when installing
I did everything on stack overflow; my upload was successful, but nothing showed up. After trying to figure out the solution, I tried this, and it worked for me as well as for some other people facing the same issue... might help others who end up here.
I posted it in issues section. Check it out https://github.com/firebase/quickstart-ios/issues/413
One thing that I did was to move my test crash
Crashlytics.sharedInstance().crash()
to the first view controller (e.g., WelcomeViewController),then after the crash I closed and opened my app again. Then just waited for sometime and it appeared.
Before doing all of that my test crash was within a view controller, which was part of a tabBarController as it wasn't the top most view controller. Maybe that's what caused the issue. After my first crash appeared on the firebase console then my other crashes started appearing.
Check your app bundle identifier in app eg. bundle identifier is abc_app, the go to the Firebase app console project overView - > project settings and then Your App section select your app and check that the bundle identifier in the app and bundle identifier in the Firebase app. Both should be the same!

"Message from debugger: unable to attach" when running Tests on OSX app

I am unable to run my tests on my OSX app - the project builds fine but when I run Product -> Test in Xcode 8.2. It says :
Message from debugger: unable to attach
How do I get my tests working again?
What solved the problem for me was to enable signing on the test target.
You need to go to your project's settings, go to your target and in general, under Testing, you have the Signing section. Click on the big button "Enable signing" (or something like this). You may have to deal with provisioning profiles but it wasn't the case for me.
I ended up needing to "repot" my Xcode project using these steps which sorted it out.
https://medium.com/#mobilebloke/xcode-8-going-slow-on-swift-3-have-you-tried-repotting-your-project-88d0066d2445#.idcdv2dd3
I know its not necessarily the fix but after trying:
Adding removing certs
Recreating profiles
Deleting and re-adding targets which didn't work...
this at least allowed me to continue
I had the same issue, but for the regular app. For some reason my app was sandboxed. You can check it selecting your Project/Target (your app) and then Capabilities, like in this screenshot (from Xcode 10 beta 4, but the concept should apply to older versions of Xcode):
App Sandbox was on. that also created a file "RSSReaderMac.entitlements". Which I probably messed up trying to keep the app sandboxed just to learn how it works. I disabled App Sandbox, trashed the entitlements file and then my app started running again.
Indeed the real cause was that my app actually crashes, with this error message:
Exception Type: EXC_CRASH (Code Signature Invalid)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note: EXC_CORPSE_NOTIFY
I suppose enabling the sandbox again the entitlements file gets recreated. Otherwise another option could be to check and clean that file first. But I didn't test it.
My error was that I attempted to add an entitlement manually in the [app name].entitlements file. Deleting the added entry fixed the problem, You may have a corrupted ...entitlements file.

"Failed to upload *.app on Device " Error in iPhone

I am getting an error while uploading my app on device. It does installs it but not able to upload it.
Also I want to run the instrument tool on device but when I run it shows nothing.
Anyone facing the same issues.
I had this problem after changing around provisioning profiles and app ID's.
What fixed it for me:
Quit XCode
In Terminal.app, navigate to your project directory and execute rm -rf build/
Restart XCode
I also confirm, that I had that issue on Xcode 3.2.5 and iOS 4.2 GM Seed and after adding new provisioning profile.
You do not have to use terminal, you can select *.app from Products Group in 'Groups & Files' pane in Xcode. Then right-click on it, and select 'Reveal in finder'. Then manually delete the build catalogue. And restart Xcode.
Worked for me.
I was getting this issue on an iPhone running 3.0 software, but it was working fine on phones running 3.1. The app used to work on the 3.0 software until we added users to the provisioning for the app - this is the only thing I can think of that might have caused it.
If you're running 3.0 still, try upgrading to 3.1 and see if that fixes it.
I had the same error message in iOS 4.1 but from a different cause: when trying to link to a universal (ARM & X86) static library that was over 10MB. If I link directly to the ARM version of the static library (for iPhones), then it works fine.
Sometimes manual delete of Build folder of your application fails to solve the problem
"Failed to upload the .app on device"
Try
WIndows->organizer->Provisioning profile(in left pane)->refresh it once....
This has solved my problem!

Xcode error: Failed to launch simulated application

Problem
Unlike people have asked at here and
here, I got this error after a brand new installation of Leopard (hackintosh), this problem really driving me crazy and nowhere else to find an clue, I googled and visited every article related with this, still can't get it solved.
After the first time install iPhone SDK 2.2.1, start a new project(any type, Navigate based, OpenGL ES application), then build and go, I got the following problem:
sometime it's:
Failed to launch simulated application: Unknown error.
and sometimes it's:
Failed to launch simulated application: iPhone Simulator failed to find the process ID of com.yourcompany.[application name]
It seems that apps in the simulator crashed immediately, so Xcode can find the process ID.
Solution
This link says that this even can't be solved. Some others make a detailed step by step:
Uncheck Info.plist
Quit XCode
Delete directory /Lib/Caches/com.apple.DeveloperTools.###
Open Xcode project
Clean All Targets
Rebuild
and I reset the iPhone Simulator. This also didn't solve the problem…
I've even tried uninstall the SDK and reinstall it, still got the same error…
Is this a problem related with hardwares? or the operating system version? I'm using a hackintosh (iDenebv1.4 10.5.6), all other software works good including iTunes && vmware fusion.
Great thanks for any further tips or clues!
FIXED For the issue:
iPhone Simulator failed to find the process ID of com.yourcompany.[your application name]
I was having an issue building and simulating a project I built under OS Version 2.2.1, which I could no longer get to build and run in the simulator for XCode 3.1.4, even though I forced XCode to build for "Simulator - 2.2.1 Debug"
I was able to get past this problem by:
- Close the iPhone Simulator
- Putting XCode into View->Detail
- Opening the "Info.plist" file in the "Resources" folder
- Near the top of the file you should see "Info.plist" with and up/down arrow selector
- Click on the up/down arrow selector
- Select "Clear File History"
Built For:
Simulator - 2.2.1
XCode Version:
3.1.4 (Which includes OS3.1 Beta 3)
I had the same issue last night, and suddenly my system got reboot. At that moment, i was trying to install an application into simulator. When system returned, and i tried again to install the app, it said, "Failed to launch simulated application"
Than i did googled it, and tried many solutions, like cleaining all targets and try building again, but didn't worked out.
So i have found the following link, where it is described, how to reset the iPhone Simulator contents:
http://developer.apple.com/iphone/library/documentation/Xcode/Conceptual/iphone_development/125-Using_iPhone_Simulator/iphone_simulator_application.html
I tired doing it, and you guys would'nt believe me, it worked :) ,
Solution was : "To set the user content and settings of the simulator to their factory state and remove the applications you have installed, choose iPhone Simulator > Reset Content and Settings"
Best of Luck to all.............. :)
This ends up being a product name issue:
The fix is to revert back to
${EXECUTABLE_NAME}
${PRODUCT_NAME}
for the executable file and com..${PRODUCT_NAME} in the info.plist.
Clean XCode, Quit, rese and quit simulator and you're good to go.
found some wierd log in /var/log/system.log.
May 8 16:17:50 th084134 /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator2.2.1.sdk/System/Library/CoreServices/SpringBoard.app/SpringBoard[1170]: MobileInstallationLookup: Generating the install map
May 8 16:17:50 th084134 /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator2.2.1.sdk/System/Library/CoreServices/SpringBoard.app/SpringBoard[1170]: load_application_info: Could not load signer identity from /Users/test/Library/Application Support/iPhone Simulator/User/Applications/5D55807A-7489-4DC5-B4D7-2ECD5E230F29/new1.app/new1
May 8 16:17:50 th084134 [0x0-0x2e02e].com.apple.iphonesimulator[1168]: error compiling query "SELECT value FROM _SqliteDatabaseProperties WHERE key = ?;": no such table: _SqliteDatabaseProperties
May 8 16:17:51 th084134 SpringBoard[1170]: Unable to obtain task name port for com.yourcompany.new1. Either it failed to exec or it terminated immediately: (os/kern) failure
May 8 16:17:51 th084134 SpringBoard[1170]: Couldn't activate <SBApplication: 0x123e6d0> com.yourcompany.new1 activate: animated deactivate:
May 8 16:17:51 th084134 SpringBoard[1170]: Application <SBApplication: 0x123e6d0> com.yourcompany.new1 activate: animated deactivate: exited abnormally with signal 256: Unknown signal: 256
May 8 16:17:51 th084134 SpringBoard[1170]: Unable to obtain task name port for com.yourcompany.new1. Either it failed to exec or it terminated immediately: (os/kern) failure
May 8 16:17:51 th084134 com.apple.launchd[164] (UIKitApplication:com.yourcompany.new1[0xa455][1171]): Bug: launchd_core_logic.c:2812 (23714):103: sandbox_init(j->seatbelt_profile, j->seatbelt_flags, &seatbelt_err_buf) != -1
May 8 16:17:51 th084134 com.apple.launchd[164] (UIKitApplication:com.yourcompany.new1[0xa455][1171]): Sandbox failed to init: Cannot apply builtin profile `/Users/test/Library/Application Support/iPhone Simulator/User/Applications/5D55807A-7489-4DC5-B4D7-2ECD5E230F29.sb': Policy not found
May 8 16:17:51 th084134 com.apple.launchd[164] (UIKitApplication:com.yourcompany.new1[0xa455][1171]): Exited with exit code: 1
May 8 16:17:51 th084134 [0x0-0x2e02e].com.apple.iphonesimulator[1168]: 2009-05-08 16:17:51.026 SpringBoard[1170:10b] Unable to obtain task name port for com.yourcompany.new1. Either it failed to exec or it terminated immediately: (os/kern) failure
Here is a discussion about how to run app in simulator via command line, hope it helps to understand how does xcode and simulator works.
But I didn't work it out.
Well, I "solved" it by install another distribution of hackintosh(IPC 10.5.6), works perfect!
In my case, I was adding a target to an existing app that had always worked. In my case, I had forgotten to select all the source code, xibs, frameworks, etc. and click their target checkbox. My clue was that the build happened instantaneously, which didn't make any sense. It never built anything. It just failed to install in the simulator. Once I included all the source files, etc., for the new target, then it built and installed fine.
I had the same problem, I fixed it by launching the simulator through another app and deleting the app I was trying to run on it. Then try to build and run and worked perfect.
Cheers
Matt
I had the same problem. I had accidentally added my info.plist file to my target and it was getting copied to the app bundle every time I built the application. So there were 2 .plist files in the bundle - mine and the Info.plist, created by XCode - which confused the simulator.
Simply delete the app from the simulator (and/or device if you're attempting to run on your device) via the UI of the simulator, then shut the simulator down and attempt to re-run the app. Doing the deletion of the actual files backing the simulator will also remove the app and do the same thing (but the deletion via the simulator's UI, if it works for you, is a little bit faster and easier).
Is your CPU Intel, and, of a model distributed in Apple hardware?
I doubt the Simulator will work reliably (if at all) on non-Intel CPUs and/or in VMWare. The simulator is very CPU specific in order to reflect the arm hardware of the iPhone.
The SDK ONLY supports Intel hardware from Apple.
There is a significant effort involved in creating the simulator and it's not easy or cheap (read, thousands of man hours) to support every CPU.
I fixed this problem by removing the "Icon already includes gloss and bevel effect" property from the Info.plist file in my project.
My problem centered around a Product Name the simulator simply wouldn't accept. Picking alternative names got me past the problem. Changing the name back to the original suspect choked the simulator every time.
Try moving the project to your local hard driver and opening it from there! That solved the issue for me (the project used to be stored on a samba share).
My fix:
restarted the Mac and it was fixed. (before that tried clearing caches, deleting caches from iPhone Simulator, cleaning, rebuilding, quitting OS, quitting Simulator, nothing worked.) Restarting the OS worked.
This was bugging me too but finally got it working.
Unfortunately, I can't reproduce what I did it but here's my list of actions for your information.
The project causing the problem was one I'd downloaded from Apple and tweaked.
Interestingly, I could still launch my own projects fine.
So, here's a list of actions that I did (note that none of the actions below worked just by itself):
- closing the simulator and doing "clear file history"
- restarting simulator
- rebooting
- restarting xcode
- resetting the iPhone with Reset Content and Settings
However, by the time I'd tried all of the above with a fresh version of the code I'd downloaded - it was working again. Just out of interest, I dragged the project that was causing this problem back to the desktop and it was OK now.
Wow, what a pain. I had to uninstall XCode 4 via the command line and then install XCode 3 again. Make sure that you restart after you reinstall. Working...
why anybody didn't tell about restarting simulator.
In my case,
Resetting the iPhone with Reset Content and Settings
and
**ReStart Simulator**
works well~
I had the exact same problem - I reset the iphone simulator and then quit the simulator then started it again.