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

bug: Compile error with SwiftEmitModule #21

Closed
stnbndr opened this issue Apr 4, 2024 · 8 comments
Closed

bug: Compile error with SwiftEmitModule #21

stnbndr opened this issue Apr 4, 2024 · 8 comments

Comments

@stnbndr
Copy link

stnbndr commented Apr 4, 2024

Describe the bug
I have gone through the Getting Startet guide. But if I try to compile the app with

npx ionic cap run ios

I get an error

The following build commands failed:
[capacitor]         SwiftEmitModule normal x86_64 Emitting\ module\ for\ App (in target 'App' from project 'App')
[capacitor]         (1 failure)
[capacitor]         
[ERROR] An error occurred while running subprocess capacitor.
        
        capacitor run ios --target 7945FAD9-4A05-44EE-82ED-4A5989B835BF exited with exit code 1.

To Reproduce
Go trough the steps of the Getting Started guide

git clone https://github.com/robingenz/capacitor-mlkit-plugin-demo.git
cd capacitor-mlkit-plugin-demo
npm i
npx ionic cap sync ios
npx ionic cap run ios

Expected behavior
The App should start in the iOS Simulator

Screenshots
Bildschirmfoto 2024-04-04 um 11 31 22

Desktop (please complete the following information):

  • Hardware: MacBook Pro with M2 Pro
  • OS: macOS 14.3
  • Xcode 15.3

Smartphone (please complete the following information):

  • Device: iPhone 15 Pro Simulator
  • OS: iOS 17.2 / 17.4

Additional context
I am a bit confused about the message with "x86_64" because I'm on an ARM Mac. Maybe some problem with Rosetta?

If I remove the

"@capacitor-mlkit/barcode-scanning": "5.4.0",
"@capacitor-mlkit/face-detection": "5.4.0",
"@capacitor-mlkit/face-mesh-detection": "5.4.0",
"@capacitor-mlkit/selfie-segmentation": "5.4.0",

from the package.json and re run

npx ionic cap sync ios
npx ionic cap run ios

compiling and opening in simulator works fine. But of course I get an error then, because of the missing plugin.
Bildschirmfoto 2024-04-04 um 11 45 23

@annisaabuhamid
Copy link

annisaabuhamid commented Apr 5, 2024

i also encounter the same issue too

@robingenz
Copy link
Owner

Thank you, I will take a look.

1 similar comment
@robingenz
Copy link
Owner

Thank you, I will take a look.

@sonvh0610
Copy link

sonvh0610 commented Apr 15, 2024

same issue here, cannot build in ios version but android version works fine

Hardware: MacBook Pro with M3 Pro
OS: macOS 14.4.1
Xcode 15.3
Device: iPhone 15 Pro Max Simulator
OS: iOS 17.2

@robingenz
Copy link
Owner

The app was just updated to Capacitor 6. Please try it again.
I tested it myself and everything worked without problems.

I'm therefore closing this issue.

@JaapWeijland
Copy link

I have both Capacitor and this plugin running on v6 and I still got the error.

Package.json deps:

"dependencies": {
    "@capacitor-mlkit/barcode-scanning": "^6.0.0",
    "@capacitor/app": "6.0.0",
    "@capacitor/core": "6.0.0",
    "@capacitor/haptics": "6.0.0",
    "@capacitor/ios": "^6.0.0",
    "@capacitor/keyboard": "6.0.0",
    "@capacitor/status-bar": "6.0.0",
    "@ionic/react": "^8.0.0",
    "@ionic/react-router": "^8.0.0",
    "@types/react-router": "^5.1.20",
    "@types/react-router-dom": "^5.3.3",
    "class-variance-authority": "^0.7.0",
    "ionicons": "^7.0.0",
    "react": "^18.2.0",
    "react-dom": "^18.2.0",
    "react-router": "^5.3.4",
    "react-router-dom": "^5.3.4",
    "tailwindcss-animate": "^1.0.7"
  },
  "devDependencies": {
    "@capacitor/cli": "6.0.0",
    "@testing-library/dom": ">=7.21.4",
    "@testing-library/jest-dom": "^5.16.5",
    "@testing-library/react": "^14.0.0",
    "@testing-library/user-event": "^14.4.3",
    "@types/react": "^18.0.27",
    "@types/react-dom": "^18.0.10",
    "@vitejs/plugin-legacy": "^5.0.0",
    "@vitejs/plugin-react": "^4.0.1",
    "autoprefixer": "^10.4.19",
    "cypress": "^13.5.0",
    "eslint": "^8.35.0",
    "eslint-plugin-react": "^7.32.2",
    "jsdom": "^22.1.0",
    "postcss": "^8.4.38",
    "tailwindcss": "^3.4.3",
    "terser": "^5.4.0",
    "typescript": "^5.1.6",
    "vite": "^5.0.0",
    "vitest": "^0.34.6"
  },

Error:

The following build commands failed: [capacitor] SwiftEmitModule normal x86_64 Emitting\ module\ for\ App (in target 'App' from project 'App')

@JaapWeijland
Copy link

When I build the app with Xcode, I get the following popup:

Build failed because Capacitor.swiftmodule is not built for arm64. Would you like to show all run destinations instead?
Ensure all targets are configured to build for standard architectures. If your project uses external dependencies, contact those vendors to provide updated copies built to support all architectures. You can control the visibility of architecture-specific run destinations in the Product > Destination menu.

@BeetrootToYourself
Copy link

BeetrootToYourself commented Apr 24, 2024

Getting the same issue as @JaapWeijland. All dependencies updated.

EDIT (updated):
This looks to be an issue with the way that apple silicon is compiling.
Using a Rosetta based emulator compiles without issue as well as builds to a physical iPhone.

EDIT (Solution):
ionic-team/capacitor#7425

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

6 participants