简体   繁体   English

Play 商店中的 Cordova-plugin-googlemaps 空白屏幕

[英]Cordova-plugin-googlemaps blank screen on Play store

My Ionic app is using the cordova-plugin-googlemaps 1.3.9 plugin, and everything had been working on iOS and Android until yesterday.我的 Ionic 应用程序使用的是cordova-plugin-googlemaps 1.3.9插件,直到昨天,一切都在 iOS 和 Android 上运行。

Cordova android : 5.1.1科尔多瓦安卓:5.1.1

Cordova iOS : 4.1.1科尔多瓦 iOS :4.1.1

Cordova CLI : 6.2.0科尔多瓦 CLI :6.2.0

Ionic Framework Version : 1.2.1-nightly-1867离子框架版本:1.2.1-nightly-1867

Ionic CLI Version : 2.0.0离子 CLI 版本:2.0.0

Yesterday, I pushed a new version on the stores and now I've got a blank screen instead of the Google map.昨天,我在商店里推送了一个新版本,现在我看到的是一个空白屏幕而不是谷歌地图。 The map works on debug mode on my Android phone but not in production mode, I mean from the Play store.该地图适用于我的 Android 手机上的调试模式,但不适用于生产模式,我的意思是来自 Play 商店。

Further to several researches, I have deduced that the problem came from Google Maps Android API v2 key.经过几项研究,我推断问题来自 Google Maps Android API v2 密钥。 Thus, I have generated a new key and reinstalled the cordova plugin with the same command but with the new key :因此,我生成了一个新密钥并使用相同的命令重新安装了cordova插件,但使用了新密钥:

ionic plugin add cordova-plugin-googlemaps --variable API_KEY_FOR_ANDROID="MY_NEW_API_KEY" --variable API_KEY_FOR_IOS="myIosKey"

After that, the map was not working even on debug mode… Therefore, I added the fingerprint of the debug.keystore in the Google Developer console.在那之后,即使在调试模式下地图也无法工作......因此,我在谷歌开发者控制台中添加了debug.keystore的指纹。 After this the map started to work again on debug mode在此之后,地图开始在调试模式下再次工作

I did the same operation for the production version, using the fingerprint of the release keystore , used to build the production APK.我对生产版本做了同样的操作,使用发布密钥库的指纹,用于构建生产APK。

Despite this, I still have a blank screen instead of the map, when I download the app from the Play store.尽管如此,当我从 Play 商店下载应用程序时,我仍然有一个空白屏幕而不是地图。

I found the solution.我找到了解决方案。

To build my production APK I use Ionic CLI .为了构建我的生产 APK,我使用Ionic CLI

I don't know why but the command did not add the cordova-plugin-googlemaps plugin to the signed APK.我不知道为什么,但该命令没有将 cordova-plugin-googlemaps 插件添加到已签名的 APK 中。 To solve that, I installed the plugin with the --save option :为了解决这个问题,我使用--save选项安装了插件:

cordova plugin add https://github.com/mapsplugin/cordova-plugin-googlemaps --variable API_KEY_FOR_ANDROID="MY_ANDROID_KEY" --variable API_KEY_FOR_IOS="MY_IOS_KEY" --save科尔多瓦插件添加https://github.com/mapsplugin/cordova-plugin-googlemaps --variable API_KEY_FOR_ANDROID="MY_ANDROID_KEY" --variable API_KEY_FOR_IOS="MY_IOS_KEY" --save

暂无
暂无

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

相关问题 为什么我使用cordova-plugin-googlemaps得到了空白地图 - Why have I got a blank map using cordova-plugin-googlemaps 离子插件添加cordova-plugin-googlemaps后构建失败 - BUILD FAILED after ionic plugin add cordova-plugin-googlemaps 使用Cordova插件通过WayPoints从源到目的地的路线添加了cordova-plugin-googlemaps - Directions from Source to Destinations via WayPoints using cordova plugin add cordova-plugin-googlemaps 地图拖动事件谷歌地图android sdk cordova cordova-plugin-googlemaps - map drag event google maps android sdk cordova cordova-plugin-googlemaps cordova-plugin-googlemaps如何从标记数组触发标记的info_window - cordova-plugin-googlemaps how to trigger the info_window of marker from marker array phonegap-googlemaps-plugin显示黑屏 - phonegap-googlemaps-plugin shows blank screen Gradle“ com.android.dex.DexException”构建了一个涉及cordova-plugin-googlemaps和ibm-mfp-push插件的应用程序。 - Gradle “com.android.dex.DexException” building an app involving cordova-plugin-googlemaps and ibm-mfp-push plugins. 当我尝试使用以下科尔多瓦google maps插件https://github.com/mapsplugin/cordova-plugin-googlemaps时出现错误 - I am getting an error when I tried to use the following cordova google maps plugin https://github.com/mapsplugin/cordova-plugin-googlemaps 重复点击Cordova Googlemaps插件 - Repeated clicks on Cordova Googlemaps plugin 科尔多瓦(Android)。 AppRate插件只会弹出空白屏幕 - Cordova (Android). AppRate plugin simply brings up blank screen
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM