ionic-team / capacitor-plugins

Official plugins for Capacitor ⚡️
526 stars 588 forks source link

google-maps: plugin can not create map under IOS version > 17.2 #2110

Open ngmiduc opened 5 months ago

ngmiduc commented 5 months ago

Bug Report

Plugin(s)

"@capacitor/google-maps": "^5.4.1"

Capacitor Version

Latest Dependencies:

  @capacitor/cli: 6.0.0
  @capacitor/core: 6.0.0
  @capacitor/android: 6.0.0
  @capacitor/ios: 6.0.0

Installed Dependencies:

  @capacitor/cli: 5.0.4
  @capacitor/android: 5.0.4
  @capacitor/core: 5.7.0
  @capacitor/ios: 5.0.4

Platform(s)

IOS

Current Behavior

When the app is freshly installed on IOS 17.5, than the app crashes when the google map plugins create the map. After that the app can be sometimes opened again, after the app crashed. To reproduce this, delete the app again and install it again with xcode.

Expected Behavior

App should not crash after the app is lunched for the first time.

Code Reproduction

https://stackblitz.com/edit/angular-yz24zb-dbfvbk?file=src%2Fapp%2Fexample.component.ts

  1. add API KEY to component const apiKey = 'xxx';
  2. build an app to IOS
  3. run on the emulator in IOS = 17.5
  4. start up

Code Reproduction (alternative)

code.zip

  1. npm install && capacitor add ios
  2. add API KEY to component src/app/explore-container/explore-container.component.ts: const apiKey = 'xxx';
  3. build an app to IOS
  4. run on the emulator in IOS = 17.5
  5. start up

Other Technical Details

Reproduction code can be downloaded from stackblitz. I run the emulator on M3 Mac chip and I have installed the google map utils IOS We have received crash reports from ours users with IOS > 17.2. I also have tried to use capacitor 6 with the version 6 plugin but the results are the same inside the ios emulators.

Screenshot:

Screenshot 2024-05-22 at 13 37 43 Screenshot 2024-05-22 at 13 38 32
focafull commented 5 months ago

I think we've got the same problem, but could never really reproduce it in production.

ngmiduc commented 5 months ago

I think we've got the same problem, but could never really reproduce it in production.

Yeah, we have the same issue maybe. It's not easy to reproduce. We have some users that experiences app crashes. I am not sure if it is related to this issue but it is the only thing that we found out during debugging.

ngmiduc commented 5 months ago

Ah, I think we found something. There is exactly the issue on the ios-maps-sdk by google. https://github.com/googlemaps/ios-maps-sdk/issues/20

The solution might be to downgrade xcode to an older version. I will test that.

ngmiduc commented 5 months ago

Ok. Downgrading xcode to 15.2 didn't resolve the issue. My emulator is still crashing.

I tried to install the new version of the GoogleMaps pod 8.4.0. This required setting up the min deployment target to IOS 14 and I needed to build Google-Maps-iOS-Utils with rosetta on M1, since Google-Maps-iOS-Utils latest version doesn't work with the latest google maps version. I left it with an older version.

After that, I could run again on an IOS 17.5 device in the simulator-rosetta.

ngmiduc commented 5 months ago

Ok. After some more debugging, I found out that if I build the app with Rosetta, than it app works again after a fresh installation. (With the normal GoogleMaps pod 7.3, which is used by the current CapacitorGoogleMaps plugin) I am now not sure anymore what the issue is.... - would need some help from here on now...