Xcode, Swift M1mac debug mode only, No such module 'module' error.

Asked 2 years ago, Updated 2 years ago, 24 views

What I want to do and what I can't do

Currently, we are trying to run a Swift project that works well with IntelMac on the M1 Mac.

The M1mac can also go through the build in Release mode, but in Debug mode, FirebaseClasylitics cannot import and the error 'FirebaseCrashlytics' occurs.
When deploying FirebaseClashLitics, we migrated from Fabric, so we used the official this article.

I also found out that when I re-build after commenting out import FirebaseClashlitics, the next line in the import Alamofire file is No such module Alamofire, and if I continue commenting out like this, the name of the No such module module module in other libraries.
We also found that the predictive transformation does not display anything other than the default UIkit or Foundation after import.

Procedures and Results

I didn't know the fundamental solution, so I took the following action.

rm-rf to /Library/Developer/Xcode/DerivedData/*
$rm-rf to /Library/Caches/CocoaPods/
$ rm-rf Pods
$ pod install
pod deintegrate
pod install

I tried all these common solutions, but the No such module 'module' didn't go away.

What and how did you find out

In order to resolve the above, articles such as 8 and 9 above appeared after searching for the following keywords.

·swift no such module

Workarounds you don't want to do

I don't want to change the existing code as much as possible because it works fine in the Intelmac and M1 release modes.

If you have any advice on how to resolve this issue, please let me know.

environment

MacBook Air Mid 2013 Intel, 8GB Catalina
Xcode 12.4

MacBook Air (M1,2020) M1,16GB
BigSur Xcode 12.5

#Uncomment the next line to define a global platform for your project
# platform:ios, '9.0'

target'App'do
  # Comment the next line if you're not using Swift and don't want to use dynamic frameworks
  use_frameworks!

  # Pods for App
  pod 'Alamofire', '~>4.7'
  pod 'RealmSwift', '~>3.21'
  pod 'DeployGateSDK'
  pod 'ZXingObjC', '~>3.2.2'
  pod 'Firebase/Core'
  pod 'Firebase/RemoteConfig'
  pod 'Firebase/Analysis'
  pod 'Firebase/Crashlytics'
  pod 'SwiftFormat/CLI'
  post_install do | installer |
    installer.pods_project.targets.each do | target |
      target.build_configurations.each do | config |
        config.build_settings['EXCLUDED_ARCHS[sdk=iphonesimulator*]] = 'arm64' if target.name.include?('Realm')
      end
    end
  end
  target 'AppTests' do
    inherit!:search_paths
    # Pods for testing
  end

  target 'AppUITests' do
    inherit!:search_paths
    # Pods for testing
  end
end

swift

2022-09-29 22:54

1 Answers

Based on the following article, it worked when I changed the podfile setting to exclude not only realm but also from arm64 for each project of the main body during simulator build.

[XCode, M1]no such module in simulator

Also, this article was very helpful.

What to do if Xcode12 fails to build for the simulator


2022-09-29 22:54

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.