Closed mercurjl closed 4 years ago
Thanks for submitting your issue. Can you take another look at your description and make sure the issue template has been filled in its entirety?
👉 Click here if you want to take another look at the Bug Report issue template.
I've also pulled down the tar.gz and ran the build on an emulator and it also instantly crashes if that helps with identifying the issue. I've updated app.js to create a log in my firebase firestore and it doesn't even get that far. Here's the new app.js:
import { AppLoading } from 'expo';
import * as Font from 'expo-font';
import React, { useState } from 'react';
import { Platform, StatusBar, StyleSheet, View } from 'react-native';
import { Ionicons } from '@expo/vector-icons';
import { AppearanceProvider } from 'react-native-appearance';
import { Provider } from 'react-redux'
import configureStore from './redux/store'
import AppNavigator from './navigation/AppNavigator';
import NavigationService from './navigation/NavigationService'
import * as firebase from 'firebase'
let firebaseConfig = {
apiKey: "~~~~~~~~~~~",
authDomain: "~~~~~~~~~~~",
databaseURL: "~~~~~~~~~~~",
projectId: "~~~~~~~~~~~",
storageBucket: "~~~~~~~~~~~",
messagingSenderId: "~~~~~~~~~~~",
appId: "~~~~~~~~~~~",
measurementId: ""~~~~~~~~~~~"
}
firebase.initializeApp(firebaseConfig)
// app.functions().useFunctionsEmulator('http://localhost:5000');
export default function App(props) {
const [isLoadingComplete, setLoadingComplete] = useState(false);
if (!isLoadingComplete && !props.skipLoadingScreen) {
return (
<AppLoading
startAsync={loadResourcesAsync}
onError={handleLoadingError}
onFinish={() => handleFinishLoading(setLoadingComplete)}
/>
);
} else {
return (
<Provider store={configureStore()}>
<AppearanceProvider>
<View style={styles.container}>
{Platform.OS === 'ios' && <StatusBar barStyle="default" />}
<AppNavigator ref={navigatorRef => {NavigationService.setTopLevelNavigator(navigatorRef)}}/>
</View>
</AppearanceProvider>
</Provider>
);
}
}
async function loadResourcesAsync() {
await Promise.all([
Font.loadAsync({
// This is the font that we are using for our tab bar
...Ionicons.font,
// We include SpaceMono because we use it in HomeScreen.js. Feel free to
// remove this if you are not using it in your app
'space-mono': require('./assets/fonts/SpaceMono-Regular.ttf'),
}),
]);
}
function handleLoadingError(error) {
// In this case, you might want to report the error to your error reporting
// service, for example Sentry
firebase.firestore().collection('errorLog').add(JSON.stringify(error))
}
function handleFinishLoading(setLoadingComplete) {
console.log("loading complete...")
firebase.firestore().collection('logs').add({ status: "finished"})
setLoadingComplete(true);
}
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#fff',
},
});
I figured out my issue, it was due to botched environment variable setup. I wasnt able to identify what the error was until I ran the project with the following arguments: expo start --no-dev --minify
This is what my environment.js looked like:
import Constants from "expo-constants";
const { manifest } = Constants;
const ENV = {
dev: {
apiUrl: localhost,
},
staging: {
apiUrl: "https://test-url.net"
},
prod: {
apiUrl: "https://prod-url.net"
}
};
const getEnvVars = (env = Constants.manifest.releaseChannel) => {
// What is __DEV__ ?
// This variable is set to true when react-native is running in Dev mode.
// __DEV__ is true when run locally, but false when published.
if (__DEV__) {
return ENV.dev;
} else if (env === 'staging') {
return ENV.staging;
} else if (env === 'prod') {
return ENV.prod;
}
};
export default getEnvVars;
I'm not entirely sure what I messed up in its implementation but that was the cause. After removing it completely and hardcoding URLs the build worked with an expo build:ios -t simulator
build and running on a simulator. It is worth noting that doing what expo docs say to run the tar.gz build does not work in Catalina currently.
Here is my package.json:
Here is my app.json:
Description of the project:
This project uses firebase for the the auth, services, and data storage. The first page after the splash is a simple login. This project also uses Redux and Redux thunk to manage a global state. The main view after the login screen is a react-native MapView, and I'm providing an iOS googleMapsApiKey to the iOS config so it uses google maps instead. This project prompts for location permission when the component with the MapView is rendered, and asks for Notification permission in the Register component.
Description of the problem:
The app works completely fine when using
expo start
and running the app via LAN or tunnel, on either a simulated iPhone or an actual iPhone. The project also builds fine and I'm able to retrieve an .ipa file from Expo. I used Transporter to upload the build to the appstoreconnect. When the project is actually downloaded on a device it crashes immediately upon clicking the icon. The splash shows for about a second then it prompts that the app has crashed.iOS Crash Report Data:
feedback.json:
crashlog.crash
If there is a better way to collect crash data that's more readable please let me know! Thanks for your time!
React Native version: "react-native": "https://github.com/expo/react-native/archive/sdk-35.0.0.tar.gz"
Steps To Reproduce
expo build:ios
Describe what you expected to happen: I expect the app to run like it does when using
expo start
.Snack, code example, screenshot, or link to a repository: app.js: