apache / cordova-ios

Apache Cordova iOS
https://cordova.apache.org/
Apache License 2.0
2.15k stars 986 forks source link

SwiftEmitModule normal arm64 Emitting\ module\ for\ #1322

Open jinghun1999 opened 1 year ago

jinghun1999 commented 1 year ago

Bug Report

Problem

What is expected to happen?

What does actually happen?

Information

Command or Code

sudo cordova build ios --release

build error message output below:

** BUILD FAILED **

The following build commands failed:
    SwiftEmitModule normal arm64 Emitting\ module\ for\ projectName (in target 'projectName' from project 'projectName')
    SwiftEmitModule normal x86_64 Emitting\ module\ for\ projectName (in target 'projectName' from project 'projectName')
(2 failures)
xcodebuild: Command failed with exit code 65

Environment, Platform, Device

ionic cordova mac os 13.3.1 (22E261)

Version information

Xcode Version 14.3 (14E222b) ionic: v3 "cordova-ios": "^6.3.0"

Checklist

jinghun1999 commented 1 year ago

any one who can help me. it's very important to me .

tavisirbu2310 commented 1 year ago

got the same issue

breautek commented 1 year ago

I'd suggest opening the project inside xcode and try building from there. You'll probably get better insight on what is the actual cause of the build failure.

The posted error message tells us absolutely nothing other than it's attempting to build a swift module and that build failed. Error code 65 is a general error code, xcode uses it for nearly all errors.

You can find the xcode project at /platforms/ios/<Project Name>.xcworkspace

Cmd + b, or Product -> Build to begin a build. A full build log should then be present and usually red GUI indicators pointing out the actual problems.

jurajspanko commented 10 months ago

Same issue here, I'm able to run the app in Xcode 14.3 but getting this error when building the project in the AppCenter

paragshrik commented 10 months ago

Same issue here. Is there any solution to this? Using Xcode 14.3 and facing for app center release.

jurajspanko commented 10 months ago

Hi guys, the issue we had was that during the build in app centre, the contents.xcworkspacedata have tried to use default

<FileRef
    location = "group:project.xcodeproj"> 
 </FileRef>

rather than

<FileRef
  location = "group:MyProjectName.xcodeproj">
</FileRef>

Which caused the swift module not knowing what to bundle

dexy58 commented 5 months ago

Hi guys, the issue we had was that during the build in app centre, the contents.xcworkspacedata have tried to use default

<FileRef
    location = "group:project.xcodeproj"> 
 </FileRef>

rather than

<FileRef
  location = "group:MyProjectName.xcodeproj">
</FileRef>

Which caused the swift module not knowing what to bundle

My project already had correct location written (with my project name). I'm also having the exact same issue when I build my iOS react-native v0.72.7 build on appcenter, with xCode 14.2 and Node version 18.x selected.

my error looks like this:

The following build commands failed:
    SwiftEmitModule normal arm64 Emitting\ module\ for\ swcclientapp (in target 'swcclientapp' from project 'swcclientapp')
    SwiftCompile normal arm64 Compiling\ noop-file.swift /Users/runner/work/1/s/ios/swcclientapp/noop-file.swift (in target 'swcclientapp' from project 'swcclientapp')
(2 failures)

my noop_file.swift is empty, it only contains 3 lines of comments.

//
// @generated
// A blank Swift file must be created for native modules with Swift files to work correctly.
//

If anyone knows how to fix it, please tell us.

Mr-Anonymous commented 5 months ago

I have the same error. The build fails everytime. First I get this warning:

The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 11.0, but the range of supported deployment target versions is 12.0 to 17.0.99. (in target 'CordovaLib' from project 'CordovaLib')

And following that message I also get the BUILD FAILED error like this:

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

I wonder if these 2 are related.

I use Cordova 12, tried both iOS 7 and iOS 6.1.1, XCode 15.0.1, POD Version 1.14.2 and MacOS 14.1.

Mr-Anonymous commented 5 months ago

Ok, I tried to build the same from Xcode and I noticed I was having an issue with a plugin. The build works fine if I remove the following 2 plugins:

cordova plugin rm cordova-plugin-add-swift-support
cordova plugin rm cordova-plugin-advanced-imagepicker

After that I removed and added the iOS platform again and it worked. Atleast I was able to narrow down the source in my project.

carleVivlico commented 5 months ago

Same issue here and able to break it down the same way @Mr-Anonymous did.

avinash-capsitech commented 4 months ago

From X-code its working fine but when i run using yarn ios/ react-native run-ios then it will give this : The following build commands failed: SwiftEmitModule normal x86_64 Emitting\ module\ for\ projectName (in target 'projectName' from project 'projectName') error.

choijiho0021 commented 4 weeks ago

From X-code its working fine but when i run using yarn ios/ react-native run-ios then it will give this : The following build commands failed: SwiftEmitModule normal x86_64 Emitting\ module\ for\ projectName (in target 'projectName' from project 'projectName') error.

same error lol..