I have recently tried to intergrate the new Google Maps capacitor plugin:
My app is a Ionic Capacitor application (Angular) and runs on android and iOS
This is my implementation:
.html:
<ion-content [fullscreen]="true">
<div id="map" #map></div>
</ion-content>
.ts:
import {AfterViewInit, Component} from '@angular/core';
import {GoogleMap} from '@capacitor/google-maps';
@Component({
selector: 'app-testpage',
templateUrl: './testpage.page.html',
styleUrls: ['./testpage.page.scss'],
})
export class TestPage implements AfterViewInit {
constructor() {
}
ngAfterViewInit(): void {
}
public async showMap() {
const apiKey = "myapikey";
const mapElement = document.getElementById('map');
const mapConfig = {
center: {
lat: 33.6,
lng: -117.9,
},
zoom: 8,
androidLiteMode: false,
}
const mapOptions = {
id: "my-map",
apiKey: apiKey,
config: mapConfig,
element: mapElement,
}
const map = await GoogleMap.create(mapOptions)
}
}
in my android manifest file:
<meta-data android:name="com.google.android.geo.API_KEY" android:value="myapikey"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
However when I open the page I get the following errors in the console:
W/DynamiteModule: Local module descriptor class for com.google.android.gms.googlecertificates not found.
W/SnapshotHandler: Unable to retrieve flag snapshot for com.google.android.libraries.consentverifier#com.mypackagename, using defaults.
java.io.FileNotFoundException:/data/user/0/com.gmail.mypackagename/files/phenotype/shared/com.google.android.libraries.consentverifier#com.mypackagename.pb: open failed: ENOENT (No such file or directory)
W/MobStoreFlagStore: Unable to update local snapshot for com.google.android.libraries.consentverifier#com.mypackagename, may result in stale flags.
java.util.concurrent.ExecutionException: java.lang.SecurityException: GoogleCertificatesRslt: not allowed: pkg=com.mypackagename, sha256=[...], atk=false, ver=221514044.true (go/gsrlt)
I am wondering if anyone knows how to solve this?