mapbox / mapbox/mapbox-maps-flutter

iOS 17 Cannot properly build release version

Open
#385 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Dart
Stars
380
Forks
204
PR merge metrics
No merged PRs in 30d

Description

## Description
All started by this error:
```Could not find module 'MapboxMaps' for target 'arm64-apple-ios-simulator'; found: x86_64-apple-ios-simulator```

I've found other closed issue but they were old and not currently working.

## Context:
I'm using an M1 chip

Flutter doctor

```bash
[✓] Flutter (Channel master, 3.19.0-9.0.pre.206, on macOS 14.3 23D56 darwin-arm64, locale it-IT)
• Flutter version 3.19.0-9.0.pre.206 on channel master at /Users/rafaelbenetton/Documents/Core/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 7e46394178 (8 ore fa), 2024-01-29 01:46:24 -0500
• Engine revision 210ed1dfb8
• Dart version 3.4.0 (build 3.4.0-82.0.dev)
• DevTools version 2.31.0

[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.2)
• Android SDK at /Users/rafaelbenetton/Library/Android/sdk
• Platform android-33, build-tools 33.0.2
• Java binary at: /Users/rafaelbenetton/Desktop/Android Studio.app/Contents/jbr/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b802.4-9586694)
• All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 15.2)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Build 15C500b
• CocoaPods version 1.14.3

[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2022.2)
• Android Studio at /Users/rafaelbenetton/Desktop/Android Studio.app/Contents
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b802.4-9586694)

[✓] VS Code (version 1.85.1)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.80.0

[✓] Connected device (3 available)
• iPad 17.2 (mobile) • 96F06AA2-37BD-4212-9E6E-A6DB4C6601F9 • ios • com.apple.CoreSimulator.SimRuntime.iOS-17-0 (simulator)
• macOS (desktop) • macos • darwin-arm64 • macOS 14.3 23D56 darwin-arm64
• Chrome (web) • chrome • web-javascript • Google Chrome 120.0.6099.234

[✓] Network resources
• All expected network resources are available.

• No issues found!
```

## Troubleshooting
Ok so the problem is (i think) this package does not support Apple Silicon chip.
Ok the solutions would be searching for xcode.app > "Get info" > and toggle "Open with Rosetta"

![photo_2024-01-29_15-23-24](https://github.com/mapbox/mapbox-maps-flutter/assets/34171011/6f336bb1-2462-476c-b245-703bfe12c5e6)
Well, I don't have this toggle so, by opening xcode instead of vscode (I build with vscode yes) and build the project a dialog shows up:
![photo_2024-01-29_15-23-01](https://github.com/mapbox/mapbox-maps-flutter/assets/34171011/6626cd69-4dd7-45d4-90fa-c4f0b94dd768)

Nice, let's build with Rosetta then!
![photo_2024-01-29_15-23-08](https://github.com/mapbox/mapbox-maps-flutter/assets/34171011/ba8017dd-3abd-4fb6-a593-6a1b4371c6f6)

Hurray, you have a loop.

What I have to do?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the release build on an M1 Mac with macOS 14.3, Xcode 15.2, iOS 17, Flutter 3.19.0-9.0.pre.206, and MapboxMaps. Investigate the arm64 versus x86_64 simulator module mismatch and the Rosetta build loop; done means the iOS release version builds successfully without that error.

Written by the indexing model from the issue text.

Assessment

Tech stack
dart, flutter, ios
Domain
build-system, mobile-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.