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

Android App crash when using MapView v7.0.9 #666

Closed
ShaharyarMaroof opened this issue Feb 14, 2020 · 12 comments
Closed

Android App crash when using MapView v7.0.9 #666

ShaharyarMaroof opened this issue Feb 14, 2020 · 12 comments

Comments

@ShaharyarMaroof
Copy link

ShaharyarMaroof commented Feb 14, 2020

Describe the bug
Using mapview to render a map, working fine on iOS. but on android the app crashes.

To Reproduce

<MapView
      style={{ flex: 1 }}
      logoEnabled={false}
      // attributionEnabled={false}
      compassEnabled
      onRegionDidChange={async (data) => {onRegionDidChange}
      onDidFinishRenderingMapFully={onMapRenderComplete}
    >
      <Camera
        zoomLevel={14}
      />
      <UserLocation />
</MapView>

Expected behavior
Map should render successfuly

Screenshots
image

Versions (please complete the following information):

  • Platform: android
  • Device: pixel 3
  • Emulator/ Simulator: yes
  • OS: android 9
  • SDK Version 28
  • React Native Version 0.60.1
@ferdicus
Copy link
Member

ferdicus commented Feb 14, 2020

<MapBoxMapView
      style={{ flex: 1 }}
      logoEnabled={false}
      // attributionEnabled={false}
      compassEnabled
      onRegionDidChange={async (data) => {onRegionDidChange}
      onDidFinishRenderingMapFully={onMapRenderComplete}
    >
      <Camera
        zoomLevel={14}
      />
      <UserLocation />
</MapView>

I see two things:
<MapBoxMapView> and </MapView>

And not quite sure, that you can comment out props on a component like that in JSX.
// attributionEnabled={false}

@ShaharyarMaroof
Copy link
Author

@ferdicus fixed typo in the pasted code. So the commented part is working as expected, when I run the code I get the exception as shown above.

@ferdicus
Copy link
Member

Are you on current master?

@ShaharyarMaroof
Copy link
Author

"@mapbox/mapbox-sdk": "^0.9.0",

@ferdicus
Copy link
Member

ferdicus commented Feb 14, 2020

Ehm, that's a completely different repo:
@react-native-mapbox-gl/maps: 7.2.0

In any case, try to reproduce it in the /example project.

@ShaharyarMaroof
Copy link
Author

Ah. sorry about that..... I've got 7.0.9. I'll try to update it to the version you mentioned and try again. Thanks!

@ShaharyarMaroof ShaharyarMaroof changed the title Android App crash when using MapView Android App crash when using MapView v7.0.9 Feb 14, 2020
@ShaharyarMaroof
Copy link
Author

ShaharyarMaroof commented Feb 14, 2020

@ferdicus I have updated the lib to 7.2.0, and followed the iOS installation instructions to install the pods
to verify if the update worked.

Now I can't even run it on ios, as I am getting the following error now:

dyld: Library not loaded: @rpath/MapboxMobileEvents.framework/MapboxMobileEvents
  Referenced from: .../Frameworks/Mapbox.framework/Mapbox
  Reason: image not found

@ShaharyarMaroof
Copy link
Author

image
Mapbox framework is added to Embed Pods Framework as well.

@ShaharyarMaroof
Copy link
Author

@ferdicus I wasn't able to get the project running on 7.2.0, but I managed to get 7.0.9 to work on ios and android.

Steps I followed:

  1. npm i @react-native-mapbox-gl/maps@7.0.9 --save
  2. cd ios and add the pod 'react-native-mapbox-gl', :path => '../node_modules/@react-native-mapbox-gl/maps' only. Then run pod install. Adding use_frameworks! was messing up other dependencies.
  3. Then go to the android installation section and manually link the dependencies.

Now running fine on both platforms. My react-native version is 0.60.6.

@ferdicus
Copy link
Member

Good to hear 🎉

I think your best bet is 7.0.10 though.
It has an update of the Android SDK that fixed a major crash bug yet is before the breaking iOS install changes that were introduced with 7.2.0.

Issue about the crash bug: #625

Link to release / changelog: https://github.com/react-native-mapbox-gl/maps/releases/tag/7.0.10.2

@ferdicus
Copy link
Member

Closing

@ShaharyarMaroof
Copy link
Author

thanks! will take a look at this as well.

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