简体   繁体   English

Expo React Native 应用程序在 Android 上崩溃,但在 Expo 上运行 Go

[英]Expo React Native app crashes on Android but works in Expo Go

When I'm previewing my app in the Expo Go application everything works just fine, but when I build the android APK everything works great until I try to load the screen which contains the MapView.当我在 Expo Go 应用程序中预览我的应用程序时,一切正常,但是当我构建 android APK 时,一切正常,直到我尝试加载包含 MapView 的屏幕。 When I go to that page the app crashes without telling me what's wrong当我 go 到该页面时,应用程序崩溃而没有告诉我出了什么问题

This is the MapView:这是地图视图:

<MapView
    ref={map}
    style={styles.map}
    provider={PROVIDER_GOOGLE}
    initialRegion={location}
    pitchEnabled={false}
    userLocationUpdateInterval={3000}
    userLocationPriority="balanced"
    toolbarEnabled={false}
    tintColor="#00B4B4"
    customMapStyle={customMapStyle}
/>

btw, I have no Idea how to see the crash log if there is any log(I'd love to know how to see it)顺便说一句,如果有任何日志,我不知道如何查看崩溃日志(我很想知道如何查看)

You need to add Google Maps Api key.您需要添加谷歌地图 Api 密钥。 In expo go, expo has their own Google Maps Api key, but when you build your own apk you need to add your own.Check this from expo docs: https://docs.expo.dev/versions/latest/sdk/map-view/#deploying-google-maps-to-an-android-standalone在expo go,expo有自己的Google Map Api关键时-view/#deploying-google-maps-to-an-android-standalone

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Expo react-native app with firebase phone authentication works on web, error on ios simulator and crashes with no warning on Android - Expo react-native app with firebase phone authentication works on web, error on ios simulator and crashes with no warning on Android React-native Expo App 崩溃且没有错误 - React-native Expo App crashes with no errors Expo go 立即崩溃而没有错误消息(React Native) - Expo go instantly crashes without error message (React Native) Expo react-native 应用程序在手机上调试时工作,但发布的 apk 在启动时崩溃 - Expo react-native app works when debugging on phone but released apk crashes on start Expo React Native App 在 android 上崩溃 - Expo React Native App crashing on android Expo Go 在 Android 上测试应用程序时应用程序崩溃 - Expo Go App just crashes when testing app on Android 如何使用 expo 更新 React 本机 android 应用程序 - How to update React native android app with expo 带有 React Navigation 5 的 Expo React Native 应用程序在从 Navigator 触摸初始屏幕时在 Android 上崩溃 - Expo React Native app with React Navigation 5, crashes on Android when touching initial screen from Navigator 应用程序仅在真实设备上崩溃 | 反应原生 | Expo - App crashes only on real device | React native | Expo React Native Expo Android 仅在生产中崩溃,并且在 Sentry 中也无法捕获 - React Native Expo Android crashes only in production and is also not catchable in Sentry
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM