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

[iOS] - [MGLMapView willResignActive:] #1068

Closed
martinfrouin opened this issue Oct 12, 2020 · 21 comments
Closed

[iOS] - [MGLMapView willResignActive:] #1068

martinfrouin opened this issue Oct 12, 2020 · 21 comments
Labels
bug 🪲 Something isn't working iOS iOS related tickets Needs: Author Feedback Needs: Repro This issue could be improved with a clear list of steps to reproduce the issue. upstream the bug source is a bug in native mapbox gl

Comments

@martinfrouin
Copy link

martinfrouin commented Oct 12, 2020

Describe the bug
Some users of our app are getting this crash error since iOS 14:

Main Thread - Crashed

    libsystem_platform.dylib
    0x1f2c91000 + 22132
    AGXMetalA12
    0x1f3bf4000 + -2799427522815819632
    AppleMetalGLRenderer
    0x1f319c000 + 1520465701784075052
    GLEngine
    0x1dce67000 + -5304245852774968596
    GLKit
    0x1dbb42000 + -6543887488731973824
    Mapbox
    -[MGLMapView willResignActive:] MGLMapView.mm:1495
    CoreFoundation
    0x1ab621000 + 526180
    CoreFoundation
    0x1ab621000 + 5838652484339894040
    CoreFoundation
    0x1ab621000 + -8108640419370763052
    CoreFoundation
    0x1ab621000 + -7625419902370187616
    Foundation
    0x1ac92e000 + 7951885245622543860
    UIKitCore
    0x1ad4df000 + -7632541988927602764
    UIKitCore
    0x1ad4df000 + -6187282882493334224
    UIKitCore
    0x1ad4df000 + -3575670637391911724
    UIKitCore
    0x1ad4df000 + -6611242471535855424
    UIKitCore
    0x1ad4df000 + -4969389036777950324
    UIKitCore
    0x1ad4df000 + 4757859492272617168
    UIKitCore
    0x1ad4df000 + 8960513991027797832
    UIKitCore
    0x1ad4df000 + -4598902546484842376
    UIKitCore
    0x1ad4df000 + 3923654522725403688
    UIKitCore
    0x1ad4df000 + -2512790888762611696
    UIKitCore
    0x1ad4df000 + 8081208154016296432
    UIKitCore
    0x1ad4df000 + -9194013976881201488
    UIKitCore
    0x1ad4df000 + 5052451092944971884
    UIKitCore
    0x1ad4df000 + -7186500907876156712
    UIKitCore
    0x1ad4df000 + -494960552399235292
    FrontBoardServices
    0x1ba6eb000 + 6352875380952570744
    FrontBoardServices
    0x1ba6eb000 + -6162027100405280364
    FrontBoardServices
    0x1ba6eb000 + 6353825358999026980
    FrontBoardServices
    0x1ba6eb000 + 8890411328662098112
    libdispatch.dylib
    0x1ab33d000 + 8806018313671949000
    libdispatch.dylib
    0x1ab33d000 + -6975515621622516920
    FrontBoardServices
    0x1ba6eb000 + 963587251571634400
    FrontBoardServices
    0x1ba6eb000 + 4415812419985976712
    FrontBoardServices
    0x1ba6eb000 + -7682999677049523540
    CoreFoundation
    0x1ab621000 + 7232121294581000220
    CoreFoundation
    0x1ab621000 + 1250351978723796760
    CoreFoundation
    0x1ab621000 + 1538244804805778068
    CoreFoundation
    0x1ab621000 + 8594720766116330784
    CoreFoundation
    0x1ab621000 + -6018300039933627204
    GraphicsServices
    0x1c213a000 + -8199224784337225696
    UIKitCore
    0x1ad4df000 + 4567363605212157748
    UIKitCore
    0x1ad4df000 + -1341929202676912624
    <App Name>
    0x102c60000 + -6534630150582008972
    libdyld.dylib
    0x1ab37f000 + 3680

I don't have reproduce it yet but I saw a lot of threads about it like: mapbox/mapbox-gl-native-ios#485

