maps icon indicating copy to clipboard operation
maps copied to clipboard

Expo support

Open renege opened this issue 6 years ago • 4 comments

Hello,

Cannot get it to work with expo.io.

Not supported?

renege avatar Feb 15 '20 09:02 renege

You'll need to eject to ExpoKit

mfazekas avatar Feb 15 '20 18:02 mfazekas

@mfazekas I ejected my project to Expokit and after pasting the following code in my podfile

pod 'react-native-mapbox-gl', :path => '../node_modules/@react-native-mapbox-gl/maps'

use_frameworks!

I keep getting the errors below running pod install. Is there something I am doing differently?

[!] The 'Pods-njokka-driver' target has transitive dependencies that include statically linked binaries: (/Users/Cho/Documents/njokka-driver-app- sdk36-eject-expokit/ios/Pods/Crashlytics/iOS/Crashlytics.framework, /Users/Cho/Documents/njokka-driver-app- sdk36-eject-expokit/ios/Pods/GoogleMaps/Base/Frameworks/GoogleMapsBase.framework, /Users/Cho/Documents/njokka-driver-app- sdk36-eject-expokit/ios/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework, and /Users/Cho/Documents/njokka-driver-app- sdk36-eject-expokit/ios/Pods/GoogleMaps/Maps/Frameworks/GoogleMapsCore.framework)

i also tried the use_frameworks! workaround and had the following error: Screen Shot 2020-03-12 at 3 08 26 PM

chohonest avatar Mar 12 '20 19:03 chohonest

@chohonest sorry not sure about the GoogleMapsCore related error, you can check if it's caused by use_frameworks! or not by commenting out that line. The other error is what it says that the file not found. You need to check if the file is there, and if not need a newer rnmbgl

mfazekas avatar Mar 12 '20 21:03 mfazekas

@mfazekas I am able to run pod install when I comment out use_frameworks! but my application crash on startup when I run the following code:

import React, { Component } from "react";
import { StyleSheet, View } from "react-native";
import MapboxGL from "@react-native-mapbox-gl/maps";

MapboxGL.setAccessToken("**********");

const styles = StyleSheet.create({
  page: {
    flex: 1,
    justifyContent: "center",
    alignItems: "center",
    backgroundColor: "#F5FCFF"
  },
  container: {
    height: 300,
    width: 300,
    backgroundColor: "tomato"
  },
  map: {
    flex: 1
  }
});

export default class App extends Component {
  componentDidMount() {
    MapboxGL.setTelemetryEnabled(false);
  }

  render() {
    return (
      <View style={styles.page}>
        <View style={styles.container}>
          <MapboxGL.MapView style={styles.map} />
        </View>
      </View>
    );
  }
}

with the following error in Xcode :

dyld: Library not loaded: @rpath/MapboxMobileEvents.framework/MapboxMobileEvents Referenced from: /Users/Cho/Library/Developer/CoreSimulator/Devices/79C519ED-6FFC-4786-96A2-3103387E86A1/data/Containers/Bundle/Application/4D14F889-FB5F-4BA5-B715-A23BDE87A220/njokka-driver.app/Frameworks/Mapbox.framework/Mapbox Reason: image not found

The error makes sense and I can see it in the Framework, Libraries, and Embedded Content:

Screen Shot 2020-03-12 at 5 39 28 PM

Any insight into why it won't auto-link? I ejected from Expo SDK 36 which uses RN 0.61

chohonest avatar Mar 12 '20 22:03 chohonest