Share extension working on simulator but not on device - xcode

I have a share-extension bounded with my app. I have all the required app-ids and provisioning-profiles related to the extension, for both development and distribution. When I run the extension in the simulator, it works perfectly fine. On device (i.e. iPhone 6), for example, when choose my app's share extension within Safari, Safari freezes and nothing opens. I cannot even debug it, not because that I don't know how to do it but because it runs and immediately stops running afterwards on Xcode.
I think that something might be wrong with the provisioning-profiles or app-ids or it might be a bug or a 'missing functionality prior to distribution' caused by Apple.
I would very much appreciate it if someone has any solution to or explanation about it.
EDIT:
I changed the background-color of the extension's view on storyboard to see if it does not work at all. It does open, but SLComposeServiceViewController did not show up. Thus, the problem must be caused by it.

If there is anyone still having this issue, please check your Share Extension deployment info and ensure your target OS is lower than your phone's OS

I finally solved my problem. It was not a provisioning-profile nor an app-id issue. I had written
override func viewDidAppear(animated: Bool) {}
method in the SLComposeServiceViewController class. It turns out that the only culprit was this method. I removed that and the share extension worked perfectly.

Related

Xamarin Remote Simulator results in blank screen

I know this feature is very new, so I'm hoping someone has had experience with this issue before and may shed some light on what might be going on. Right now we are trying to utilize Xamarin 4.2's new "remote iOS simulator for Windows". When I build to Mac simulator, it works fine the app shows up and no issues. When I turn on the option to use the remote simulator, the simulator opens, and then there's just a blank screen, as you can see from the screenshot there's no errors and it built fine:
Looks like you are hitting the following:
https://bugzilla.xamarin.com/show_bug.cgi?id=42333
The remote simulator is in preview, so there are likely to be bugs that have not been fixed yet. I'd suggest adding a comment to that bug report with any information you can provide.
If you would like to receive a notification when the bug is updated, you can add yourself to the CC list for the bug. Please note that you will need to create an account on that system if you have not already done so.

iOS9 Share Extension can not debug on Xcode

When I build share extension from Xcode for the real device, Xcode arbitrarily stop debug. But when I launch for simulator, the problem does not occur.
Environment
Xcode 7.1.1
iOS 9.1
Details
When I build share extension, Xcode shows "Finished running MobileSafari.app on iPhone", but Safari does not run. And, The square stop button is arbitrarily gray. So, I launch Safari by myself and choose my extension and post. The debug section does not show anything. Also, URL request is not sent Rails server.
This is the picture when I build the share extension for the real device.
I do not know why the real device can not launch share extension at Xcode.
If anyone know the answer about this problem, please tell me.
Typically you can debug a share extension by going to Debug -> Attach to process or PID and entering the name of your share extension. From there you can open the share extension on your device or simulator and Xcode's debugger should attach and hit breakpoints correctly. However, I've noticed that log messages do not show up when doing this, nor do values populate for variables in the debugger view.
Here's how I got the debugging to work correctly. Run the share extension scheme. When it asks you what app to run, chose 'Photos' (because that's the app your extension will operate in). The Photos app will then launch on your device and you may proceed to use your extension. The debugger in Xcode should then work as expected.
I encountered this issue as well, though unfortunately I don't know the exact solution, maybe I can offer some information that might be helpful.
I (like you, judging by your screenshot) was using Cocoapods, and Cocoapods was copying resources from the pods into the bundle of the app extension after it was code signed. If memory serves, this was interfering with the code signing in some way, and therefore preventing the app from running under the debugger.
I believe that one of the symptoms of this was that logs appeared in the mac's console (or the device's console, can't remember which) saying something about "blasting onto the device using the old skool[sic] method."
You could confirm that this is the case by removing Cocoapods from your project, or any pods that require resources to be copied after compilation. I believe that the solution was to add some kind of special build phase to the extension project to copy the bundle resources, and disabling whatever Cocoapods uses by default.
As a temporary solution, I believe that deleting your app from the device should allow you to attach the debugger once, on the run where the app is installed for the first time. You might also try deleting derived data for your project.

iOS Today View Not Running on Device

I have created my first Today View extension that just displaying some texted it retrieves from a shared NSUserDefaults. It works perfectly and is ready to be shipped based off of how it displays and works through simulator, but when I try to run it on my device nothing happens.
The widget shows up in notification center but it has no height. I run my main app from Xcode and it wont let me attach the debugger to it and none of my breakpoints, nslogs get hit.
I tried running the Today View target on device and I can't get the provisioning profiles to be accepted. I also tried attaching the process of the today view to the debugger with the full bundle ID and it never attaches no matter wether I open notification center or not.
Im very new with extensions and have searched a ton around for an answer to this but cant find anything that worked.
Any help would be greatly appreciated, thanks.
and in my case i tested on SDK 8.2 and my test device running on 8.1.1 totally forgotten about Deployment target changing to 8.0 worked like charm..Might be helpful for the one careless like me..
For anyone that may stumble upon this all I had was add arm64 to the list of acceptable architectures and it worked
In your widget build settings set the architectures to armv7, arm64
see this post iOs today extension do not launch - lost connection to device

Cannot find executable for CFBundle CertUIFramework.axbundle

