I have searched high and low but I am unable to archive an iOS app correctly. The app runs perfectly on the simulator and physical devices but I am not able to submit the app to the AppStore because the app is a Generic Xcode Archive instead of an iOS App.
What I have done:
Skip install is NO for the main project target
Skip install is YES for Static Library target
Alle Copy Headers are in Project
Installation Directory is /Applications
Target dependencies are empty
update I am not using Cocoapods
Update When I compile using terminal:
xcodebuild -destination generic/platform=iOS
I get the folling error
build/iosvr.build/Release-iphoneos/iosvr.build/Objects-normal/armv7/DistortionRenderer.o iosvr/DistortionRenderer.cpp normal armv7 c++ com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)
Related
Getting linker error in Xcode 12 when I am trying to build my large iOS app (hybrid, swift+objc). The application is building fine for real device, but It gives linker error when I am trying to run in Simulator directly with Debug configuration.
I have tried all possible solutions in other post here, but unfortunately it didn't work. Although the error in other post is different. I have checked Build for active architectures only to YES for Debug configs and NO for Release configs.
Other post error,
building for iOS Simulator, but linking in object file built for iOS, for architecture arm64
My error,
building for iOS Simulator, but linking in object file built for macOS, file for architecture x86_64
How can I resolve this issue? I need to run in both iOS real device and Simulator.
Wherever you got your library you should request the library that is compiled for iOS Simulator, not for macOS, although they have the same binary architectures that are returned via lipo -info <file>.
You can verify that your static (.a) or dynamic library (.dylib) is compiled for iOS Simulator using this command:
otool -l <path-to-library> | grep platform
The output means the following:
platform 7 - iOS Simulator
platform 6 - Mac Catalyst
platform 4 - watchOS
platform 2 - iOS
platform 1 - macOS
Here is the full definition of the enum for platform.
Try to add x86_64 in VALID_ARCHS in the User-defined section in Build Settings.
Basically I have built a compiled released framework and distributed it with cocoaPods. The problem is that then archiving this framework application gets the following error:
ld: bitcode bundle could not be generated because
'/Users/cagrialtay/Desktop/mucbirsebepler/ios/Flutter/Flutter.framework/Flutter'
was built without full bitcode. All frameworks and dylibs for bitcode
must be generated from Xcode Archive or Install build file
'/Users/cagrialtay/Desktop/mucbirsebepler/ios/Flutter/Flutter.framework/Flutter'
for architecture armv7 clang: error: linker command failed with exit
code 1 (use -v to see invocation) Search for Enable Bitcode setting
and set it to YES for Debug and Release modes.
Things I tried but had no luck
Enable Bitcode' set to 'YES' Adding '-fembed-bitcode' to 'Other C
Flags' Adding 'BITCODE_GENERATION_MODE' with the value 'bitcode' set
skip install to yes
I only need release version, so I did not built an universal framework, just release version... I would genuinely like to solve this issue, because it has been a nightmare for me..
I finally solved this.This error happened because of me . I develop my iOS application with flutter, so if you develop your iOS app in Flutter firstly you must build with flutter not Xcode
flutter clean
flutter build ios
then go
Xcode -> Product -> Destination -> Any iOS Device
Xcode-> Product -> Scheme -> choose scheme -> Runner
Xcode-> Product -> Archive
or
flutter clean
flutter build ipa
then
Xcode-> Product -> Archive
That happened to me too. Xcode 11, Flutter. I tried deleting the App on Simulator still did not work.
Open project folder
Go to ios file
Go to Runner Folder
Right click on "Launch Screen.storyboard"
Open with Xcode.
I'm trying to build and archive (in Release and Debug mode) an ios project generated with apache cordova 4.0.0, via command line tool xcodebuild
These commands work ok:
cordova platform add ios
cordova prepare ios
cordova build ios
The ios project generated by cordova has a scheme called iHogar. After that, when I try to launch this command on the console:
xcodebuild -scheme iHogar -sdk iphoneos -configuration Debug
CODE_SIGN_IDENTITY="iPhone Distribution: S-N-A L-C-A, S- CO-P-Ñ-A DE
SE-U-O- Y R--A-E-U-OS (xxxxxxx)"
It stops at the beginning of the execution, and does not continue. The value of param CODE_SIGN_IDENTITY is modified due to privacy reasons.
Here is the output of the command, through console:
Build settings from command line:
CODE_SIGN_IDENTITY = iPhone Distribution: S-N-A L-C-A, S- CO-P-Ñ-A DE SE-U-O- Y R--A-E-U-OS (xxxxxxx)
SDKROOT = iphoneos8.1
And stops there without finishing the command (it hangs) , only stops with crtl+C
The certificate is ok, and also the provisioning profile. If I open the project with Xcode (version 6.1) everything goes ok, I can build and archive it without problems, with the same certificate and provisioning profile.
Has anyone experienced this behavior?
Thanks in advance
I have resolved this issue. The problem was that the cordova generated ios project hasn't got schemas. Those are created the first time you open the project with XCode. When the app has been created by cordova, is only created with targets.
In this scenario, that the generated app cannot be opened with XCode with human interaction, is better to build the app with the target option, like this:
xcodebuild -xcconfig "cordova/build.xcconfig" -project "iHogar.xcodeproj" ARCHS="armv7 armv7" -target "iHogar" -configuration Debug -sdk iphoneos build VALID_ARCHS="armv7 armv7s" CONFIGURATION_BUILD_DIR="build/device"
It's important to have the certificate to sign the app installed in the keychain, and the related provisioning profile downloaded.
I know you got around your issue, but as this is quite recent, have you considered upgrading to Cordova 5.1.1. This will build and code sign the app without the need to go into XCode.
I am developing an app with phonegap and I have always been testing the app using the android simulator and I have not had any problems, but I can not get it to work for iOS.
I'm working on a Mac OS mavericks and have installed Xcode.
When I run the command "phonegap run ios", I get the following:
[phonegap] detecting iOS SDK environment...
[phonegap] using the local environment
[phonegap] compiling iOS...
Build settings from command line:
ARCHS = i386
CONFIGURATION_BUILD_DIR = /Users/usuario/Desktop/desarrolloapp/nombreapp/platforms/ios/build/emulator
SDKROOT = iphonesimulator7.1
VALID_ARCHS = i386
xcodebuild: error: The project ‘NombreApp.xcodeproj’ does not contain a target named ‘NombreApp’.
[error] /Users/usuario/Desktop/desarrolloapp/nombreapp/platforms/ios/cordova/build: Command failed with exit code 65
Any idea about what's going on?
EDIT: I solve this doing:
Remove ios folder from platforms.
Run again (phonegap run ios).
Install ios-sim with command sudo npm install -g ios-sim.
All worked fine!
A lot of thanks.
Best regards.
Manually create target with name NombreApp in Xcode as given this link :
->
How to create or define a new target in a custom Xcode project template
Regards,
I am using Phonegap CLI 3.1 and XCode5. I want to generate the release build for iPhone Application through command line, I have valid distribution certificate and mobile provisioning profile. I want to generate the release build totally through command and don't want to use XCode GUI or Phonegap Build. I have tried too much with xcodebuild, xcrun and even corodva build command but none of them provide me the release build file (either in .app format or .ipa).
Method 1 (Use xcodebuild)
a) xcodebuild -project MyApp.xcodeproj -alltargets -sdk iphoneos7.0 PROVISIONING_PROFILE="PROFILE_UUID.mobileprovision" -configuration Release
** BUILD FAILED **
The following build commands failed:
CompileC build/MyApp.build/Release-iphoneos/MyApp.build/Objects-normal/armv7/AppDelegate.o MyApp/Classes/AppDelegate.m normal armv7 objective-c com.apple.compilers.llvm.clang.1_0.compiler
CompileC build/MyApp.build/Release-iphoneos/MyApp.build/Objects-normal/armv7/MainViewController.o MyApp/Classes/MainViewController.m normal armv7 objective-c com.apple.compilers.llvm.clang.1_0.compiler
CompileC build/MyApp.build/Release-iphoneos/MyApp.build/Objects-normal/armv7s/AppDelegate.o MyApp/Classes/AppDelegate.m normal armv7s objective-c com.apple.compilers.llvm.clang.1_0.compiler
(3 failures)
Method 2 (Use corodova build and xcrun to sign the app)
a) cordova build ios -release
Compiling app on platform "ios" via command "/Users/Macuser/Desktop/MyApp/platforms/ios/cordova/build" --release Platform "ios" compiled successfully.
b) xcrun -sdk iphoneos PackageApplication -v "build/Release-iphoneos/MyApp.app" -o "build/Release-iphoneos/MyApp.ipa" --sign "iPhone Distribution: NAME (ID)" --embed "PROFILE_UUID.mobileprovision"
error: Failed to read entitlements from '/tmp/iyibGn3aUv/Payload/MyApp.app
The problem is that you do not have proper schemes. When phonegap project is generated it does not contain any schemes and thus linking to the phonegap files is incorrect.
Go to the phonegap generated project in console and put 'xcodebuild -list'
in the output you will get that there is no schemes in the project.
Open generated by phonegap project in the xcode - this will generate schemes.
Now you can build this using xcodebuild(Remember to fill up the proper scheme name):
xcodebuild -scheme YOURSCHEMENAME -project MyApp.xcodeproj -alltargets -sdk iphoneos7.0 PROVISIONING_PROFILE="PROFILE_UUID.mobileprovision" -configuration Release
For continous integration this is bad solution because you have to launch the xcode GUI to generate the schemes but I did not found any other solution for this problem. If someone know how to generate scheme using command line it would be nice of him to write it down.
First, you need to create your app in iTunes Connect (This is in the member center of your iOS developer account). If you've already created your profiles and certificates, then you can select the correct one in iTunes Connect. Here is where you name your app, set a price, write a description, and upload screen shots and a large icon. Make sure you fill in all information and upload all images for your app. You will know when you are done the status of your app changes to 'Waiting for Upload".
After you've created your app successfully in iTunes Connect, to generate an .IPA file for distribution (either for the AppStore or Ad-Hoc) in Xcode you need to select your Project in the file tree (at the top of the tree). Then make sure your 'Targets' is selected to the right.
Choose 'Build Settings". Then go to the section where is says Code Signing. For 'Release', make sure that the correct iPhone Distribution identity or profile is selected.
Below 'Release' it should say 'Any iOS SDK'. Make sure that it says 'IOS Distribution' next to it.
If you have the correct certificates and profiles in the keychain, you can now in the menu at the top choose Product > Archive.
If it doesn't build, then press the run button to build your project. Xcode should say that it is archiving.
After it archive's successfully, go to the Organizer. In the menu at the top choose Window > Organizer. Now click Archives.
If your project successfully archived you will see it here. First you need to Validate your project with iTunes Connect. You will need to enter your iOS Developer login info. Xcode 5 does a pretty good job of detecting the correct profiles so you should see it in there.
If your app validates then you can then distribute either to the App Store or as an Ad-Hoc distribution. Depending on which profile you have.
This is the process for distributing apps either Native or Phonegap. It doesn't matter, I've built both.
I would suggest doing it this way, in case your app doesn't validate. Xcode will then tell you what you need to do to fix. Then once you fix everything. Create a new archive and try until it validates.