Cannot Create BLE Manager - react-native

Hello I am new at React Native and in my application I am trying to scan ble devices and list their names on screen. In code sources people most commonly create a Bluetooth Low Energy Manager as const manager = new BleManager(); but when I tried this code (and of course other ways too) it gives error like
TypeError: null is not an object (evaluating '_BleModule.BleModule.createClient')
This error is located at:
in HelloWorldApp (created by ExpoRoot)
in ExpoRoot
in RCTView (created by View)
in View (created by AppContainer)
in RCTView (created by View)
in View (created by AppContainer)
in AppContainer
at node_modules\react-native\Libraries\LogBox\LogBox.js:149:8 in registerError
at node_modules\react-native\Libraries\LogBox\LogBox.js:60:8 in errorImpl
at node_modules\react-native\Libraries\LogBox\LogBox.js:34:4 in console.error
at node_modules\expo\build\environment\react-native-logs.fx.js:27:4 in error
at node_modules\react-native\Libraries\Core\ExceptionsManager.js:104:6 in reportException
at node_modules\react-native\Libraries\Core\ExceptionsManager.js:172:19 in handleException
at node_modules\react-native\Libraries\Core\ReactFiberErrorDialog.js:43:2 in showErrorDialog
at node_modules\react-native\Libraries\Renderer\implementations\ReactNativeRenderer-dev.js:15792:34 in logCapturedError
at node_modules\react-native\Libraries\Renderer\implementations\ReactNativeRenderer-dev.js:15884:20 in update.callback
at node_modules\react-native\Libraries\Renderer\implementations\ReactNativeRenderer-dev.js:7199:2 in callCallback
at node_modules\react-native\Libraries\Renderer\implementations\ReactNativeRenderer-dev.js:7220:20 in commitUpdateQueue
at node_modules\react-native\Libraries\Renderer\implementations\ReactNativeRenderer-dev.js:16632:25 in commitLifeCycles
at node_modules\react-native\Libraries\Renderer\implementations\ReactNativeRenderer-dev.js:19216:22 in commitLayoutEffects
at node_modules\react-native\Libraries\Renderer\implementations\ReactNativeRenderer-dev.js:93:4 in invokeGuardedCallbackProd
at node_modules\react-native\Libraries\Renderer\implementations\ReactNativeRenderer-dev.js:318:2 in invokeGuardedCallback
at node_modules\react-native\Libraries\Renderer\implementations\ReactNativeRenderer-dev.js:18952:29 in commitRootImpl
at node_modules\scheduler\cjs\scheduler.development.js:468:23 in unstable_runWithPriority
at node_modules\react-native\Libraries\Renderer\implementations\ReactNativeRenderer-dev.js:18791:17 in commitRoot
at node_modules\react-native\Libraries\Renderer\implementations\ReactNativeRenderer-dev.js:18192:12 in performSyncWorkOnRoot
at node_modules\react-native\Libraries\Renderer\implementations\ReactNativeRenderer-dev.js:5911:33 in runWithPriority$argument_1
at node_modules\scheduler\cjs\scheduler.development.js:468:23 in unstable_runWithPriority
at node_modules\react-native\Libraries\Renderer\implementations\ReactNativeRenderer-dev.js:5906:23 in flushSyncCallbackQueueImpl
at node_modules\react-native\Libraries\Renderer\implementations\ReactNativeRenderer-dev.js:5893:28 in flushSyncCallbackQueue
at node_modules\react-native\Libraries\Renderer\implementations\ReactNativeRenderer-dev.js:17745:30 in scheduleUpdateOnFiber
at node_modules\react-native\Libraries\Renderer\implementations\ReactNativeRenderer-dev.js:21484:23 in updateContainer
at node_modules\react-native\Libraries\Renderer\implementations\ReactNativeRenderer-dev.js:22144:17 in render
at node_modules\react-native\Libraries\ReactNative\renderApplication.js:58:4 in renderApplication
at node_modules\react-native\Libraries\ReactNative\AppRegistry.js:117:25 in runnables.appKey.run
at node_modules\react-native\Libraries\ReactNative\AppRegistry.js:202:4 in runApplication
at node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:414:4 in __callFunction
at node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:113:6 in __guard$argument_0
at node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:365:10 in __guard
at node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:112:4 in callFunctionReturnFlushedQueue
Here is my code that I tried to create a manager:
import { StatusBar } from 'expo-status-bar';
import React, { Component } from 'react';
import { StyleSheet, Text, View } from 'react-native';
import { BleManager } from 'react-native-ble-plx';
const HelloWorldApp = () => {
const manager = new BleManager();
I cannot solve where is my mistake. Please anyone can help me to solve this issue?
Note: I also installed ble-plx package using npm install --save react-native-ble-plx command.
Note2:I created my project using expo.

You might need to ask the user for permission before using Bluetooth. Add these to your android-manifest.xml :
<uses-feature android:name="android.hardware.bluetooth" android:required="true"/>
<uses-feature android:name="android.hardware.bluetooth_le" android:required="true"/>

You are getting this error because of the expo. Expo does not support the ble-manager ble-plx package. You need to create a native project via
npx react-native init AwesomeProject

Related

not able to Import SafeAreaProvider of react native

I am doing a watch along project development with the help of https://www.youtube.com/watch?v=bvn_HYpix6s&t=4191s
Around at 1:07:00, we are adding react native imports. we are referring https://reactnativeelements.com/docs.
I have added react-native-safe-area-context npm package.
and did an import as
import { SafeAreaProvider } from 'react-native-safe-area-context';
however doing so, I am getting an error as
Invariant Violation: Tried to register two views with the same name
RNCSafeAreaProvider at
node_modules\react-native\Libraries\LogBox\LogBox.js:148:8 in
registerError at
node_modules\react-native\Libraries\LogBox\LogBox.js:59:8 in errorImpl
at node_modules\react-native\Libraries\LogBox\LogBox.js:33:4 in
console.error at
node_modules\expo\build\environment\react-native-logs.fx.js:27:4 in
error at
node_modules\react-native\Libraries\Core\ExceptionsManager.js:104:6 in
reportException at
node_modules\react-native\Libraries\Core\ExceptionsManager.js:171:19
in handleException at
node_modules\react-native\Libraries\Core\setUpErrorHandling.js:24:6 in
handleError at
node_modules\expo-error-recovery\build\ErrorRecovery.fx.js:12:21 in
ErrorUtils.setGlobalHandler$argument_0 at
node_modules\regenerator-runtime\runtime.js:63:36 in tryCatch at
node_modules\regenerator-runtime\runtime.js:294:29 in invoke at
node_modules\regenerator-runtime\runtime.js:63:36 in tryCatch at
node_modules\regenerator-runtime\runtime.js:155:27 in invoke at
node_modules\regenerator-runtime\runtime.js:165:18 in
PromiseImpl.resolve.then$argument_0 at
node_modules\react-native\node_modules\promise\setimmediate\core.js:37:13
in tryCallOne at
node_modules\react-native\node_modules\promise\setimmediate\core.js:123:24 in setImmediate$argument_0 at
node_modules\react-native\Libraries\Core\Timers\JSTimers.js:130:14 in
_callTimer at node_modules\react-native\Libraries\Core\Timers\JSTimers.js:181:14 in
_callImmediatesPass
As per suggestion of few forums I have reinstalled the package but same error.
below is the code snippet I wanted to run.
import React from 'react';
import { StyleSheet, Text, View } from 'react-native';
import { Provider } from 'react-redux';
import HomeScreen from './screens/HomeScreen';
import {store} from './store'
import { SafeAreaProvider } from 'react-native-safe-area-context';
export default function App() {
return (
<Provider store={store}>
<SafeAreaProvider >
<HomeScreen/>
</SafeAreaProvider >
</Provider>
);
}
below is the screenshot of mobile emulator.
Regards,
Ashish
it seems react-native-safe-area-context is duplicated.
if you installed #react-native-community/masked-view, it will also install react-native-safe-area-context as a dependency.
If the 2 version is different, you would get such a issue.
Please uninstall react-native-safe-area-context.
Then it will work fine.
As said here, Add the following line on the scripts part, on your package.json:
"postinstall":"rm -rf node_modules/expo/node_modules/react-native-safe-area-context"
If, you're not using expo:
"postinstall":"rm -rf node_modules/react-native-safe-area-context"

React Native Material Dropdown not working on expo

I am using react native and expo 4.4.4 and
"react-native-material-dropdown": "^0.11.1",
This library was picked from this Npm link and Github Link
Just copy pasted the example usage code you have given...
Its showing below error :
TypeError: undefined is not an object (evaluating '_reactNative.Animated.Text.propTypes.style')
at node_modules/react-native/Libraries/Core/ExceptionsManager.js:104:6 in reportException
at node_modules/react-native/Libraries/Core/ExceptionsManager.js:171:19 in handleException
at node_modules/react-native/Libraries/Core/setUpErrorHandling.js:24:6 in handleError
at node_modules/expo-error-recovery/build/ErrorRecovery.fx.js:12:21 in ErrorUtils.setGlobalHandler$argument_0
at [native code]:null in flushedQueue
at [native code]:null in invokeCallbackAndReturnFlushedQueue
I don't think react-native-material-dropdown is supported in Expo.
Use #react-native-community/picker instead.

Jest and React Native Icons import problem

I'm new to react native and i ran into a test problem.
First of all my application runs correctly.
The problem only occurs when i want to test my app with jest AND when there is an icon inside my app.
The following message tells me that there is probably a lazy import loading that conflicts with jest in some ways but i don't know how to workaround or fix this :
ReferenceError: You are trying to 'import' a file after the Jest environment has been torn down.
I've tested my app without icon="camera" and the test runs well so it is very related to icons.
The app also uses react-native-paper.
How can i test my app even when there are icons inside it ?
Here is a minimal App.js that reproduce the bug :
import { StatusBar } from 'expo-status-bar';
import React from 'react';
import { StyleSheet, Text, View } from 'react-native';
import { Provider as PaperProvider } from 'react-native-paper';
import { Button } from 'react-native-paper';
export default function App() {
return (
<PaperProvider>
<View style={styles.container}>
<Text>Thi is a test</Text>
<Button icon="camera" mode="contained" onPress={() => console.log('Pressed')}>
Press me
</Button>
<StatusBar style="auto" />
</View>
</PaperProvider>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#fff',
alignItems: 'center',
justifyContent: 'center',
},
});
The jest test :
import React from 'react';
import renderer from 'react-test-renderer';
import App from './App';
jest.mock('react-native-vector-icons/FontAwesome', () => 'Icon');
describe('<App />', () => {
it('has 1 child', () => {
const tree = renderer.create(<App />).toJSON();
expect(tree.children.length).toBe(1);
});
});
The jest run log :
> # test C:\Users\slash\workspace\runpick
> jest
Expected react-native/jest-preset to define transform[^.+\.(bmp|gif|jpg|jpeg|mp4|png|psd|svg|webp)$]
react-native/jest-preset contained different transformIgnorePatterns than expected
ReferenceError: You are trying to `import` a file after the Jest environment has been torn down.
at Object.get Text [as Text] (node_modules/react-native/index.js:118:12)
at Icon.render (node_modules/#expo/vector-icons/build/vendor/react-native-vector-icons/lib/create-icon-set.js:120:58)
at finishClassComponent (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:7618:31)
at updateClassComponent (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:7568:24)
at beginWork (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:9043:16)
PASS ./App.test.js
<App />
√ has 1 child (465ms)
console.error
Warning: React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: object. You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.
Check the render method of `Icon`.
in Icon (created by Icon)
in Icon (at MaterialCommunityIcon.tsx:87)
in Icon (created by Context.Consumer)
in ThemedComponent (created by withTheme(Icon))
in withTheme(Icon) (at Button.tsx:286)
in View (created by View)
in View (at Button.tsx:285)
in View (created by View)
in View (at Button.tsx:283)
in View (created by View)
in View (created by TouchableHighlight)
in TouchableHighlight (created by ForwardRef)
in ForwardRef (at TouchableRipple/index.native.tsx:91)
in TouchableRipple (created by Context.Consumer)
in ThemedComponent (created by withTheme(TouchableRipple))
in withTheme(TouchableRipple) (at Button.tsx:267)
in View (created by View)
in View (created by AnimatedComponent)
in AnimatedComponent (created by ForwardRef(AnimatedComponentWrapper))
in ForwardRef(AnimatedComponentWrapper) (at Surface.tsx:70)
in Surface (created by Context.Consumer)
in ThemedComponent (created by withTheme(Surface))
in withTheme(Surface) (at Button.tsx:257)
in Button (created by Context.Consumer)
in ThemedComponent (created by withTheme(Button))
in withTheme(Button) (created by App)
in View (created by View)
in View (created by App)
in ThemeProvider (at Provider.tsx:21)
in View (created by View)
in View (at PortalHost.tsx:128)
in Portal.Host (at Provider.tsx:17)
in Provider (created by App)
in App
at warningWithoutStack (node_modules/react/cjs/react.development.js:167:32)
at warning (node_modules/react/cjs/react.development.js:638:27)
at Object.createElementWithValidation [as createElement] (node_modules/react/cjs/react.development.js:2035:5)
at Icon.render (node_modules/#expo/vector-icons/build/vendor/react-native-vector-icons/lib/create-icon-set.js:120:31)
at finishClassComponent (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:7618:31)
at updateClassComponent (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:7568:24)
at beginWork (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:9043:16)
console.error
The above error occurred in the <Icon> component:
in Icon (created by Icon)
in Icon (at MaterialCommunityIcon.tsx:87)
in Icon (created by Context.Consumer)
in ThemedComponent (created by withTheme(Icon))
in withTheme(Icon) (at Button.tsx:286)
in View (created by View)
in View (at Button.tsx:285)
in View (created by View)
in View (at Button.tsx:283)
in View (created by View)
in View (created by TouchableHighlight)
in TouchableHighlight (created by ForwardRef)
in ForwardRef (at TouchableRipple/index.native.tsx:91)
in TouchableRipple (created by Context.Consumer)
in ThemedComponent (created by withTheme(TouchableRipple))
in withTheme(TouchableRipple) (at Button.tsx:267)
in View (created by View)
in View (created by AnimatedComponent)
in AnimatedComponent (created by ForwardRef(AnimatedComponentWrapper))
in ForwardRef(AnimatedComponentWrapper) (at Surface.tsx:70)
in Surface (created by Context.Consumer)
in ThemedComponent (created by withTheme(Surface))
in withTheme(Surface) (at Button.tsx:257)
in Button (created by Context.Consumer)
in ThemedComponent (created by withTheme(Button))
in withTheme(Button) (created by App)
in View (created by View)
in View (created by App)
in ThemeProvider (at Provider.tsx:21)
in View (created by View)
in View (at PortalHost.tsx:128)
in Portal.Host (at Provider.tsx:17)
in Provider (created by App)
in App
Consider adding an error boundary to your tree to customize error handling behavior.
Visit https://reactjs.org/docs/error-boundaries.html to learn more about error boundaries.
at logCapturedError (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:10141:21)
at logError (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:10178:5)
at update.callback (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:11288:5)
at callCallback (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:3259:12)
at commitUpdateQueue (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:3280:9)
at commitLifeCycles (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:10497:11)
at commitLayoutEffects (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:13295:7)
Test Suites: 1 passed, 1 total
Tests: 1 passed, 1 total
Snapshots: 0 total
Time: 4.272s
Ran all test suites.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! # test: `jest`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the # test script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\slash\AppData\Roaming\npm-cache\_logs\2020-07-07T07_26_11_064Z-debug.log
The terminal process terminated with exit code: 1
Terminal will be reused by tasks, press any key to close it.
Create a jest setup file which contains the following or add this to your existing jest setup file:
jest.mock('react-native-paper');
Then make sure your setup file is being read by your jest config, either in the jest block of package.json or in your jest config file:
module.exports = {
preset: 'react-native',
setupFiles: ['./pathToJestSetupFile.js'],
...
}
Doing the above fixed the following error I was seeing that is similar to yours:
ReferenceError: You are trying to `import` a file after the Jest environment has been torn down.
at Object.get View [as View] (node_modules/react-native/index.js:150:12)
at PortalHost.render (node_modules/react-native-paper/lib/commonjs/components/Portal/PortalHost.js:221:43)
at finishClassComponent (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:7618:31)
at updateClassComponent (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:7568:24)
at beginWork (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:9043:16)
● Cannot log after tests are done. Did you forget to wait for something async in your test?
Attempted to log "Warning: React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: object. You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.
Check the render method of `Portal.Host`.
in Portal.Host (created by Provider)
in Provider (created by App)
in App".
at BufferedConsole.error (node_modules/jest-runner/node_modules/#jest/console/build/BufferedConsole.js:165:10)
at registerError (node_modules/react-native/Libraries/LogBox/LogBox.js:169:15)
at errorImpl (node_modules/react-native/Libraries/LogBox/LogBox.js:48:23)
at BufferedConsole.console.error (node_modules/react-native/Libraries/LogBox/LogBox.js:25:15)
at printWarning (node_modules/react/cjs/react.development.js:315:30)
at error (node_modules/react/cjs/react.development.js:287:5)
at Object.createElementWithValidation [as createElement] (node_modules/react/cjs/react.development.js:1788:7)
at PortalHost.render (node_modules/react-native-paper/lib/commonjs/components/Portal/PortalHost.js:221:16)
at finishClassComponent (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:7618:31)
at updateClassComponent (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:7568:24)
ReferenceError: You are trying to `import` a file after the Jest environment has been torn down.
at Object.get AccessibilityInfo [as AccessibilityInfo] (node_modules/react-native/index.js:9:12)
at Provider.componentWillUnmount (node_modules/react-native-paper/lib/commonjs/core/Provider.js:256:20)
at callComponentWillUnmountWithTimer (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:10194:12)
at Object.invokeGuardedCallbackImpl (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:9897:10)
at invokeGuardedCallback (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:10073:31)
● Cannot log after tests are done. Did you forget to wait for something async in your test?
Attempted to log "The above error occurred in the <Context.Provider> component:
in Portal.Host (created by Provider)
in Provider (created by App)
in App
Consider adding an error boundary to your tree to customize error handling behavior.
Visit to learn more about error boundaries.".
● Cannot log after tests are done. Did you forget to wait for something async in your test?
Attempted to log "Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: object. You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.
Check the render method of `Portal.Host`.

Error react-native-video : undefined is not an object (evaluating 'RCTVideoInstance.Constants')

I would like to use react-native-video in my app. However, what I've done doesn't work :
I created a new project using expo init Project1
Then I installed react-native-video : npm install --save react-native-video
I used then this : react-native link react-native-video
I only have for the moment App.js :
import React from 'react';
import { StyleSheet, Text, View } from 'react-native';
import Video from 'react-native-video';
export default function App() {
return (
<View style={styles.container}>
<Video source={{uri: './small.mp4'}} // Can be a URL or a local file.
ref={(ref) => {
this.player = ref
}} // Store reference
o.nBuffer={this.onBuffer} // Callback when remote video is buffering
onError={this.videoError} // Callback when video cannot be loaded
style={styles.backgroundVideo} />
</View>
);
}
Finally I use npm start
I have this error message :
undefined is not an object (evaluating 'RCTVideoInstance.Constants')
Stack trace:
node_modules/react-native-video/Video.js:265:11 in render
node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js:13042:21 in finishClassComponent
node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js:12970:4 in updateClassComponent
node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js:307:15 in invokeGuardedCallbackImpl
node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js:531:36 in invokeGuardedCallback
node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js:20488:8 in beginWork$$1
node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js:19370:24 in performUnitOfWork
node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js:19347:39 in workLoopSync
node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js:18997:22 in renderRoot
[native code]:null in renderRoot
node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js:18709:28 in runRootCallback
[native code]:null in runRootCallback
node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js:5642:32 in runWithPriority$argument_1
node_modules/scheduler/cjs/scheduler.development.js:643:23 in unstable_runWithPriority
node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js:5638:22 in flushSyncCallbackQueueImpl
node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js:5627:28 in flushSyncCallbackQueue
node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js:18556:30 in scheduleUpdateOnFiber
node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js:21822:15 in scheduleRootUpdate
node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js:23042:20 in ReactNativeRenderer.render
node_modules/react-native/Libraries/ReactNative/renderApplication.js:52:52 in renderApplication
node_modules/react-native/Libraries/ReactNative/AppRegistry.js:116:10 in runnables.appKey.run
node_modules/react-native/Libraries/ReactNative/AppRegistry.js:197:26 in runApplication
node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js:436:47 in __callFunction
node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js:111:26 in __guard$argument_0
node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js:384:10 in __guard
node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js:110:17 in __guard$argument_0
[native code]:null in callFunctionReturnFlushedQueue
...
I followed instructions from react-native-video : https://www.npmjs.com/package/react-native-video
Thanks a lot...
You have to eject your app from expo and use the bare workflow if you want to use "react-native-video".
Btw, you can use Expo Video instead of react-native-video : https://docs.expo.io/versions/latest/sdk/video/
You can add jcenter to android/build.gradle like this:
allprojects {
repositories {
.... # Keep the rest
jcenter() {
content {
includeModule("com.yqritc", "android-scalablevideoview")
}
}
}
}
This is worked for me hope it will also do your work

ReferenceError: Can't find variable: Text (i am using expo application for react native)

this error is showing in my ios screen after downloading java script in my device.
ReferenceError: Can't find variable: Text
This error is located at:
in App (at registerRootComponent.js:35)
in RootErrorBoundary (at registerRootComponent.js:34)
in ExpoRootComponent (at renderApplication.js:33)
in RCTView (at View.js:60)
in View (at AppContainer.js:102)
in RCTView (at View.js:60)
in View (at AppContainer.js:122)
in AppContainer (at renderApplication.js:32)
Import Text from react native.
import {
View,
Text,
} from 'react-native';
Importing react-native is not enough here.
Module not found: Can't resolve 'react-native'
Instead, you need an additional package:
yarn add react-native-web
Now you are able to use
import {Text} from 'react-native'