Just updated to Xcode 5 and this is the first error its throwing on the logger for all my apps. Can't seem to understand why this is happening.
2013-09-19 10:46:54.341 MyApp[1156:a0b] Cannot find executable
for CFBundle 0x8a7c7a0 </Applications/Xcode.app/Contents/Developer/Platforms/
iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.0.sdk/
System/Library/AccessibilityBundles/CertUIFramework.axbundle> (not loaded)
Edit (11-11-2013): To everyone reading, once I waiting for a solid working solution to accept and close. The highest voted answer works until you re-open the project only.
Edit (30-09-2014): I can see this has been sorted since XCode 6 has been released! Finally
Final Edit-
Temporary workaround: click iOS Simulator > Reset Content and
Settings... and run again.
This error message may reappear at random. For me, it happens when I
launch a different application. There are several threads in Apple dev
forums and in StackOverflow about this problem, but none have a
definitive answer. This seems to be a SDK error to be fixed in the
next Xcode version.
Updated: October 3.
CREDIT - Please check this answer - Xcode 5 Error CertUIFramework.axbundle
Further Edit
Although this was potentially the issue resolution at the time. I believe some of the newer answers below relating to the better touch tool are in fact the correct resolutions.
After reading Kirill's answer I did some digging as I didn't want to disable BetterTouchTool for everything just the "iOS Simulator" and you can.
Open the "iOS Simulator" and will it as the active app go to the BTT drop-down menu from the top bar (of that screen if you have more than one) and select "Disable BTT for Current App". It will turn to a play icon when it's disabled.
Make sure the app name on the bar is still "iOS Simulator" as mine jumped to "Finder" a few times when I clicked the top bar!
Now re-set the simulator (if it doesn't work) and rebuild. You shouldn't get the error! :)
Don't forget to clear the error if it's still there. ;)
BTT seems to remember what apps it's disabled for (or at least it does when you close and re-open the app that's disabled I haven't tried a system re-boot yet).
Its easy. Go iOS simulator and reset content and setting.
Thanks
If you are using XCode-5 then just reset the simulator "Reset Content and Settings" and run once again
So I was having this error too in Xcode 5 and 5.1. I wanted to figure out if it's Xcode bug or something else, so I did a fresh install of Mavericks 10.9.2 and Xcode 5.1. Everything seemed fine after multiple tests.
Here is where the problem began. I put the apps and settings that I mostly use and the error came back. So I deleted everything and started adding everything one by one. After couple days I had bingo! The problem is with BetterSnapTool and BetterTouchTool
Update 12.12.2014
Just started using Xcode 6.1 and noticed that this bug seems to be gone at least with Xcode 6.1 simulators and BTT 0.9985 versions.
Update:
As GasB pointed out, it is possible to disable BTT for certain apps. So just disable it for iOS Simulator. You just have to remember not to use gestures while using the simulator as that triggers the error message.
Simple solution:
Remove the ticks in preference pane, reset simulator and do clean build. The error message will disappear.
.
I had the same problem and solved it setting the 'Localization native development region' to match my systems region. In my case from 'en' to 'de'. The referenced files are stored in localized versions in your filesystem. So this setting is used to identify the needed version.
You can find that setting in your project settings at 'Info' -> 'Custom iOS Target Properties'.
Resetting the simulator ‘fixes’ it because it turns the accessibility support off. You can normally achieve the same by simply disabling the ‘Accessibility Inspector’ in the ‘Settings’ app.
If, however, you need it enabled, particularly hate this error message, and are feeling adventurous then you can use the following monkey patches to silence the error: https://gist.github.com/alloy/9277316. (Be sure to NOT include this in your release builds.)
Resetting the simulator is a PITA, I found a way to get rid of these messages without having to to this:
go to Settings > Accessibility
turn on Accessibility Inspector
turn off Accessibility Inspector
quit Simulator
I had this problem with Xcode 5 in ML 10.8.5
I re-installed Mountain Lion (in a Parallels' VM), then update ML to 10.8.5.
Then installrd Xcode 5, and it's worked fine.
I think that the error is caused by a third SW installed in ML.
The application Moom is also causing this issue, and I couldn't find a way to disable it for just the iOS Simulator. So for now I disabled it's accessibility features.
I'm on Mavericks (10.9.3) and encountered the same error in xCode(5.1.1).
I tried anything - reinstalling xCode from both AppStore and dmg. Resetting the emulator resulted in the same error and deleting the Simulator SDK folder gave no results too.
The issue on my end was indeed Moom as mentioned by #aorcsik! Disabling it's accessibility, followed by clean (cmd+shift+k) in xCode cleared the error.
Open Disk Utility and apply Repair Disk Permissions in Macintosh HD.
After doing above step, apply Reset Contents and Settings in iOS Simulator.
This above solution can definitely fix your problem.
I had this problem, and none of the answers in this thread could fix it. Mine was simple UI with a UIDatePicker. I resolved it by removing the UIDatePicker and the associated code, then added them in again. Problem solved!
For me it was Keyboard Maestro, adding the simulator to Maestro's exclude list silenced the warnings

IBAction not being called when button is clicked

Okay, so I'm writing an application in Xcode (version 3) for Mac OS X and I'm having trouble with my IBactions. I write them, and connect them to my buttons, but for some reason, they are never called when I click the button. I have double checked and triple checked the connections in Interface builder, but no luck. If you can't help with this, then maybe somebody knows how to manually connect actions to buttons in code? I have found Can you hard code IBActions and IBOutlets, rather than drag them manually in Interface Builder?, but that is for iphone, and what it suggests didn't seem to be in Mac OS X cocoa, only cocoa touch (Not sure though). If anybody could help, I would greatly appreciate it.
UPDATE: I can confirm that this problem is only in one project. New projects work fine.
Have you tried uninstalling your app from simulator/device and do a fresh build and run? I had the same problem and that did the trick for me.
I was running into this same problem and hoped this post had the answer. After some more testing, it seems to do with the signature of the IBAction.
This signature didn't work:
-(IBAction)myAction;
This signature did work:
-(IBAction)myAction:(id)sender;
Adding in the sender parameter seems to do the trick.

Resources