i’ve built a simple application on the managed workflow SDK 41 and i’m getting an error that i think it’s from axios .
when i use expo build:android the standalone works fine and i get an alert “User exists” , but when i use eas build i get the “Network error” on an axios get request . the request error is always fired , as you can see on the images below .
expo build : android
eas build -p android --profile preview
App.js
import React, { useState, useEffect } from "react";
import {
Text,
View,
StyleSheet,
KeyboardAvoidingView,
Platform,
} from "react-native";
import {
widthPercentageToDP as wd,
heightPercentageToDP as hd,
} from "react-native-responsive-screen";
import { RFPercentage, RFValue } from "react-native-responsive-fontsize";
import axios from "axios";
import Colors from "./constants/Colors";
import ValidatePhone from "./helpers/validate-phone";
import LottieView from "lottie-react-native";
const SignIn = (props) => {
const checkIfChauffeurtExist = async () => {
// setStep("loading");
axios
.post("http://135.181.38.97:8080/api/checkdriveruserid/", {
username: 540142833,
})
.then(async function (response) {
if (response.data == true) {
alert("User exists");
} else {
alert("User exists pas ");
// setStep("initial");
}
})
.catch(function (error) {
alert(error);
//setStep("initial");
})
.then(function () {
// always executed
});
};
checkIfChauffeurtExist();
return (
<KeyboardAvoidingView
behavior={Platform.OS === "ios" ? "padding" : null}
style={{ flex: 1 }}
>
{/* Second Step*/}
<View style={styles.animationContainer}>
<LottieView
autoPlay={true}
style={{
width: 280,
height: 280,
backgroundColor: "#fff",
}}
source={require("./charging-teranga.json")}
/>
</View>
</KeyboardAvoidingView>
);
};
SignIn.navigationOptions = (navData) => {
return {
headerShown: false,
};
};
const styles = StyleSheet.create({
container: {
flex: 1,
},
container1: {
flexDirection: "column",
paddingHorizontal: 24,
paddingTop: 30,
justifyContent: "center",
alignItems: "center",
flex: 1,
backgroundColor: "white",
},
textInputContainer: {
flexDirection: "row",
borderRadius: 10,
backgroundColor: "white",
alignItems: "center",
paddingHorizontal: 15,
shadowColor: "#000",
shadowOffset: {
width: 0,
height: 2,
},
shadowOpacity: 0.25,
shadowRadius: 3.84,
elevation: 5,
marginBottom: 15,
},
motdepasse: {
marginTop: 10,
fontSize: RFValue(14),
},
textInput: {
fontSize: RFValue(19),
width: wd(70),
},
minitextInput: {
height: RFValue(45),
paddingLeft: 10,
fontSize: RFValue(15),
},
veuillez: {
fontSize: RFValue(16),
textAlign: "center",
width: "80%",
marginBottom: "7%",
color: Colors.dark,
},
sendSmsButton: {
shadowColor: "#000",
shadowOffset: {
width: 0,
height: 2,
},
shadowOpacity: 0.25,
shadowRadius: 3.84,
elevation: 5,
backgroundColor: Colors.primary,
width: "79%",
height: RFValue(45),
borderRadius: 10,
justifyContent: "center",
alignItems: "center",
marginVertical: 7,
},
welcome: {
fontSize: RFValue(25),
color: "grey",
},
animationContainer: {
backgroundColor: "#fff",
alignItems: "center",
justifyContent: "center",
flex: 1,
},
});
export default SignIn;
packages.json
{
"main": "node_modules/expo/AppEntry.js",
"scripts": {
"start": "expo start",
"android": "expo start --android",
"ios": "expo start --ios",
"web": "expo start --web",
"eject": "expo eject"
},
"dependencies": {
"axios": "^0.21.1",
"expo": "~41.0.1",
"expo-status-bar": "~1.0.4",
"lottie-react-native": "3.5.0",
"react": "16.13.1",
"react-dom": "16.13.1",
"react-native": "https://github.com/expo/react-native/archive/sdk-41.0.0.tar.gz",
"react-native-paper": "^4.9.1",
"react-native-responsive-fontsize": "^0.5.0",
"react-native-responsive-screen": "^1.4.2",
"react-native-svg": "12.1.0",
"react-native-web": "~0.13.12"
},
"devDependencies": {
"@babel/core": "^7.9.0"
},
"private": true
}
eas.json
{
"builds": {
"android": {
"release": {
"workflow": "managed",
"buildType": "apk"
},
"preview": {
"workflow": "managed",
"buildType": "apk"
}
}
}
}
Is there something that i’m missing ?? please help