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

Xcode build failed #1304

Closed
designervoid opened this issue Apr 5, 2021 · 9 comments
Closed

Xcode build failed #1304

designervoid opened this issue Apr 5, 2021 · 9 comments

Comments

@designervoid
Copy link

designervoid commented Apr 5, 2021

Describe the bug
I can run my app in debug mode on device and simulator with npx react-native run-ios.
I can create archives of my app and send them in Test Flight and AppStore.
I can build with detox-cli my debug and release mode iOS app.
But xCode12 run on device or simulator build failed with that error:

Building for iOS Simulator, but linking in dylib built for iOS, file '/Users/maximchernyshov/Desktop/project/frontend/ios/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Mapbox' for architecture arm64

To Reproduce
Build project with "@react-native-mapbox-gl/maps": "^8.2.0-beta1", in xCode on iPhone11, iOS 14.4

Additional Context
npx react-native info

maximchernyshov@MacBook-Pro-Maxim frontend % npx react-native info
info Fetching system and libraries information...
System:
    OS: macOS 10.15.7
    CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
    Memory: 739.18 MB / 16.00 GB
    Shell: 5.7.1 - /bin/zsh
  Binaries:
    Node: 14.15.2 - /usr/local/bin/node
    Yarn: 1.22.10 - /usr/local/bin/yarn
    npm: 6.14.9 - /usr/local/bin/npm
    Watchman: 4.9.0 - /usr/local/bin/watchman
  Managers:
    CocoaPods: 1.10.0 - /usr/local/bin/pod
  SDKs:
    iOS SDK:
      Platforms: iOS 14.4, DriverKit 20.2, macOS 11.1, tvOS 14.3, watchOS 7.2
    Android SDK:
      API Levels: 28, 29, 30
      Build Tools: 28.0.3, 29.0.2, 30.0.2
      System Images: android-30 | Google APIs Intel x86 Atom
      Android NDK: Not Found
  IDEs:
    Android Studio: 4.1 AI-201.8743.12.41.6953283
    Xcode: 12.4/12D4e - /usr/bin/xcodebuild
  Languages:
    Java: 13.0.2 - /usr/bin/javac
    Python: 2.7.16 - /usr/bin/python
  npmPackages:
    @react-native-community/cli: Not Found
    react: 16.13.1 => 16.13.1 
    react-native: 0.63.3 => 0.63.3 
    react-native-macos: Not Found
  npmGlobalPackages:
    *react-native*: Not Found
@ferdicus
Copy link
Member

ferdicus commented Apr 5, 2021

Can you please try the example project in the repo and report back - thanks

@designervoid
Copy link
Author

@ferdicus
build settings:
image
my scheme:
image

@designervoid
Copy link
Author

designervoid commented Apr 5, 2021

my mapbox component:

import MapboxGL from '@react-native-mapbox-gl/maps';
import Config from "react-native-config";

MapboxGL.setAccessToken(Config.MAPBOX_API_KEY);

const Map = () => {
  const cities = {
    moscow: [37.618423, 55.751244],
  };
  const [coordinates] = useState(cities.moscow);

  return (
    <>
      <MapboxGL.MapView
        style={
          flex: 1,
        }}>
        <MapboxGL.UserLocation />
        <MapboxGL.Camera zoomLevel={8} centerCoordinate={coordinates} />
      </MapboxGL.MapView>
    </>
  );
};

@mfazekas
Copy link
Contributor

mfazekas commented Apr 6, 2021

@designervoid sounds like duplicate of https://github.com/react-native-mapbox-gl/maps/issues/1031 is this an M1 Mac?!

@designervoid
Copy link
Author

designervoid commented Apr 6, 2021

@mfazekas
no, i have macbook pro 19 (16 inch) with intel i7

@designervoid
Copy link
Author

designervoid commented Apr 8, 2021

answer of @questionsrvdende in thread

I get this error when building for the simulator as release instead of debug.

Solution is to go to Product > Scheme > Edit Scheme

Set Build Configuration to Debug Tick Debug Executable

@designervoid
Copy link
Author

designervoid commented Apr 8, 2021

Now after changing Architectures field to x86_64 my app working on simulator with release mode. Now I can run my app throught xcode.
image

@ferdicus
Copy link
Member

ferdicus commented Apr 9, 2021

so all good, yes? closing this

@ferdicus ferdicus closed this as completed Apr 9, 2021
@noway
Copy link

noway commented Apr 10, 2021

You can encounter this error on both x86 and Apple Silicon. On x86 it's solved with the EXCLUDE_ARCH build setting. On Apple Silicon, there's still no fix.

Let's keep this issue scoped to x86 and close it.

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

No branches or pull requests

4 participants