我在反应本机 apk 时遇到问题。 如果我使用 expo go,我在地图中的代码就可以工作。我可以在地图中看到我当前的位置和其他功能。所以最近,我通过 expo 创建了一个 APK 应用程序,EAS 构建。 APK 工作正常,因为我可以更改用户的密码,但在 APK 中,特别是在地图屏幕中,地图不会显示。
这是我尝试过的:
{location && (
<MapView
// onMapReady={() => {
// orderInformation.forEach((customer) => {
// handleMarkerPress(customer);
// });
// }}
ref={mapRef}
provider={PROVIDER_GOOGLE}
mapType="hybrid"
style={styles.map}
initialRegion={{
latitude: location.coords.latitude,
longitude: location.coords.longitude,
latitudeDelta: 0.01,
longitudeDelta: 0.01,
}}
"android": {
"adaptiveIcon": {
"foregroundImage": "./assets/adaptive-icon.png",
"backgroundColor": "#FFFFFF"
},
"config":{
"googleMaps": {
"apiKey": "mykey"
}
},
"permissions": [
"ACCESS_FINE_LOCATION",
"ACCESS_COARSE_LOCATION",
"ACCESS_BACKGROUND_LOCATION",
"CAMERA_ROLL",
"READ_EXTERNAL_STORAGE",
"WRITE_EXTERNAL_STORAGE"
],
"package": "com.xxxxxxxx.com"
},
我什至编辑我的 API 密钥以添加来自 Expo 凭证的 SHA-1 证书指纹。 谢谢你。
你找到解决方案了吗,因为我也遇到了同样的问题?