-
Notifications
You must be signed in to change notification settings - Fork 24.7k
Cannot add WatchOS target to React Native App #30155
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
|
Here are the versions for React Native, xCode, and macOS...
I don't have an Android environment setup yet, but
|
It seems like the React Native iOS app is written in Objective-C, and I am trying to add a WatchOS Target that uses Swift. If I make the WatchOS target Objective-C, I do not get any errors. Everything builds and runs as expected. Is there a way to add a Swift Target to an Objective-C project? Can I add a WatchOS target that uses Swift to a React Native App? |
I was able to resolve this issue by changing the Library Search Paths Build Setting. In your project select the Watch Extension Target, then Build Settings Menu, and find the Library Search Paths setting. (You need to make sure the "All" filter is selected or you will not see this setting). In it's value you'll see two links, use the first one only... Set the value ov Library Search Paths to: This worked for me 🎉🥳 |
I have developed a couple of watch apps and I am getting the hang of it, but when I try to add a watch os target to a React Native App I get 47 errors that I do not understand.
I am attempting to follow this tutorial - How to add an Apple Watch Extension To your react native application.
Steps to Reproduce
1. Create a new React Native Project
First, I created a new React Native Project. (success ✅)
2. Build and Run the React Native Project
Then I can build and run the project. (success ✅)
3. Open the Project Workspace and add a Target
Next, I open the workspace file. At this point the React Native app builds and runs from xCode without issue too.
Inside the workspace I select the main project and click the
+
under targets.From here I select
watchOS
andWatch App for iOS App
:With the following settings:
And I activate the target when asked:
And the Target is created.
6. Run the Watch Target
This is where the problems begin to surface. The first thing I notice is there is one error in the
WatchApp Extension
after the target is created:There is some sort of problem Compiling Swift Sources?
If I try to run the
WatchApp
target in the simulator I get 47 errors:How can I resolve these errors and run a basic
Hello World
with React Native and Apple Watch?Package Versions
react-native
Full Error Text
The text was updated successfully, but these errors were encountered: