ezranbayantemur / react-native-rtmp-publisher

📹 Live stream RTMP Publisher for React Native
MIT License
98 stars 14 forks source link

iOS - Fails to build #24

Closed erikpena closed 1 year ago

erikpena commented 1 year ago

Describe the bug

When attempting to build an iOS project using this React Native package, I'm getting build failures that point to an issue with 'react-native-rtmp-publisher'—

** BUILD FAILED **

The following build commands failed:
        SwiftEmitModule normal arm64 Emitting\ module\ for\ react_native_rtmp_publisher (in target 'react-native-rtmp-publisher' from project 'Pods')
(1 failure)

info Run CLI with --verbose flag for more details.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

To Reproduce

  1. Create a new Typescript-based React Native project: npx react-native init AwesomeTSProject --template react-native-template-typescript
  2. Install react-native-rtmp-publisher and be sure to run pod install in the ./ios subdirectory
  3. Follow the iOS specific steps outlined in the README
  4. In the terminal, attempt to run the command to build and launch the app: yarn ios

Expected behavior

The app to build successfully and the app to launch.

Version

"dependencies": {
    ...
    "react": "18.1.0",
    "react-native": "0.70.6",
    ...
    "react-native-rtmp-publisher": "^0.4.6",
    ...
  },

Smartphone info.

Additional context

No response

Screenshots

Screenshot 2023-01-10 at 3 53 59 PM

Relevant log output

No response

erikpena commented 1 year ago

Doing a quick google on the error, I found this which seems to be related—

https://stackoverflow.com/questions/73833458/swiftemitmodule-normal-arm64-emitting-module-for-yogakit-in-target-yogakit

The TL;DR is that builds requires a physical device for building/deploying (which makes sense, I was attempting to test on the Simulator). After setting my iPhone up for Developer Mode and trying again, I'm getting a new set of errors in Xcode—

Screenshot 2023-01-10 at 10 33 10 PM
erikpena commented 1 year ago

Also, FWIW, it would be great if deploying to a Simulator didn't break builds. It makes sense that this library shouldn't work on Simulator, but if a developer is trying to do a quick-check for the UI/UX, they should be able to deploy and check it out without the ability to do a live stream.

For reference, we previously were doing this with nodemediaclient and we would be presented with a black screen when working with the Simulator.

ezranbayantemur commented 1 year ago

@erikpena Actually it should work with simulator too, as like you said black screen.

Can you try to run a build on the example project? I'll be looking at the issue

erikpena commented 1 year ago

@ezranbayantemur yes, I can give that a shot and will let you know how it goes.

erikpena commented 1 year ago

Hey @ezranbayantemur, So I just gave it a go and it's failing for me. Here is what I did—

  1. Clone the react-native-rtmp-publisher repo
  2. Run yarn example in the terminal
  3. Changed directory to ./example/ios <- this step is missing from the readme
  4. Run pod install <- this step is missing from the readme
  5. Changed directory to ../
  6. Run yarn ios

I get the following error message in the terminal which indicates that the build failed—

CompileAssetCatalog /Users/erik.pena/Library/Developer/Xcode/DerivedData/RtmpExample-gazthtnwqdlimpczjktknfbkuhyn/Build/Products/Debug-iphonesimulator/RtmpExample.app /Users/erik.pena/github/react-native-rtmp-publisher/example/ios/RtmpExample/Images.xcassets (in target 'RtmpExample' from project 'RtmpExample')
    cd /Users/erik.pena/github/react-native-rtmp-publisher/example/ios
    /Applications/Xcode.app/Contents/Developer/usr/bin/actool --output-format human-readable-text --notices --warnings --export-dependency-info /Users/erik.pena/Library/Developer/Xcode/DerivedData/RtmpExample-gazthtnwqdlimpczjktknfbkuhyn/Build/Intermediates.noindex/RtmpExample.build/Debug-iphonesimulator/RtmpExample.build/assetcatalog_dependencies --output-partial-info-plist /Users/erik.pena/Library/Developer/Xcode/DerivedData/RtmpExample-gazthtnwqdlimpczjktknfbkuhyn/Build/Intermediates.noindex/RtmpExample.build/Debug-iphonesimulator/RtmpExample.build/assetcatalog_generated_info.plist --app-icon AppIcon --compress-pngs --enable-on-demand-resources YES --filter-for-thinning-device-configuration iPhone14,7 --filter-for-device-os-version 16.1 --development-region en --target-device iphone --minimum-deployment-target 11.0 --platform iphonesimulator --compile /Users/erik.pena/Library/Developer/Xcode/DerivedData/RtmpExample-gazthtnwqdlimpczjktknfbkuhyn/Build/Products/Debug-iphonesimulator/RtmpExample.app /Users/erik.pena/github/react-native-rtmp-publisher/example/ios/RtmpExample/Images.xcassets

** BUILD FAILED **

The following build commands failed:
        CompileC /Users/erik.pena/Library/Developer/Xcode/DerivedData/RtmpExample-gazthtnwqdlimpczjktknfbkuhyn/Build/Intermediates.noindex/RtmpExample.build/Debug-iphonesimulator/RtmpExample.build/Objects-normal/x86_64/RtmpExample_vers.o /Users/erik.pena/Library/Developer/Xcode/DerivedData/RtmpExample-gazthtnwqdlimpczjktknfbkuhyn/Build/Intermediates.noindex/RtmpExample.build/Debug-iphonesimulator/RtmpExample.build/DerivedSources/RtmpExample_vers.c normal x86_64 c com.apple.compilers.llvm.clang.1_0.compiler (in target 'RtmpExample' from project 'RtmpExample')
(1 failure)

info Run CLI with --verbose flag for more details.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

When I attempt to build in Xcode, I get these error—

Screenshot 2023-01-13 at 4 12 26 PM

Am I missing any steps or did I do something incorrectly here?

ezranbayantemur commented 1 year ago

I'll check the example soon as I can and notify you

codal-mpawar commented 1 year ago

@ezranbayantemur Any update on this?

ezranbayantemur commented 1 year ago

I'm working on in it @codal-mpawar

ezranbayantemur commented 1 year ago

@erikpena I've updated the README.md file for about example project build. There was a misleading introduction for example project, sorry about that and thank you for noticing about it.

Basically you can just clone the repo and yarn + cd example && yarn ios

When I run the project on example I don't see any problem and like I said you can see the black screen as camera view. Screenshot 2023-01-21 at 01 31 47

But right now, as you said there is a problem on iOS build when add the package to fresh project. Currently I'm working on it.

ezranbayantemur commented 1 year ago

@erikpena I've released 0.4.7 version and this issue should be fixed.

Can you try with the new version?

turkmenkaan commented 1 year ago

I was having a similar issue. With the new version, it built perfectly fine on my M1 machine. This saved me the hassle of building an RTMP publisher separately for IOS and Android. Çok teşekkürler!

ezranbayantemur commented 1 year ago

@erikpena I'm closing this issue as resolved. You can open it again if it happens again.