Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash on iOS calling GMSMapView.mapWithFrameCamera #3

Closed
dlcole opened this issue Jan 16, 2022 · 5 comments
Closed

Crash on iOS calling GMSMapView.mapWithFrameCamera #3

dlcole opened this issue Jan 16, 2022 · 5 comments

Comments

@dlcole
Copy link

dlcole commented Jan 16, 2022

This is a continuation of issue 2. While I was able to create an empty map using this plugin, when I added the otherwise empty map page into the app I'm migrating I was still getting a crash when navigating to that page. After many hours of debugging, I have isolated the crash to line 363 in index.ios.ts:

this.nativeView = GMSMapView.mapWithFrameCamera(CGRectZero, this._createCameraPosition());

The camera position is being created correctly. No error is thrown; the app just crashes with out any messages of any kind. It fails on both the current iOS runtime and JSC. The map page is loaded successfully on Android.

As a reference, here's the map-page.xml file in its entirety:

<Page xmlns="http://schemas.nativescript.org/tns.xsd"
  xmlns:lm="@kefah/nativescript-google-maps" 
  navigatingTo="onNavigatingTo" class="page">
  <Page.actionBar>
    <ActionBar title="Map Tester" class="action-bar">
      <NavigationButton text="Back" android.systemIcon="ic_menu_back" tap="onBackTap"/>
    </ActionBar>
  </Page.actionBar>
  <GridLayout >
    <lm:GoogleMaps latitude="35.913623" longitude="-79.055524" zoom="10" mapReady="onMapReady" />
  </GridLayout>
</Page>

And my current package.json:

{
  "name": "myapp",
  "main": "app/app.js",
  "version": "6.0.0",
  "private": true,
  "dependencies": {
    "@bradmartin/nativescript-urlhandler": "^2.0.1",
    "@kefah/nativescript-google-maps": "^1.0.3",
    "@nativescript/appversion": "^2.0.0",
    "@nativescript/core": "~8.1.1",
    "@nativescript/email": "^2.0.5",
    "@nativescript/firebase": "^11.1.3",
    "@nativescript/geolocation": "^8.0.2",
    "@nativescript/iqkeyboardmanager": "^2.0.0",
    "@nativescript/theme": "~3.0.1",
    "@triniwiz/nativescript-toasty": "^4.1.3",
    "base-64": "^1.0.0",
    "nativescript-bitmap-factory": "^1.8.1",
    "nativescript-contacts": "^1.6.4",
    "nativescript-danem-google-maps-utils": "^1.0.18",
    "nativescript-drop-down": "^6.0.0",
    "nativescript-permissions": "^1.3.12",
    "nativescript-phone": "^3.0.2",
    "nativescript-screenshot": "^0.0.2",
    "nativescript-sqlite": "^2.8.6",
    "nativescript-toasty": "^3.0.0-alpha.2",
    "nativescript-ui-listview": "^10.0.2",
    "nativescript-ui-sidedrawer": "^10.0.2",
    "patch-package": "^6.4.7"
  },
  "devDependencies": {
    "@nativescript/android": "8.1.1",
    "@nativescript/ios": "JSC",
    "@nativescript/webpack": "~5.0.0"
  },
  "scripts": {
    "postinstall": "patch-package"
  }
}

At this point I'm looking for any suggestion on what to try or how to debug further. Lacking anything else, I'll start adding the above plugins to a sample project to see if there's any conflicts.

@kefahB
Copy link
Owner

kefahB commented Jan 16, 2022

Hi,

Yes please create a sample project to investigate this

@dlcole
Copy link
Author

dlcole commented Jan 17, 2022

Just adding the additional plugins didn't recreate the problem in the test project. I thought I'd try using the original Nativescript-google-maps-sdk plugin in my migrated project, but that required your replacement for map-view.ios.js. The crash still occurs, but the replacement code is so different from the original that it's hard to draw any conclusions.

I've been blocked on this for over a week and am running out of options.

@dlcole
Copy link
Author

dlcole commented Jan 20, 2022

I created this SO post to get more visibility and have posted the answer there. Net: my API key wasn't being specified. That's a good first thing to check if you're getting an immediate crash on iOS.

@dlcole dlcole closed this as completed Jan 20, 2022
@kefahB
Copy link
Owner

kefahB commented Jan 20, 2022

Sorry for that .. normally the plugin throw a message about GMS need a valid key or some think like this

@dlcole
Copy link
Author

dlcole commented Jan 20, 2022

Yes, I know, and that's why I was thrown off. I was playing with different options and tried new GMSMapView and that's where I saw the error message.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants