apache / cordova-ios

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

xcodebuild: command failed with exit code 65 #966

Closed shanlin2dltk closed 3 months ago

shanlin2dltk commented 3 years ago

Bug Report

My app was built successfully with Cordova-ios version 5.1.1. After changing iOS engine in config.xml from 5.1.1 to 6.1.0, 'cordova build ios' gives error: xcodebuild: Command failed with exit code 65 Error: xcodebuild: Command failed with exit code 65 at ChildProcess.whenDone (/Users/shanlin/build/extjs_cp_time/cordova/node_modules/cordova-common/src/superspawn.js:136:25) at ChildProcess.emit (events.js:182:13) at maybeClose (internal/child_process.js:962:16) at Process.ChildProcess._handle.onexit (internal/child_process.js:251:5)

Any idea about what might be the problem?

Command or Code

cordova build ios

Version information

cordova cli version 9.0.0 and 10.0.0 both have the issues. cordova-ios version 6.1.0 generates the error. Mac OS 10.14.6 Xcode 11.3.1

probityrules commented 3 years ago

I had the error with exit code 65, but upgraded Xcode to 11.6, and it's working for me now.

shanlin2dltk commented 3 years ago

Just upgraded to Xcode 11.6, I am still getting the same error. Specifically xcodebuild: Command failed with exit code 65 at ChildProcess.whenDone (/Users/shanlin/build/extjs_cp_time/cordova/node_modules/cordova-common/src/superspawn.js:136:25)

shanlin2dltk commented 3 years ago

The newest version cordova-ios@6.1.1 still has the same error.

lasrbugs commented 3 years ago

when using socket plugins, removing and adding them agin helped here to get rid of error 65

indrapalijama commented 3 years ago

when using socket plugins, removing and adding them agin helped here to get rid of error 65

there's no socket plugins in my plugins, still got error 65 when building

breautek commented 3 years ago

For some background context, error 65 from xcodebuild is a generic error that simply describes that xcodebuild couldn't do a build, which of course... pretty much anything could cause: invalid configuration, unmaintained plugins, out-dated software, etc. Without digging into more of xcodebuild output, you're trying to find a needle in a haystack.

You may have to scan through the tons of input that xcodebuild produces or open up the XCode project located at ./platforms/ios/<App Name>.xcworkspace and try to build from XCode GUI to get a more meaningful error.

indrapalijama commented 3 years ago

For some background context, error 65 from xcodebuild is a generic error that simply describes that xcodebuild couldn't do a build, which of course... pretty much anything could cause: invalid configuration, unmaintained plugins, out-dated software, etc. Without digging into more of xcodebuild, you're trying to find a needle in a haystack.

You may have to scan through the tons of input that xcodebuild produces or open up the XCode project located at ./paltforms/andriod/ios/<App Name>.xcworkspace and try to build from XCode GUI to get a more meaningful error.

did it somehow related to xcode version?

breautek commented 3 years ago

did it somehow related to xcode version?

No. Xcode uses error code 65 for as long as i started developing. Using an unsupported XCode version could be a cause, but as long as you're using >= 11 that should be sufficient.

indrapalijama commented 3 years ago

did it somehow related to xcode version?

No. Xcode uses error code 65 for as long as i started developing. Using an unsupported XCode version could be a cause, but as long as you're using >= 11 that should be sufficient.

Thanks, i finally did find the root cause using your answer above. it seems that the cordova-file-transfer is causing the error and i found the fix using this git. sorry for the out of topic question, i want to know how can i add this plugin?

ZumelzuR commented 3 years ago

I have the same problem when I'm building for ios with "prod" tag.

I have:

For me the solution that worked was first sign the app on xcode after the first build issue (open platform/ios with xcode and sign the app). Then I build with the commands that people suggest here, but I have to add the "--device" tag also. After that work good :)

ionic cordova run ios --prod --release --buildFlag="-UseModernBuildSystem=0"  --device
gbrits commented 3 years ago

So @ZumelzuR the useModernBuildSystem part is clearly the difference, is that not something that can be hardcoded in the tsconfig or something?

ZumelzuR commented 3 years ago

You can add the command to prod build in you package.json as "scripts" prroperty or you can create a build.json (you can find in internet some examples) with all the specifications.

Ex.

{ "ios":{ "release" : { "buildFlag": [ "--UseModernBuildSystem=0" ] } }

adideas commented 2 years ago

HI !

Here is what helped me

STEP 1 (build.xcconfig)

// xcode 13
EXCLUDED_ARCHS__EFFECTIVE_PLATFORM_SUFFIX_simulator__NATIVE_ARCH_64_BIT_x86_64=arm64 arm64e armv7 armv7s armv6 armv8
EXCLUDED_ARCHS=$(inherited)
$(EXCLUDED_ARCHS__EFFECTIVE_PLATFORM_SUFFIX_$(EFFECTIVE_PLATFORM_SUFFIX)__NATIVE_ARCH_64_BIT_$(NATIVE_ARCH_64_BIT))

IPHONEOS_DEPLOYMENT_TARGET = 12.0

STEP 2 (Podfile)

pod 'CocoaAsyncSocket'

post_install do |installer|
  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
      config.build_settings.delete 'IPHONEOS_DEPLOYMENT_TARGET'
      config.build_settings['EXCLUDED_ARCHS[sdk=iphonesimulator*]'] = 'arm64'
      config.build_settings['CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER'] ='NO'
      config.build_settings['ONLY_ACTIVE_ARCH'] = 'YES'
    end
  end
end

IPHONEOS_DEPLOYMENT_TARGET = 12.0
dpogue commented 3 months ago

Error code 65 is the result whenever Xcode encounters a build error. This does not provide any detail about what the error was or how to address it. It could be anything from a bad plugin to bad code signing, but without more details and the actual error message from Xcode, we can't provide any help diagnosing it.

Closing this bug due to lack of actionable information. If you run into error code 65, look for the actual error message from Xcode and then open a new bug with that detail.