Unable to use webrtc in react native - reactjs

I am trying to use webrtc in my react native app but whenever i install my app , it closes automatically this starts happening after I installed the react-native-webrtc package in my app ,before that my app was working
here's my package.json
{
"name": "demoApp",
"version": "0.0.1",
"private": true,
"scripts": {
"android": "react-native run-android",
"ios": "react-native run-ios",
"start": "react-native start",
"test": "jest",
"lint": "eslint ."
},
"dependencies": {
"react": "16.11.0",
"react-native": "0.62.1",
"react-native-webrtc": "^1.75.0"
},
"devDependencies": {
"#babel/core": "^7.9.0",
"#babel/runtime": "^7.9.2",
"#react-native-community/eslint-config": "^1.0.0",
"babel-jest": "^25.2.6",
"eslint": "^6.8.0",
"jest": "^25.2.7",
"metro-react-native-babel-preset": "^0.59.0",
"react-test-renderer": "16.11.0"
},
"jest": {
"preset": "react-native"
}
}
I even tried 1.75.1 and 1.75.0 version of react-native-webrtc but still Same Issue

After install react-native-webrtc package,
you have to follow this guide.

Simply add this in your gradle.properties:
android.enableDexingArtifactTransform.desugaring=false
and enjoy!

Related

require('../renderer/shims/react native').render(renderable roottag)

When I use IOS Simulator, I am being shown this error
require('../renderer/shims/react native').render(renderable roottag)
enter image description here
Here is my package.json file
{
"name": "FP",
"version": "0.0.1",
"private": true,
"scripts": {
"android": "react-native run-android",
"ios": "react-native run-ios",
"start": "react-native start",
"test": "jest",
"lint": "eslint ."
},
"dependencies": {
"react": "18.0.0",
"react-native": "0.69.2"
},
"devDependencies": {
"#babel/core": "^7.12.9",
"#babel/runtime": "^7.12.5",
"#react-native-community/eslint-config": "^2.0.0",
"babel-jest": "^26.6.3",
"eslint": "^7.32.0",
"jest": "^26.6.3",
"metro-react-native-babel-preset": "^0.70.3",
"react-test-renderer": "18.0.0"
},
"jest": {
"preset": "react-native"
}
}
I've tried to upgrade react-native but I have the latest version '0.69.2'

** BUILD FAILED ** The following build commands failed: CompileC 'npx react-native run-ios'

When I create a brand new project using npx react-native init <Project_Name>, it doesn't run when using the npx react-native run-ios. Like the command is supposed to do, the app should build and start running on the iOS Simulator. I'm using a MacBook Air 2020 with the processor being 1.1GHz Quad-Core Intel Core i5 and has 8GB memory. I'm getting this error message instead:
** BUILD FAILED **
The following build commands failed:
CompileC /Users/vawesome/Library/Developer/Xcode/DerivedData/test4-eeynbnaaulduvdaotexpgrsehmgl/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/Flipper.build/Objects-normal/x86_64/FlipperRSocketResponder.o /Users/vawesome/test4/test4/ios/Pods/Flipper/xplat/Flipper/FlipperRSocketResponder.cpp normal x86_64 c++ com.apple.compilers.llvm.clang.1_0.compiler (in target 'Flipper' from project 'Pods')
(1 failure)
So far, I've tried:
Deleting Podfile and re-installing it
Creating a new project
Re-setting up my environment
Here Is My Package.json
{
"name": "test",
"version": "0.0.9",
"private": true,
"scripts": {
"android": "react-native run-android",
"ios": "react-native run-ios",
"start": "react-native start",
"test": "jest",
"lint": "eslint ."
},
"dependencies": {
"react": "17.0.1",
"react-native": "0.64.0"
},
"devDependencies": {
"#babel/core": "^7.12.9",
"#babel/runtime": "^7.12.5",
"#react-native-community/eslint-config": "^2.0.0",
"babel-jest": "^26.6.3",
"eslint": "7.14.0",
"jest": "^26.6.3",
"metro-react-native-babel-preset": "^0.64.0",
"react-test-renderer": "17.0.1"
},
"jest": {
"preset": "react-native"
}
}

React native won't start

