question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Macbook M1 : App won't build on simulator but works fine on device

See original GitHub issue

Problem

App won’t build on the simulator but works fine on the device

After adding the below setting for a run on the simulator will cause the issue:


Xcode -> Target Project -> Build Setting -> Excluded Architectures > "arm64"

Xcode -> Pod Target -> Build Setting -> Excluded Architectures > "arm64"

ionic info


Ionic:

   Ionic CLI          : 6.13.1 (/Users/bhuminbhandari/.nvm/versions/node/v10.17.0/lib/node_modules/@ionic/cli)
   Ionic Framework    : ionic-angular 3.9.10
   @ionic/app-scripts : 3.2.4

Cordova:

   Cordova CLI       : 10.0.0
   Cordova Platforms : android 9.0.0, ios 6.2.0
   Cordova Plugins   : cordova-plugin-ionic-keyboard 2.2.0, cordova-plugin-ionic-webview 5.0.0, (and 15 other plugins)

Utility:

   cordova-res : 0.15.3
   native-run  : 1.3.0

System:

   Android SDK Tools : 26.1.1 (/Users/bhuminbhandari/Library/Android/sdk)
   ios-deploy        : 1.11.4
   NodeJS            : v10.17.0 (/Users/bhuminbhandari/.nvm/versions/node/v10.17.0/bin/node)
   npm               : 6.11.3
   OS                : macOS Big Sur

Xcode v12.5 (12E262) Xcode Error:

Undefined symbol: _CDVPageDidLoadNotification

Undefined symbol: _CDVPluginResetNotification

Undefined symbol: _OBJC_CLASS_$_CDVWebViewProcessPoolFactory

Undefined symbol: _CDVPluginHandleOpenURLNotification

Undefined symbol: _OBJC_METACLASS_$_CDVViewController

Undefined symbol: _OBJC_CLASS_$_CDVPlugin

Undefined symbol: _OBJC_METACLASS_$_CDVPlugin

Undefined symbol: _OBJC_CLASS_$_CDVViewController

Undefined symbol: _OBJC_METACLASS_$_CDVCommandDelegateImpl

Undefined symbol: _OBJC_CLASS_$_CDVPluginResult

Undefined symbol: _OBJC_METACLASS_$_CDVAppDelegate

Undefined symbol: _OBJC_CLASS_$_CDVCommandDelegateImpl

Undefined symbol: _OBJC_CLASS_$_CDVCommandQueue

Undefined symbol: _OBJC_METACLASS_$_CDVCommandQueue

Undefined symbol: _OBJC_CLASS_$_CDVInvokedUrlCommand

Undefined symbol: _OBJC_CLASS_$_CDVAppDelegate


Screenshot 2021-05-24 at 11 17 24 AM

Xcode Build Setting

Screenshot 2021-05-24 at 11 19 43 AM

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:4
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

13reactions
sjdrewcommented, Dec 30, 2021

Exact same issue on M1 mac. Cordova iOS 6.2.0… Solution.

Running xcode with Rosetta is a workaround. However I did find a solution.

I had already set my xcode targets to Excluded Architecture for “Any iOS Simulator SDK” = arm64

But turns out you also have to add for CordovaLib sub project. Once I added there, the error is gone and simulator works fine from xcode or ionic cordova emulate …

2reactions
lalmanzarcommented, Jul 12, 2021

I found a workaround, close xcode, and then open it with Rosetta.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Can't build to simulator on Apple Silicon
My project which has Firebase dependencies runs fine on a physical device. To make it run in the simulator, I have to run...
Read more >
Macbook M1 : App won't build on simulator but works ... - GitHub
I try to build my app on a MacBook Pro with Silicon M1 chip. After several headhaches on installing homebrew and cocoapods with...
Read more >
Xcode error 'building for iOS Simulator, but linking in dylib built ...
The app compiles and runs fine in device when compiled from Apple Silicon Mac. It is just that app refuse to be compiled...
Read more >
iOS Weird limitation for iOS development on an M1 Mac
The app fails to link to some dependencies with the error "building for iOS Simulator, but linking in object file built for iOS"....
Read more >
How do I run the iOS simulator on my M1-based Mac?
2. Make certain your simulator can run under Rosetta · Quit Xcode if it is running. · Use Finder to locate Xcode.app in...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found