Hello,
I’m getting this error that crashes Expo Go only for Android not iOS. Can someone help?
I tried changing all fontSize properties to different datatypes, but no avail.
First file
import {StylesSheet, Text, View, TextInput, Image,
TouchableHighlight, AsyncStorage, Keyboard, SafeAreaView} from 'react-native';
// import {Actions} from 'react-native-router-flux';
import styles from './prayerwarriorstyles.js'
import Form from './Form'
import {sendGridEmail} from 'react-native-sendgrid'
import VerseStuff from './Verse'
// "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";
// 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
// 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 // the old paula one
const SENDGRIDAPIKEY = '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';
const FROMEMAIL = "magnifyrequest03@gmail.com";
const TOEMAIL = "abigaylerose03@gmail.com"; // paula.rovik@gatewayfellowship.com
// josiah.perrson
export default class PrayerWarrior extends Component {
constructor(props) {
super(props)
this.state = {
subject: '',
name: '',
message: ''
}
// this.handleSubmit = this.handleSubmit.bind(this);
// this.sendFeedback = this.sendFeedback.bind(this);
}
// works like the handleSubmit(e)
sendPrayerRequest = () => {
const Subject = this.state.subject;
const ContactDetails = "Hi, this is " + this.state.name + ". " + " " + this.state.message;
const sendRequest = sendGridEmail(SENDGRIDAPIKEY, TOEMAIL, FROMEMAIL, Subject, ContactDetails)
sendRequest.then((response) => {
console.log("Success");
setTimeout(function() {
alert("Your prayer and request for support has been received. We are here for you. You are never alone.")
}, 7000);
}).catch((error) =>{
console.log(error);
});
}
render() {
return (
<SafeAreaView style={styles.container}>
<Text style={styles.text}>You are never alone. Our team will be sending you good vibes, prayers, or support if you feel comfortable. Name is not required. Press the button to get started! </Text>
<TextInput style={styles.subjectBox}
onChangeText={(value) => this.setState({subject: value})}
placeholder="Subject"
placeholderTextColor = "#002f6c"
selectionColor="fff" />
<TextInput style={styles.subjectBox}
onChangeText={(value) => this.setState({name: value})}
placeholder="Name"
placeholderTextColor = "#002f6c"
selectionColor="fff" />
<TextInput style={styles.messageBox}
onChangeText={(value) => this.setState({message: value})}
placeholder="Message"
placeholderTextColor = "#002f6c"
selectionColor="fff"
multiline={true}
/>
<TouchableHighlight style={styles.button} onPress={this.sendPrayerRequest.bind(this)}>
<View>
<Text style={styles.buttonText}>Send</Text>
</View>
</TouchableHighlight>
</SafeAreaView>
);
}
}
Second File
import {StyleSheet} from 'react-native';
import {
heightPercentageToDP as hp,
widthPercentageToDP as wp,
} from 'react-native-responsive-screen'
const styles = StyleSheet.create({
container: {
justifyContent: 'center',
alignItems: 'center',
},
text: {
marginTop: 10,
color: "grey",
fontFamily: "AppleSDGothicNeo-Light",
fontSize: wp("5%"),
},
subjectBox: {
width: wp('80%'), // 300
height: hp('4%'), /// 40
backgroundColor: '#f2f2f2',
borderRadius: 25,
paddingHorizontal: 16,
fontSize: wp("3.5%"),
color: '#002f6c',
marginVertical: 20,
fontFamily: 'Avenir-Medium',
},
messageBox: {
width: wp("80%"),
height: hp("30%"),
backgroundColor: '#f2f2f2',
borderRadius: 25,
paddingHorizontal: 16,
fontSize: 16,
color: '#002f6c',
marginVertical: 20,
fontFamily: 'Avenir-Medium',
},
button: {
width: wp("80%"),
backgroundColor: '#33cccc',
borderRadius: 25,
marginVertical: 10,
paddingVertical: 12,
},
buttonText: {
fontSize: wp("4.5%"),
fontWeight: '500',
color: '#ffffff',
textAlign: 'center',
fontFamily: 'Avenir-Light',
}
});
export default styles;
The error says “Error while updating property ‘fontSize’ in shadow node of type: RCTText. Cannot cast java.lang.String to java.lang.double”
Thanks