I'm new to React Native. I used the React Native Firebase starter kit and followed all the steps, but as soon as I want to start, it gets stuck at this screen:
Has anyone experienced this or know how to fix this?
UPDATE: When I run npm run iOS I get the following error:
Content of Package.json
{
"name": "ReactNativeStarter",
"version": "0.1.0",
"private": true,
"devDependencies": {
"babel-install": "2.1.0",
"babel-jest": "^23.4.0",
"babel-preset-react-native-stage-0": "^1.0.1",
"fs-extra": "^6.0.1",
"jest": "^23.4.0",
"react-test-renderer": "^16.4.1",
"replace-in-file": "^3.4.0"
},
"scripts": {
"android": "react-native run-android",
"ios": "react-native run-ios",
"rename": "node ./bin/rename.js",
"start": "react-native start",
"test": "jest"
},
"jest": {
"preset": "react-native"
},
"dependencies": {
"fbjs": "^0.8.17",
"react": "^16.3.2",
"react-native": "^0.56.0",
"react-native-firebase": "^4.3.6"
}
}
Content of .babelrc
{
"presets": [
"babel-preset-react-native-stage-0/decorator-support"
],
"env": {
"development": {
"plugins": [
"transform-react-jsx-source"
]
}
}
}
Looks like Babel needs to be upgraded.
When upgrading to 0.56, make sure to bump your babel-preset-react-native package.json dependency to ^5.0.1 or newer.
However, you are using babel-preset-react-native-stage-0 which does not seem to support React Native 0.56.0. See https://github.com/skevy/babel-preset-react-native-stage-0/issues/8
My advice would be to try using babel-preset-react-native until a fix for babel-preset-react-native-stage-0 is released.

Babel version error when react-native bundle

When i try to run:
react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res
I receive this error:
Requires Babel "^7.0.0-0", but was loaded with "6.26.3". If you are sure you have a compatible version of #babel/core, it is likely that something in your build process is loading the wrong version. Inspect the stack trace of this error to look for the first entry that doesn't mention "#babel/core" or "babel-core" to see what is calling Babel. (While processing preset: "C:\\..\\AppDirectory\\node_modules\\#babel\\preset-env\\lib\\index.js")
I've tried removing node-modules directory, cleaning cache, npm install, etc, etc, etc. I've also tried installing Babel manually but the same issue persists.
I had the same error before when generating the .apk, but could solve it installing babel dependencies, now this doesn't work neither.
This is my package.json
{
"name": "Appname",
"version": "0.1.0",
"private": true,
"devDependencies": {
"react-test-renderer": "16.3.1",
"babel-preset-react-native-stage-0": "^1.0.1"
},
"scripts": {
"start": "react-native start",
"android": "react-native run-android",
"ios": "react-native run-ios",
"test": "jest"
},
"dependencies": {
"#babel/core": "^7.0.0-beta.54",
"#babel/preset-env": "^7.0.0-beta.54",
"#babel/preset-react": "^7.0.0-beta.54",
"babel-core": "^6.26.3",
"babel-preset-react-native": "^2.1.0",
"babel-upgrade": "0.0.20",
"react": "16.3.1",
"react-native": "^0.55",
"react-native-circle-checkbox": "^0.1.6",
"react-native-modal": "^6.4.0",
"react-native-phone-call": "^1.0.7",
"react-navigation": "^2.6.2",
"react-redux": "^5.0.7",
"react-router-native": "^4.3.0",
"redux": "^4.0.0",
"redux-thunk": "^2.3.0"
}
}
And this is my .babelrc file:
{
"presets": ["#babel/react"],
"env": {
"development": {
"plugins": [
"transform-react-jsx-source"
]
}
}
}

Plugin/Preset files are not allowed to export objects, only functions - v 0.56.0

I'm facing this issue in react native v-0.56.0. Please Help me out. When i am downgrading to 50 or 49 it's working fine, but on latest version it's giving this error when creating build !
cmd npm run ios
My babelrc
{
"presets": [
"babel-preset-react-native-stage-0/decorator-support"
],
"env": {
"development": {
"plugins": [
"transform-react-jsx-source"
]
}
}
}
And my package.json
{
"name": "my-project",
"version": "0.1.0",
"private": true,
"devDependencies": {
"babel-preset-react-native": "^5.0.0",
"babel-preset-react-native-stage-0": "^1.0.1",
"jest": "^23.3.0",
"jest-react-native": "^18.0.0",
"react-test-renderer": "16.3.1"
},
"scripts": {
"start": "react-native start",
"android": "react-native run-android",
"ios": "react-native run-ios",
"test": "jest"
},
"jest": {
"preset": "react-native"
},
"dependencies": {
"react": "^16.3.0",
"react-native": "^0.56.0",
"react-redux": "^5.0.7",
"redux": "^4.0.0"
}
}

Resources