Why can't I run my WatchOS 2 app? - watchkit

It runs just fine on the iPhone. When I select the Watch App Target, however, it simply won't run on the watch.
I don't get any errors or anything. I can see the app downloading on the Watch sometimes; when it does download, it deletes itself the moment the download is complete.
I've tried uninstalling the watch app and reinstalling via the Apple Watch app on the iPhone, and the same thing happens: it downloads and deletes itself before I can run it.
I've also reset the watch, reset Xcode, deleted the iOS app, and just about everything else I could possibly think off, but I'm starting to lose my mind.
The problem started happening when I (attempted to) set up the Watch Connectivity framework. I don't know if this is related. I've been unable to verify that WC is working properly as I can't open the app.
I've been lucky enough to get it to actually load on the watch only a few times since integrating WC framework, but even when I have, all I got was the loading screen for about a minute each time.
UPDATE:
I'm now seeing some consistent behavior.
I'm now able to debug my app by launching the watch app via Xcode. The app icon does not appear at all on the watch when this happens, however. (Weirdly enough, it shows the launch screen for a different watch app when launching.) So I can't run the app at all unless it is launched from Xcode.
Also, I am not able to download the app to the watch via the phone. I want to be able to run it outside of debug mode, and I can't. When I attempt to install it from the Apple Watch iOS9 app, the install begins, I see the icon on the watch as it downloads, and just as it finishes, it deletes itself from the watch before I can run it. This just keeps happening.
Please help!

Make sure your Apple Watch device ID is in your provisioning profile.

So, this kind of sucks as an answer, but I've had enough.
I decided to copy all of my code and storyboards into a new Xcode project. The Watch App now works exactly as it should. Hopefully Apple sorts out these bugs in an update.

I believe repairing the watch would help as well. I had the same problem before and the only thing which helped was repairing the watch.
I also have other issues debugging the watch app properly - see my question here Proper way to debug watchos2 app in XCode7

Related

Firebase Endlessly Generates My Project ID

Whenever I try to create a firebase project in the console it won't let me continue and just endlessly tries to generate my project ID. I've tried many times but it just won't work. It is very frustrating.
Edit - So I tried on my Samsung phone and it worked, I think it may of had to do with the fact that I'm on a macbook. However, it still won't let me open the project on my mac even once I created it on my phone.

Hot restart error with cannot copy ipa file

While I am aware that Hot Restart is in preview, it was for quite a while now and my testing never really worked since the first time I've tried it. I've waited for a few VS studio versions to come up, hoping that my issue will be fixed. Since I've kept an eye on issues and haven't seen something similar, I tend to believe that the issue is locally with my setup.
Here is the situation:
I've enabled Hot Restart in VS and added my account, picked the team (after I was added) and everything went fine without errors. I have a free apple account, but after I was added to a Team I was able to obtain automatic provisioning to work.
I've tried to set the debug build options similar to how the simulator was set
I've disabled device specific build as I saw in the docs that it can create problems.
I've installed iTunes just as specified in the docs and when I connect my device to my Windows 10 PC, I can select it from the list.
So basically it looks like everything is set up. I use for testing an iphone 7 with latest iOS version.
Here is what happens:
I've selected different types of output logs hopeing to catch some error in there that could lead me to find a solution.
when starting to build I can see "Building offline for a local device" and I can see my provisioning file details on "Detected signed identity"
I see no apparent error while it compiles and does its job, no complains about signing
then it gets to the IpaCopyToStagingDirectory and there it starts to copy a bunch of files from bin\Iphone\Debug to Artifacts\app.iOS.dSYM where I get the final error: Could not copy the file bin\iPhone\Debug\\app.iOS.ipa because it was not found
If I go to the bin folder, there are many files, including app.iOS.exe, but indeed there is no ipa file. I also don't know why it has two \ on its path.
Any ideas why is not working?

Expo: "Something went wrong" immediately on start

I have used Expo a few times successfully before, but for a few days now, I am unable to get into the Expo App. Whenever I open it, I see the Expo icon for a few seconds up to even minutes, and then it redirects me to the blue "Something went wrong" screen, as if I had tried to open an app.
But I didn't! It doesn't even let me scan a QR code, it just always shows this error. If I click the back button in the app, it simply terminates. I have ensured that it is the latest version and already reinstalled it once.
It seems like it somehow had locked itself onto an old, now non-existant server, and kept at it after reinstalling the app. Here is how I solved the problem:
In the metro bundler, choose connection type "Tunnel" and copy and send the URL to your phone. If you then click on it on your phone, it should redirect to the expo app. After that it got unstuck and I could finally use it normally with the QR code again!
The tools sometimes do get locked into this state.
Close and restart all components (Expo cli, browser tabs and clients) making sure to:
Kill any stray processes on the server (you need to check Activity Monitor / Process Explorer or similar depending on your platform)
Force quit all client devices and simulators using the correct method for each platform. To verify that the client process has actually been killed, check that the app splash screen is displayed for a short while when invoking it.
Clear the Expo cache when starting again: $ expo start --clear
I ran into the same issue. Solved it by going to the left sidebar in the Metro Bundler and sending a link via email!
I've tried many of the solutions and only one worked for me (which i found trying random things). I already had 'allow display over other apps' turned on (Android/OnePlus 6t) and didn't think it had anything to do with that. But I tried this...
Close the Expo app, go the the app settings and turn off 'allow display over other apps', open the expo app and [when prompted] turn on 'allow display over other apps' again.
That seems to work in my case - at least until the next time.

iOS Simulator keeps asking for an app to simulate

I only use the iOS simulator for testing websites, not actual apps. Today I opened it up and it keeps asking me for an app for it to simulate. If I click cancel, it just quits the simulator.
I've tried deleting preference files, but I'm just not familiar enough with the simulator to know what's going on. How can I just get this back to normal, or satisfy this dialog?
I think you could try the menu
iOS Simulator -> Reset Content and Settings...
This would clean your simulator storage.
Update
According to this link, Cleaning up the iPhone simulator
move to path
/Users/<username>/Library/Application Support/iPhone Simulator/{6.0 / 6.1}
You could try to clean it manually

In app purchase didReceiveResponse does not show my product

By some mysterious reasons I got myself a jailbroken iPhone 3GS from a vendor whom I am finding difficult to track.
My task is to test out in app purchase functionality on it.
Currently it has iOS 5.0.1 with cydia installed.
No, it does not have Appsync.
I am installing my build through testflightapp API which works without issues with my app so far.
However when I initiate in app purchase, I don't get anything in response.products so far.
I have added productIDs and all in itunes-connect already, checked twice that they are fine, since 48 hours.
I tried testing with iPhone simulator 5.1, but all I got was no values from storekit. I would love to hear if there is any workaround with simulator.
Worked around this finally - deleted my app from itunes connect, re-added it.
It complained about name being already used.
I changed the language of name. And it worked.
Maybe, my prior app setup was right, but I had something else messed up.
In between, I rejected my app. That maybe one of the reason behind this issue.
Lesson?
Don't developer reject your app.

Resources