the error above is shown in this import
import React from 'react';
import {
View,
Text,
TouchableOpacity,
Dimensions,
StyleSheet,
StatusBar,
Image
} from 'react-native';
import * as Animatable from 'react-native-animatable';
import LinearGradient from 'react-native-linear-gradient';
import MaterialIcons from 'react-native-vector-icons/MaterialIcons';
import { useTheme } from '#react-navigation/native';
this is the import statement bringing the error
Try:
For iOS
cd ios
pod install
rebuild project
For Android:
Uninstall application in Android emulator
cd Android
./gradlew clean && ./gradlew cleanBuildCache
npm run android
It worked but first, I need to upgrade my Java version.
Thanks.
Related
My app gets closed as soon as I click on my speedtest screen.This is my code. It runs well in debugging mode. But the screen does not open in the release version(apk). These are the packages I am using for this component.
import React, {useState, useEffect} from 'react';
import {
Text,
Image,
View,
ScrollView,
TouchableOpacity,
SafeAreaView,
StatusBar,
ImageBackground,
Dimensions,
Modal,
TouchableWithoutFeedback,
} from 'react-native';
import RNFetchBlob from 'rn-fetch-blob';
import {NetworkInfo} from 'react-native-network-info';
import Ping from 'react-native-ping';
import Icon from 'react-native-vector-icons/Ionicons';
import RNSpeedometer from 'react-native-speedometer';
import {measureConnectionSpeed} from 'react-native-network-bandwith-speed';
import Speedometer from 'react-native-cool-speedometer';
import {AppFont, Color} from '../components/Constatnts';
import {PermissionsAndroid} from 'react-native';
import WifiManager from 'react-native-wifi-reborn';
import {AUTH, LOGIN_URL} from '../components/APIs';
import axios from 'react-native-axios';
import {Detail} from '../components/Token';
import {UserId, Token} from '../components/Token';
import LinearGradient from 'react-native-linear-gradient';
import StyleSheet from 'react-native-media-query';
import AsyncStorage from '#react-native-async-storage/async-storage';
i guess maybe module import from 'react-native-gesture-handler',
ex: import FlatList from 'react-native-gesture-handler'. it work on debug but die with release in some case. or try import 'react-native-gesture-handler' in App.js or index.js .
For the most accurate, you need to open android studio, select build variant chosse release, select error log and filter with pakage name
here by the following code
import React from 'react';
import {
SafeAreaView,
StyleSheet,
ScrollView,
View,
Text,
StatusBar,
} from 'react-native';
import {createIconSetFromFontello} from 'react-native-vector-icons';
import fontelloConfig from './selection.json';
const Icon =createIconSetFromFontello(fontelloConfig);
export default() => <Icon name="icon-1801287" size={80} color="#bf1313"/>
please how to correct the issues
i add the ttf file to the android assests file i got the same error
selection.json is for icomoon but config.json is for Fontello, so you have to use createIconSetFromIcoMoon(require(./selection.json)) instead of createIconSetFromFontello(require(./selection.json))
I am getting the error in metro bundler as mentioned in Title but I am not using Async anywhere or I did not import Async from anywhere (not even from react native core).
Below are my imports
import React, {Component} from 'react';
import {StyleSheet} from 'react-native';
import {Provider} from 'react-redux';
import {createStore} from 'redux';
import firebase from 'firebase';
import FontAwesome from 'react-native-vector-icons/FontAwesome';
import Feather from 'react-native-vector-icons/Feather';
import * as Animatable from 'react-native-animatable';
Screen Shot of error
I have checked this issue already but as I have not used the Async directly in my code so this does not completely solves the error
I want to learn react native. I want to build a web app and an android app. I want to be to navigate between screens of my app. So I did this:
npx create-react-app my-app
cd my-app
npm install react-native-web
I then updated my index.js to look like this:
import React from 'react';
import App from './App';
import { AppRegistry } from 'react-native';
AppRegistry.registerComponent('App', () => App);
AppRegistry.runApplication('App', { rootTag: document.getElementById('root') });
And I updated my App.js to look like this:
import React from 'react';
import {createAppContainer} from 'react-navigation';
import {createStackNavigator} from 'react-navigation-stack';
const MainNavigator = createStackNavigator({Home: {screen: function(props){return null}}});
const App = createAppContainer(MainNavigator);
export default App;
When I run the npm start command, I get the error
./node_modules/react-navigation-stack/lib/module/views/Header/Header.js
Attempted import error: 'MaskedViewIOS' is not exported from 'react-native'.
Does anyone know how to correct this problem?
Looks like this is an issue in react-navigation-stack v1 with the latest version of react-native-web but I don't think will be fixed.
The issue is MaskedViewIOS has been moved to react-native-community issue #132:
https://github.com/react-native-community/react-native-masked-view
Update to react-navigation-stack v2
I am unable to import and successfully use ActivityIndcator without getting the following screen.
I am not doing anything special and my code looks like the following
import { View, Text, ActivityIndicator } from 'react-native';
...
...
render(){
return (
<ActivityIndicator animating={true} />
)
}
If I change this to ActivityIndicatorIOS it works perfectly fine.
My React Native and React Native CLI versions are the following
react-native-cli: 0.2.0
react-native: 0.27.2
Full Stack Trace Is
import { ActivityIndicator, StyleSheet, View } from 'react-native';
You should update to 0.28.0 or later since cross platform ActivityIndicator was added in React Native 0.28.0:
Add cross platform ActivityIndicator (26e8426) - #janicduplessis