@ferdicus
Copy link
Member

Thanks for reporting.

Did you try the solution mentioned in the upstream ticket?
Did you try ios-sdk 6.2.1?

@ferdicus ferdicus added upstream the bug source is a bug in native mapbox gl bug 🪲 Something isn't working iOS iOS related tickets labels Oct 12, 2020
@martinfrouin
Copy link
Author

martinfrouin commented Oct 12, 2020

I can't reproduced it yet so no, I haven't tried it

@ferdicus ferdicus added the Needs: Repro This issue could be improved with a clear list of steps to reproduce the issue. label Nov 13, 2020
@jaltin
Copy link
Contributor

jaltin commented Nov 19, 2020

We are also experiencing this crash at the moment.

It happens regularly when the app is in the background and alive (we are tracking movement so keeping the app alive). So far it has only happened when the app is in the background.

At the moment we can't reproduce it/trigger it.

I don't know if it will help, but I have added a screenshot from once when the crash happened while running from Xcode.

image

@mfazekas
Copy link
Contributor

@jaltin thanks, what was the Mapbox IOS version?! Can you try with 6.3.0?!

There was some changes in that are in mapbox
mapbox/mapbox-gl-native-ios@21a7bbe

and according to this: mapbox/mapbox-gl-native-ios#485 (comment) it's fixed.

@martinfrouin
Copy link
Author

martinfrouin commented Nov 19, 2020

@jaltin thanks, what was the Mapbox IOS version?! Can you try with 6.3.0?!

There was some changes in that are in mapbox
mapbox/mapbox-gl-native-ios@21a7bbe

and according to this: mapbox/mapbox-gl-native-ios#485 (comment) it's fixed.

@mfazekas how can I try with this version ?
I don't see mapbox-gl-native-ios on the project or RN-mapbox dependencies or on the iOS files

@mfazekas
Copy link
Contributor

@tinmar33 see https://github.com/react-native-mapbox-gl/maps/pull/940#issue-441493074

@martinfrouin
Copy link
Author

martinfrouin commented Nov 19, 2020

@mfazekas
[!] CocoaPods could not find compatible versions for pod "@react-native-mapbox-gl-mapbox-static": In Podfile: react-native-mapbox-gl (from '../node_modules/@react-native-mapbox-gl/maps') was resolved to 8.1.0-rc.9, which depends on @react-native-mapbox-gl-mapbox-static (~> 6.3)

After adding $ReactNativeMapboxGLIOSVersion = '~> 6.3' before use_native_modules!

I tried pod repo update but it doesn't fixed it

Any idea ?

@mfazekas
Copy link
Contributor

@mfazekas
[!] CocoaPods could not find compatible versions for pod "@react-native-mapbox-gl-mapbox-static": In Podfile: react-native-mapbox-gl (from '../node_modules/@react-native-mapbox-gl/maps') was resolved to 8.1.0-rc.9, which depends on @react-native-mapbox-gl-mapbox-static (~> 6.3)

After adding $ReactNativeMapboxGLIOSVersion = '~> 6.3' before use_native_modules!

I tried pod repo update but it doesn't fixed it

Any idea ?

@tinmar33 sorry I've just published 6.3.0 can you try

pod install --repo-update

@martinfrouin
Copy link
Author

martinfrouin commented Nov 19, 2020

@mfazekas I have an error while downloading the package

Installing @react-native-mapbox-gl-mapbox-static (6.3.0) -> 401 Unauthorized

@mfazekas
Copy link
Contributor

@martinfrouin
Copy link
Author

martinfrouin commented Nov 19, 2020

All good 👌 Thanks.
I will try with this version

@jaltin
Copy link
Contributor

jaltin commented Nov 20, 2020

@jaltin thanks, what was the Mapbox IOS version?! Can you try with 6.3.0?!

There was some changes in that are in mapbox
mapbox/mapbox-gl-native-ios@21a7bbe

and according to this: mapbox/mapbox-gl-native-ios#485 (comment) it's fixed.

