gpt4 book ai didi

ios - Ionic 4 谷歌地图插件 "failed to load optimized model at path..."

转载 作者:行者123 更新时间:2023-11-29 05:47:11 28 4
gpt4 key购买 nike

插件在浏览器中运行,但在 ios 上运行

CoreData: annotation:  Failed to load optimized model at path '/Users/[User]/Library/Developer/CoreSimulator/Devices/FABE7039-7D5D-4AAB-B4D8-3D688FCEE930/data/Containers/Bundle/Application/7DA1B2E1-0DE6-4A89-8604-0EC160298BD8/[APP-NAME].app/GoogleMaps.bundle/GMSCacheStorage.momd/StorageWithTileProto.omo'
CoreData: annotation: Failed to load optimized model at path '/Users/[User]/Library/Developer/CoreSimulator/Devices/FABE7039-7D5D-4AAB-B4D8-3D688FCEE930/data/Containers/Bundle/Application/7DA1B2E1-0DE6-4A89-8604-0EC160298BD8/[APP-NAME].app/GoogleMaps.bundle/GMSCacheStorage.momd/StorageWithTileProto.omo'
CoreData: annotation: Failed to load optimized model at path '/Users/[User]/Library/Developer/CoreSimulator/Devices/FABE7039-7D5D-4AAB-B4D8-3D688FCEE930/data/Containers/Bundle/Application/7DA1B2E1-0DE6-4A89-8604-0EC160298BD8/[APP-NAME].app/GoogleMaps.bundle/GMSCacheStorage.momd/StorageWithTileProto.omo'

我尝试过:

  1. 在 config.xml、package.json 中包含 API key ,通过 app.component 在环境中设置

  2. 尝试删除 StorageWithTileProto.omo

  3. 更新了谷歌地图插件版本

在app.component.ts中

import { Environment } from '@ionic-native/google-maps/ngx';

...

initializeApp() {
this.platform.ready().then(() => {
Environment.setEnv({
'API_KEY_FOR_BROWSER_DEBUG': "[API_KEY]",
'API_KEY_FOR_BROWSER_RELEASE': "[API_KEY]",
"API_KEY_FOR_IOS": "[API_KEY]",
"API_KEY_FOR_ANDROID": "[API_KEY]",
});
this.statusBar.styleDefault();
this.splashScreen.hide();
this.authService.getToken();
this.getUserData()
});
}

在config.xml中

...
<preference name="GOOGLE_MAPS_ANDROID_API_KEY" value="[API_KEY]" />
<preference name="GOOGLE_MAPS_IOS_API_KEY" value="[API_KEY]" />

...

<plugin name="cordova-plugin-googlemaps" spec="https://github.com/mapsplugin/cordova-plugin-googlemaps#multiple_maps">
<variable name="PLAY_SERVICES_VERSION" value="15.0.1" />
<variable name="ANDROID_SUPPORT_V4_VERSION" value="27.+" />
</plugin>

在map.component.ts中

import {
GoogleMaps,
GoogleMap,
GoogleMapsEvent,
GoogleMapOptions,
CameraPosition,
MarkerOptions,
Marker,
Environment
} from '@ionic-native/google-maps/ngx';

...

constructor(
public locationService: LocationService,
private platform: Platform,
private geolocation: Geolocation,
) { }

async ngOnInit() {
await this.platform.ready();
await this.getUserLocation();
await this.loadMap();
}

loadMap() {
this.map = GoogleMaps.create('map_canvas', {
camera: {
target: {
lat: 43.0741704,
lng: -89.3809802
},
zoom: 18,
tilt: 30
}
});
}

预期:iOS 设备上显示 map

实际:没有渲染 map ,甚至没有空白 map

最佳答案

结果 map 正在渲染,但位于页面背景后面。将背景设置为透明,已解决问题。出现的错误是不相关且不会破坏的

关于ios - Ionic 4 谷歌地图插件 "failed to load optimized model at path...",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56026584/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com