Skip to content

Commit

Permalink
Fix: Build Failing on latest Xcode (#32)
Browse files Browse the repository at this point in the history
* added project running steps for application

* feat: Update Flipper pod to include missing header file

* Added comments
  • Loading branch information
abhishek310001 authored Jul 22, 2024
1 parent 79e2882 commit 1d81590
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 2 deletions.
43 changes: 42 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,4 +137,45 @@ For more details, go to [React Native Environment Setup](https://reactnative.dev
- Rename folders `Boilerplate....` according to your project name.
- Delete the `project.pbxproj` file in the `Boilerplate.xcodeproj` folder.
- Delete the `Boilerplate.xcscheme` file in the `Boilerplate.xcodeproj/xcshareddata/xcschemes` folder.
- Update `FileRef location` in `Boilerplate.xcwor
- Update `FileRef location` in `Boilerplate.xcworkspace/contents.xcworkspacedata`
- Update `self.moduleName` in `Boilerplate/AppDelegate.mm`
- Update `CFBundleDisplayName` in `Boilerplate/Info.plist`
- Update `label` in `Boilerplate/LaunchScreen.storyboard`
- Update `interface` and `implementation` in `BoilerplateTests/BoilerplateTests.m`
- Update `target` in `Podfile` (main and Tests)
- Delete `Podfile.lock` file
- Install `pod`.
- run `pod install` command (in `ios/` folder)
# Running the project
Assuming you have all requirements installed, you can run the project by running:
- `yarn start` to start the metro bundler, in a dedicated terminal window
- `yarn ios` or `yarn android` to run the application on any of these platform
# Using Localhost Backend Endpoint on Android
To use the localhost backend endpoint on Android, you need to follow one of these steps:
- Expose your local backend using ngrok or any other similar software.
- Use `adb reverse tcp` to forward the port from your machine to the Android device:
```
adb -s <emulator_device_id> reverse tcp:<localhost_port> tcp:<localhost_port>
```
Then, update the `API_BASE_URL` in your `.env` file accordingly.
## Troubleshooting guides
- In MacBook, you'll get a warning prompt similar to this - `XXXXX Can't be opened because it is unidentified developer`, when you try to launch android emulator.
To fix this, follow these steps:
```
Click on Cancel on the message,
Now go to Apple Menu: System Preferences... / System Settings...
Click on Privacy & Security
Here you should see "Allow apps downloaded from: "Android Emulator" was blocked from use because it is not from an identified developer."
Click on open Anyways
You will again see a warning prompt saying "Running "Android Emulator" will harm your computer"
Click on open
```
16 changes: 16 additions & 0 deletions ios/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,22 @@ target 'Boilerplate' do
end

post_install do |installer|

# This is a workaround for an issue causing iOS builds to fail due to missing include in Flipper.
# For more details, see: https://github.com/facebook/react-native/issues/43335#issuecomment-1980788427
installer.pods_project.targets.each do |target|
if target.name == 'Flipper'
file_path = 'Pods/Flipper/xplat/Flipper/FlipperTransportTypes.h'
contents = File.read(file_path)
unless contents.include?('#include <functional>')
File.open(file_path, 'w') do |file|
file.puts('#include <functional>')
file.puts(contents)
end
end
end
end

# https://github.com/facebook/react-native/blob/main/packages/react-native/scripts/react_native_pods.rb#L197-L202
react_native_post_install(
installer,
Expand Down
2 changes: 1 addition & 1 deletion ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -852,6 +852,6 @@ SPEC CHECKSUMS:
Yoga: 65286bb6a07edce5e4fe8c90774da977ae8fc009
YogaKit: f782866e155069a2cca2517aafea43200b01fd5a

PODFILE CHECKSUM: 641830ab5952518edb456584ae7206225e7538d2
PODFILE CHECKSUM: 1cd0f385bbc3fd8b0530c0264700ebff8d74e2c3

COCOAPODS: 1.15.2

0 comments on commit 1d81590

Please sign in to comment.