@mfazekas Thanks for your help! We are trying this right now and we will get back to you once we see if it works or not.

A related question: To use $ReactNativeMapboxGLIOSVersion has forced us to update to the 8.1.0.rc9 (we were on 8.0.0 before). Do you have any "feel" of how stable this version is? Is it close to a full release or still other known bugs?

@ferdicus
Copy link
Member

@jaltin, version 8.1.0.rc9 is probably just as (un-)stable as 8.0.0.
We don't have an official smoketest/ hardening/ testing cycle for our releases - it that's what you're asking.

@jaltin
Copy link
Contributor

jaltin commented Nov 20, 2020

@ferdicus, thanks for your reply.

We are currently using 8.0.0 in prod, and I was asking because I wanted to get a feel if it will be reasonable to consider to use the rc9 release in our app in production to get around this bug. I was hoping that you guys would have a "feel" of the feasibility of this.

@jaltin
Copy link
Contributor

jaltin commented Nov 23, 2020

@jaltin thanks, what was the Mapbox IOS version?! Can you try with 6.3.0?!
There was some changes in that are in mapbox
mapbox/mapbox-gl-native-ios@21a7bbe
and according to this: mapbox/mapbox-gl-native-ios#485 (comment) it's fixed.

@mfazekas Thanks for your help! We are trying this right now and we will get back to you once we see if it works or not.

A related question: To use $ReactNativeMapboxGLIOSVersion has forced us to update to the 8.1.0.rc9 (we were on 8.0.0 before). Do you have any "feel" of how stable this version is? Is it close to a full release or still other known bugs?

Status update after our testing

So we have now tested this over the last 3 days running on 6 different devices (iPad and iPhone, iOS 12, 13 & 14) with the app running continuously in the background. None of the devices has crashed so setting the version of $ReactNativeMapboxGLIOSVersion to 6.3.0 seems to work for us so far.

Thanks a lot to @mfazekas and @ferdicus for your help!

@ferdicus
Copy link
Member

good news 👍🏿

I'll close this ticket - feel free to open another one (or we can reopen this one) when this issue reoccurs

@martinfrouin
Copy link
Author

martinfrouin commented Nov 24, 2020

I'm glad to hear it, thanks for the feedback @jaltin :)

@luskin
Copy link

luskin commented Feb 2, 2021

@jaltin would you mind providing the community with some more details on how you got this working? We have added $ReactNativeMapboxGLIOSVersion = '~> 6.3' before use_native_modules! and have tried installing with repo update but cannot seem to get CocoaPods to adhere to the new version.

@jaltin
Copy link
Contributor

jaltin commented Feb 5, 2021

@luskin I don't really know what could be going wrong for you. Did you set up .netrc on your machine too (https://docs.mapbox.com/ios/maps/guides/install/)?

@luskin
Copy link

luskin commented Feb 19, 2021

@jaltin Turned out to be the lockfile which was restricting it. If anybody else is having problems upgrading to 6.3.0 remove any instances of MapBox in your Podfile.lock and run pod install --repo-update

@RobertSasak
Copy link
Contributor

So far I can confirm that updating Mapbox to 6.2.1 did the trick. I have never experienced the crash myself but the crash has disapear from Crashlytics after updating to 6.2.1.

I use following script to add mapbox downloading crendentials to .netrc.
appcenter-post-clone.sh

#!/usr/bin/env bash

# Add Mapbox password to .netrc in order to download iOS SDK
echo -e "machine $NETRC_MAPBOX_MACHINE\nlogin $NETRC_MAPBOX_LOGIN\npassword $NETRC_MAPBOX_PASSWORD" > ~/.netrc

So far I only updated to 6.2.1 as another bug in pod do not produce properly aligned archives for version 6.3.0
https://github.com/react-native-mapbox-gl/maps/issues/1097

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🪲 Something isn't working iOS iOS related tickets Needs: Author Feedback Needs: Repro This issue could be improved with a clear list of steps to reproduce the issue. upstream the bug source is a bug in native mapbox gl
Projects
None yet
Development

No branches or pull requests

6 participants