WatchKit Extension[4608:145616] Unable to find image named "hello" on Watch

3.1k Views Asked by At

Problem:

Trying to set the WKInterfaceLabel text using xCode 6.2 but it returns this error:

WatchKit Extension[4608:145616] Unable to find image named "hello" on Watch

Code:

@IBOutlet var lblPassword: WKInterfaceLabel!

lblPassword.setText("hello")
8

There are 8 best solutions below

2
On BEST ANSWER

I got the same error although I am pretty sure these image files exist.

I just terminated Xcode, relaunched it, cleaned the project (command + K) and built it. It started to work again.

I do this routine whenever I face a new problem. It solves most of the problems as you might know. Sorry if you have done it already.

0
On

For me, it looks like you have added "hello" as an image name somewhere in the storyboard. Use XCode's Find dialog to look for "hello". It will show use as an image name, too.

0
On

I supposed that you adding image to asset catalog in WatchKit Extension. This is wrong.You should add that image to asset catalog in WatchKit App. Sorry i can't add image here.

0
On

So in my case I had copied and pasted a prior row and assigned a diff class.

That duplicated row's group still had an IBOutlet connection to the prior class that I did not catch.

Once I removed that connection this stupid issue resolved itself and I was able to successfully call .setText()

0
On

Cleaning the project doesn't seem to fix the issue for me. But if you click on the image file, you'll see "Target Membership" options on the right pane. Select all of them, Clean the build and try again.

0
On

Try as I might, my images were not loaded up to the watch until I did it directly by 'caching' as follows in my InterfaceController in the WatchKit Extension:

[[WKInterfaceDevice currentDevice] addCachedImage:[UIImage imageNamed:@"carrota.png"] name:@"carrot"];

[self.portfiolioImage setImageNamed:@"carrot"];
0
On

Screen Shot 1

Ok So the keything to note here is that "you do not want to drag and drop the images into the AssetCatalog"......the only way this worked for me was to manually right click on the catalog (as shown in screen shot 1 and "Add Files"....look for the image you want to add on your local/external drive (Making Sure that only the "WatchKit App" Checkmark is selected in the Add to Targets Section" as shown in Screen Shot 2) and add the images!!

Screen Shot 2

0
On

i've had the exact same problem. solution: i've exedently connected the group parenting the WKInterfaceLabel. Try setting YOURSUPPOSEDLABLE.setTextColor(.brown), if the Background of it changes, you have connected the group.