[英]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.