I am getting an error after upgrading to xcode 4, for all of the library projects that my application depends on.
[BEROR]No architectures to compile for (ONLY_ACTIVE_ARCH=YES, active arch=i386, VALID_ARCHS=armv6).
It looks like all you have to do is add i386 to the Valid Architectures in the build settings. I was compiling for the simulator, and that's why it was complaining.
This seems odd, because the project worked just fine before upgrade. It looks to me like you have to do this for any project you upgrade. At least that will work for now.
See https://devforums.apple.com/message/376732#376732
"No architectures to compile for" means "Valid Architectures" field is empty. Update it to $(ARCHS_STANDARD_32_BIT) and you'll see the usual armv6 armv7. This happens sometimes in XCode 4 GM after updating "Base SDK" to "Latest SDK".
Open project.pbxproj (show package content of xcodeproj file), remove all lines with VALID_ARCHS = "...";, and restart Xcode.
Very strange. I encountered the same error and both the Debug and Release "Valid Architectures" were set to armv6 and armv7. (The same code compiles fine in Xcode 3.2.) I ended up deleting both settings, then expressly setting them to $(ARCHS_STANDARD_32_BIT) ... which in turn translates to armv6 and armv7 again ... and it compiles just fine now. No i386 needed. Hmm ...
If this error occures in combination with Phonegap the solution is:
Add "i386" in the build settings to the "Valid Architectures": for your project and the library (PhoneGapLib.xcodeProj). In both cases for the project and the target.
I was getting this error when I was trying to convert to automatic reference counting in the latest Xcode. I fixed it by adding "x86_64" to the valid architecture list, which allowed me to continue building.
Just in case someone else was having the same issue, thought I'd throw in what worked for me!
Had similar issues with xcode6 it seems to pop when upgrading xcode, tried all of what is suggested with no success what worked for me was in the new xcode created a simple new app(tabbed) and made sure my App had the same settings for architectures
Open a new project and compile in Xcode 4 and then compare build settings with converted project. That's how I found it.
Related
I made a simple blank project and added Bugsee via swift-package-manager.
Its located on https://github.com/bugsee/spm.
I can successfully build project for iOS Device.
But it fails for Simulator. And the error is not really verbose
(the path is shortened):
Cannot open file handle for file at path: Path(str: ".../Bugsee.xcframework/ios-arm64_i386_x86_64-simulator/Bugsee.framework")
What does it mean?
The path is valid and the framework is there:
I also found that build for simulator is OK after I have added Bugsee.xcframework into Frameworks, Libraries, and Embedded Content.
Does anyone know what's wrong?
It looks like SPM in Xcode have an issue with i386 arch.
Bugsee released 1.28.0 with dropped support for i386 arch. And now Xcode starts building fine for simulator.
I think i should create a ticket in SPM tracker.
I recently updated my Xcode to Xcode 7.0.1. My project used to compile and build for ios without issues on Xcode 6.4. Now, I'm having this error:
Cordova/CDVViewController.h file not found in the line -
#import <Cordova/CDVViewController.h>
Please let me know how to fix this.
P.S. "archiving" doesn't produce errors
I found the answer here: http://forum.ionicframework.com/t/cordova-cdvviewcontroller-h-file-not-found-in-xcode-7-1-beta/32232/5
From the author shazron
Add this line to your Build Settings -> Header Search Paths:
"$(OBJROOT)/UninstalledProducts/$(PLATFORM_NAME)/include"
Don't replace the existing line that looks similar, that is still needed to be backwards compatible with Xcode 7 and Xcode 6.4.
This probably had something to do with tvOS, I reckon -- Apple had to separate the archive intermediates by platform for universal builds.
A friend updated Cocoapods in our project. When I pulled the latest stuff from git I got the following error:
Pods was rejected as an implicit dependency for 'libPods.a' because its architectures 'x86_64' didn't contain all required architectures 'i386'
This results in
ld: library not found for -lPods-___PODLIBRARY____
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I have searched around for hours now trying to find it. The most common fixes I've tried are..
Deleted derived data
Delete build data
Delete pods, and reinstalled with 'pod install'
Clean project
All of the above at the same time
Experimented with 'Build Active Architecture Only', both in our project and in Pod Project. Inserted armv7 and armv7s as hard code instead of $ variable
Experimented with 'Architectures', both in our project and in Pod Project. Inserted armv7 and armv7s as hard code instead of $ variable
We are aiming for iOS 8, iPhones.
My friend got it to work by combining the first 4 options, but I cannot.
Does anyone have any suggestions? We're supposed to release before christmas so production time is precious :D
Try to set Build Active Architecture Only to NO for 'Pods' project and your app's target
For me, what worked was to change the CocoaPod project "Base SDK" to "Latest iOS".
Try to run the project first on an iPhone 4s in simulator and after that it should work.
What fixed this problem for me was precisely the opposite of the most voted answer:
"Build Active Architecture Only" set to "YES"
both in main target and Pods target + Debug and Release
In my case, it was because I had the "Build Active Architecture Only" parameter set to Yes for Debug mode. Changing it no No fixed it.
Also make sure that your podfile targets the same iOS version your project targets:
For example, if you're targeting iOS 10.0 in your Xcode project your podfile should include platform :ios, '10.0' at the top, too.
Per this solution, which was the problem in my case.
When building my project in the new XCode5, I receive the following warning: Pods-App was rejected as an implicit dependency for 'libPods-App.a' because its architectures 'i386' didn't contain all required architectures 'x86_64'.
To fix that, select the Pods project in the left menu, then under the targets section select the Pods-#YourAppName# target and in the build settings click on the Architectures and press delete so it goes to the default option (Standard architectures (armv7, armv7s). More information can be found in this link.
Non of the other answers worked for me.
What eventually solved it for me is to make sure Build Active Architecture Only is set to Yes for Debug and No for Release in my app's xcodeproj file.
Also, because I have custom configurations, I had to add the following to the Podfile:
xcodeproj 'MyApp.xcodeproj', 'MyDebugConfiguration' => :debug, 'MyReleaseConfiguration' => :release
Take a look at the blog post here, it will do the work.
To make your Applications compatible for iPhone 5s and older models (till iPhone 3Gs running iOS6), select the following option for your architectures – “Standard Architectures – armv7, armv7s”. Do not select the option that says “Standard Architectures (including 64 bit)…”. Since the Arm instruction sets are backward compatible, any application compiled for armv7s will also run on the iPhone 5s or the iPhone 5c.
ARCHS = armv7 armv7s
For valid architectures in the build settings, you can specify arm64,
armv7, armv7s.
VALID_ARCHS = armv6 armv7 armv7s arm64
env:
CocoaPods v0.24.0
Xcode 5 from App Store
Add the following at the end of your Podfile.
post_install do |installer|
installer.project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['ARCHS'] = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"
end
end
end
Go to Project "pods", set "build active architecture only" to NO for debug.
Above solution is working for me.
I have just upgraded one of my projects to Xcode 6 and experienced this problem. To fix it, I changed the Base SDK of the Pods project to a real one (previously it was like unknown SDK).
I had this same issue. The warning suggested that the pod library was not included and as a result, the app failed to finish compiling. (It complained about a missing header file that was part of a Pod dependency).
If you are experiencing the same compilation issue, you might be able to resolve it with the following:
Select Pods project in the workspace
Select Pods project to
access Pods project-wide settings
Go to Build Settings
Search
for 'Build Active Architecture Only'
Set to 'NO'
This seemed to work for me, but YMMV.
clang: error: no such file or directory: '/Users/admin/Library/Developer/Xcode/DerivedData/__TESTING__-fzbkvdbnndieeagphtjhdndiyttl/Build/Products/Debug-iphoneos/libCordova.a'
How do I get this a missing libCordova.a ?
(source: kerrydeaf.com)
UPDATE: For Simon Germain.
UPDATE: For Simon Germain. I don't see "Identity and Type". I can see "Identity". I'm using xcode 4.5
(source: kerrydeaf.com)
UPDATE: For Simon Germain. I got the Identity.
(source: kerrydeaf.com)
UPDATE: For Samuel
(source: kerrydeaf.com)
UPDATE: For Simon Germain - Architecture.
UPDATE: For james0n - armv.
(source: kerrydeaf.com)
UPDATE: For Simon Germain - Architecture.
UPDATE: For james0n - armv.
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_CDVURLProtocol", referenced from:
objc-class-ref in AppDelegate.o
"_OBJC_CLASS_$_CDVViewController", referenced from:
_OBJC_CLASS_$_MainViewController in MainViewController.o
"_OBJC_METACLASS_$_CDVViewController", referenced from:
_OBJC_METACLASS_$_MainViewController in MainViewController.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
UPDATE: For james0n - Valid Architecture.
(source: kerrydeaf.com)
UPDATE: It is now solved!!! make sure all armv7 and armv7s for ios 6 on all in xcode. It worked.
For your project, set the build setting "Build Active Architecture Only" to yes.
(Maybe also set the the Architectures build setting to "Standard (armv7, armv7s)" for CordovaLib project.)
Had (as many others) the same problem, here's what I did:
Redid the Getting Started guide from Phonegap (including downloading
and extracting the source again)
Same problem with the HelloWorld app
product - clean
Changed both the 'HelloWorld' and 'CordovaLib'-project (so not the Targets) according to james0n's answer, settings:
Architectures: Standard (armv7, armv7s)
Build Active Architecture only: Yes
and then it magically worked, I think steps 3 and 4 did it however.
Only need to remove armv6 from both YourProject and CordovaLib:
The consequences of doing this? Apparently, it's still working on iPhone 3GS, but not the previous versions..
I had the same problem as you, worked fine deployed to the simulators but not to a device. Neither of the suggested answers worked for me.
Here's what did work for me:
Set deployment target to v4.3 and on the project settings for the CordovaLib project, set the Build Active Architecture Only to Yes. (Not needed on your main project).
Important, do a Product-> Clean and rebuild.
Make sure that the CordovaLib's product's target is set to "Relative to Built Product" on the right hand-side panel, first tab on theleft, under "Identity and Type".
Download the Cordova installer from here http://phonegap.com/download. Make sure it is the same version that you are currently using (ex 2.0).
Then mount the dmg found in the ios directory.
Then run the .pkg installer.
Restart Xcode.
You gotta run the update script, I know it might be a pain in the butt to do it, but that's what it takes.
Download and open the Phonegap 2.1 package from the official site. Open a terminal window, and cd to the installation directory
You'll need to first create a new project:
./create [project_folder_path] [package_name] [project_name]
Then you need to set the path to your libraries.
/update_cordova_subproject [xcodeproj file]
Now open up your project and set the deployment target to 4.3 and you should be ready to go. Hope that helps
EDIT:
This is how my configuration looks like for CordovaLib Project
Also - make sure you don't have more than one PhoneGap Xcode project open at a time - I was getting conflicts between the two. "Workspace already open in another workspace" type of loop.
After spending many hours with even more errors, here's what worked for me. Basically combining much of the above:
Start with a fresh copy of Cordova. If you've been messing with it like me, it's not fresh anymore.
Move the Cordova files out of the download directory (I tend to clean that directory now and then...)
Create a new project as described in the Phonegap docs, i.e. drag the ios/bin folder to the Terminal icon and run the create script in Terminal. No need to run the update_cordova_subproject script.
Open the project in XCode.
For your product, set the iOS Deployment Target to 4.3 (I did it 2x, both in Project and Target Build Settings).
For CordovaLib.xcodeproj, set Build for Active Architecture to Yes in the Project Build Settings.
Clean and run.
Do not include armv7s in any of the architecture lists, as it will not build for device.
Tested in simulator and on an iPad with iOS 6. Using Phonegap 2.1.0 and XCode 4.5.1.
Update: if you want to support iPhone 5, you will need armv7s. It requires the fix in https://issues.apache.org/jira/browse/CB-1360 , which will be in Cordova 2.2.0. (Haven't tried it yet, working on an iPad project.)
I fixed this by removing the armv6 and i386 architecture from Valid Architecture setting
I had this problem too. I think it was because I had previously installed an old version of phone gap that installed some stuff in xcode. I uninstalled, then reinstalled xcode. Then I ran the Uninstall Cordova.applescript that came with phone gap. This fixed the problem of the red libCordova.a
In addition to several other suggestions & post, I found that I was experiencing this problem on my AdHoc builds only. Please note that I figured this out during debugging because if I set the Edit Scheme > Archive build configuration to "release" it would work OK, but if set to AdHoc it would give me a link error, telling me that this file could not be found:
/Users/jason/Library/Developer/Xcode/DerivedData/MommyNearest-ceourmykvgxdekbkmzenuvhcfnzk/Build/Intermediates/ArchiveIntermediates/MommyNearest/BuildProductsPath/Adhoc-iphoneos/libCordova.a
This was actually a good clue to what the problem was, which was that somehow the CordovaLib subproject did not have an AdHoc configuration (it had ONLY "Debug" and "Release" configurations).
Therefore, when building for an AdHoc release (to use with Testflight) it would not create a symlink for this file correctly. Once I added an "AdHoc" configuration to the CordovaLib subproject, this started working.