Closed MoonTahoe closed 4 years ago
:warning: | Missing Environment Information |
---|---|
:information_source: | Your issue may be missing information about your development environment. You can obtain the missing information by running react-native info in a console. |
react-native info
command does't work. error Unreconized command "info"
.
Here are the versions for React Native, xCode, and macOS...
I don't have an Android environment setup yet, but react-native doctor
does work and here are the results:
Common
✓ Node.js
✓ yarn
✓ npm
✓ Watchman - Used for watching changes in the filesystem when in development mode
Android
✖ JDK
- Version found: N/A
- Version supported: >= 8
✓ Android Studio - Required for building and installing your app on Android
✖ Android SDK - Required for building and installing your app on Android
- Versions found: N/A
- Version supported: Not Found
✖ ANDROID_HOME
iOS
✓ Xcode - Required for building and installing your app on iOS
✓ CocoaPods - Required for installing iOS dependencies
✓ ios-deploy - Required for installing your app on a physical device with the CLI
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: "$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)"
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