Three20 and iOS 6 error compiling for armv7s architecture - three20

I've been trying to solve this problem for hours and have googled everything about it but am not finding any solutions.
I've just updated to Xcode 4.5 with SDK 6 and my project wich use Three20 lib is not compiling.
It tells me that some class is not found or valid for armv7s
I've tried many things, any ideas??
Thanks

The Library your using is probably not setup to support iOS6 armv7s architecture. Check Three20 Lib site for an updated version of the library that DOES support armv7s. Or remove that setting from your project Target Build Settings.
Remove armv7s from the Architectures list. Delete all of them and simply type back armv7.

Related

Xcode 12 build target in wrong order for simulator?

My project always runs correctly on all devices using Xcode 11, but after I installed Xcode 12 beta 4, it is failing to build on the simulator.
I compared the build logs of Xcode 11 and Xcode 12 and it seems in Xcode 12 that my main target is being built before the cocoa pods target, and so the link will fail because the cocoapods library will not be found.
How to fix the order of the build target?
In Xcode 11, everything is fine. My own target is built after the cocoapods target .
In Xcode 12, the build is out of order My own target is built before the cocoapods target .
OK, i got a solution to make the build work (this way to fix problem is not correct , the right way to fix is added in my update):
1 you need to add the Pods project to your main project as a external project
2 add all the cocodpods target as dependency explicitly in your main project 's build phase
But i still think may be the new beta version of xcode 12 will fix this. because it seem a bug of xcode 12 (my project work perfect in xcode 11 and xcode 12 + ios device , failed in xcode 12 + simulator only)
###2020-08-17 update###
i found a more exactly reason to reproduce this problem , it seems my project file open in xcode 12 will auto generate a VALID_ARCHS macro in User-Defines , and this macro will make the build failed
And i found that ,with this macro , During in the LINK of building,the link target type will be a unknown type
'arm64-apple-ios11.0-simulator'
which cause the build faild and the problem that all the targets build in wrong order seems will only happen when this macro is being added
XcodeDefault.xctoolchain/usr/bin/clang -target arm64-apple-ios11.0-simulator
after i delete this VALID_ARCHS macro, the link target type will be 'x86_64-apple-ios11.0-simulator' , and everything goes well
XcodeDefault.xctoolchain/usr/bin/clang -target x86_64-apple-ios11.0-simulator
####2020-09-11 add Add Apple's Feedback about this macro####
update Apple's Feedback on VALID_ARCHS
After reviewing your feedback, we have some additional information
for you:
Xcode does not add VALID_ARCHS to your project. Indeed, we recommend
against using VALID_ARCHS. Maybe some CocoaPod is setting it in your
project for some reason? CocoaPods are not part of Xcode so, we don’t
have any control over what they do.
One thing to note is that in Xcode 11 VALID_ARCHS showed up under the
architectures section. Since we are strongly recommending against
using it, it no longer shows up there and now appears in the User
Defined section if it is defined at all.
Xcode 11 used to automatically translate building for arm64 for the
simulator into building for x86_64, but now that arm64 is a valid
simulator architecture (it’s the Apple Silicon architecture), that
translation no longer occurs.
So, we suspect what you should do is delete VALID_ARCHS from your
project altogether, and make sure Architectures (ARCHS) is set to
Standard Architectures (ARCHS_STANDARD) and not to something specific
(unless you really know exactly why you’re not using ARCHS_STANDARD).
####Feedback end####
####2020-10-10 added####
the build may still not working after deleting the VALID_ARCHS macro for some guys , you may check the answer of Apple's feedback added and #Andrei Herford's answer below:
make sure Architectures (ARCHS) is set to Standard Architectures
(ARCHS_STANDARD)
and then delete the macro ,hope these two steps works for all:)
####2020-10-10 added end####
I was able to solve the problem both in simulator and on device by using $(ARCHS_STANDARD) not only for ARCHS in the Architecture settings but also in VALID_ARCHS as well. I am not sure what possible side effect changing the archs in this way might have but so far I have not experiencend any new problems.
Details:
The excellent answer by #ximmyxiao got me on the right track. However, the solution proposend by him (remove VALID_ARCHS) did not work for me. This led to a new problem when compiling the Pod targets (Command PhaseScriptExecution failed with a nonzero exit code and ARCHS[#]: unbound variable in Pods script).
Instead replacing arm64 with x86_64in VALID_ARCHS solved the problem when building for simulator. It seems that arm64 was never a correct platform and was translated to x86 by Xcode. As Apple has announced their shift to ARM processors, this translation is not correct anymore and thus one has to use the the correct platform x86_64 instead.
Regarding to Apple VALID_ARCHS should not be used any more. However, this fix did not work when building for devices. Eventually using $(ARCHS_STANDARD) instead (both for simulator and device) did the trick in both cases.
Good look to others who encounter this kind of problems. Never gets boring working with Xcode....
** For XCode 12.4 **
I have Apple MB Pro with M1 and the project with Moya POD and lot of others.
App builds perfectly in old intel-based macbook with the same version of XCode (12.4).
But for M1 it won't compile says: "Moya not found". What??
It said: "Could not find module 'Moya' for target 'x86_64-apple-ios-simulator'; found: arm64, arm64-apple-ios-simulator".
No suggestions worked for me. So what helped me is:
(not sure whether this is necessary): reinstall all pods by pod install
clear build data
launch via Rosette (check this in XCode app properties cmd+i)
in App's Project:
"Architectures": add x86_64
"Build Active Architecture Only": YES
in "Pods" project, conflicting pod section (Moya in my case):
"Build Active Architecture Only": YES
Then rebuild. Probably next rebuild also required.
For Xcode Version 12.1
If you can't find VALID_ARCHS
Adding **$(ARCHS_STANDARD) x86_64 i386 all three in Architectures will solve the issue for running on simulators and Devices , archiving . also suggestedly add Build Active Architecture Only to 'Yes'.
Here's what worked for me.
Removed VALID_ARCHS from user defined settings
Set the ARCHS to $(ARCHS_STANDARD)
Created a new .xcconfig file for my project. (If you already have one, then you may skip this)
Added these to my .xcconfig file
EXCLUDED_ARCHS[sdk=iphoneos*] = x86_64
EXCLUDED_ARCHS[sdk=iphonesimulator*] = arm64
After that, I'm able to build both for simulator & device. The idea here is to exclude arm64 when building on simulators and x86_64 on devices.

Framework Search Paths - Mixing $(inherited) with $(PROJECT_DIR)

I have an iOS project in XCode 11.2 that requires a mix of Frameworks, some of which are available on Cocoapods and some are not. For the non-Cocoapod frameworks, I have the frameworks copied to the root of my project folder.
The trouble comes with getting XCode to be able to find both using the Framework Search Paths setting as shown here:
All of the entries following $(inherited) are actually the ones inherited from Cocoapods (these are not explicitly specified).
If I don't add the $(PROJECT_DIR) at the end then Cococapod frameworks are found fine, but my embedded non-Cocoapod frameworks get compiler errors that their header files are not found.
If I do add the $(PROJECT_DIR) at the end, then the Cocoapod frameworks are not found and I get a build error like:
ld: warning: directory not found for option '-F/Users/dyoung/Library/Developer/Xcode/DerivedData/MyApp-acdmyjbbrpbhlkfiyypetovwacrz/Build/Products/Debug-iphoneos/AWSAuthCore'
...
ld: framework not found AWSAuthCore
Why? How do I get XCode to find frameworks in both places?
Here's one way:
pod deintegrate
Open the .xcodeproj
Add the non-CocoaPods frameworks.
pod install
Open the .xcworkspace
The problem was that the CocoaPods Frameworks that I was trying to add were built only for iOS 11+, but my very old project had a deployment target of iOS 8.4.
Looking at error details in the Report Navigator as #paul-beusterien suggested was critical. I found this:
Ld /Users/dyoung/Library/Developer/Xcode/DerivedData/MyApp-acdmyjbbrpbhlkfiyypetovwacrz/Build/Intermediates.noindex/MyApp.build/Debug-iphoneos/MyApp.build/Objects-normal/armv7/Binary/MyApp normal armv7 (in target 'MyApp' from project 'MyApp')
The key thing there is the armv7 architecture. This architecture is only part of the build process if you have a deployment target of 10.x or earlier but not if you have 11.x or later. And if the frameworks you are including don't have armv7 architecture (e.g. if they are built for 11.0+), XCode gives very misleading error messages about the frameworks not being found. What really isn't found is that specific architecture inside the framework.
Bottom line: My problem had nothing to do with framework search paths. Removing $(PROJECT_DIR) from the framework search path only appeared to solve the problem by triggering a different compile-time problem to happen before it got to the linker problem.
The solution in this case is that I must change my deployment target to 11.0, then everything builds properly.

Xcode 7 bitcode_strip error

My Xcode 7 beta3 project includes some framework compiled by Xcode 6, these frameworks are imported to my project by Embeded Frameworks option in "Build Phase" tab. Because these frameworks does not support bitcode, so the "Enable Bitcode" option turned to NO, when compile the project, Bitcode_strip error occurred:
/Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/bitcode_strip
/Users/panzhansheng/Desktop/MusicFans_2.0.4_xcode7_autoplay/MusicFans/Frameworks/FLAC.framework/FLAC
-r -o /Users/panzhansheng/Library/Developer/Xcode/DerivedData/MusicFans-bxutvotiungdbwfsxloykffnqoqs/Build/Products/Debug-iphoneos/MusicFans.app/FLAC.framework/FLAC
/Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/bitcode_strip:
input file must be a linked Mach-O file not an archive:
/Users/panzhansheng/Desktop/MusicFans_2.0.4_xcode7_autoplay/MusicFans/Frameworks/FLAC.framework/FLAC
(for architecture i386) error: bitcode_strip
/Users/panzhansheng/Desktop/MusicFans_2.0.4_xcode7_autoplay/MusicFans/Frameworks/FLAC.framework/FLAC:
/Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/bitcode_strip
exited with 1
I found that the error happened when Xcode copy my frameworks to my App package and try to strip bitcode from the framework, but these frameworks were compiled by Xcode early version and did not include bitcode at all. How to fix this? Thanks!
As I found out, XCode uses bitcode-strip only when enviroment variable STRIP_BITCODE_FROM_COPIED_FILES is set to YES. It seems that it's set to YES by default when enable_bitcode is switched on.
Adding User-Defined Setting STRIP_BITCODE_FROM_COPIED_FILES=NO to your Target can help you, XCode will not use bitcode-strip, but your app which will use frameworks without bitcode section probably will not work. So it's better to recompile them also using STRIP_BITCODE_FROM_COPIED_FILES=NO if necessary.
Tested on XCode 7 beta 5
following up on M. Pogosskiy's answer, it took me awhile to track down where to put the STRIP_BITCODE_FROM_COPIED_FILES bit setting (not too familiar with these). for reference, here's an illustration:
It was due to low memory/ disk space available in Mac system. When I cleared it. It runs smooth without cleaning itself.

Unity build to xcode with gives error: Apple Mach-O Linker

I tried to google for the solution. I tried to delete the DerivedData folder but it still doesn't work... Why is this still happening? I am using Xcode version 6.2. Thanks.
Edit: Under the one error has 70 different errors saying various things. There is a warning saying
ld: warning: ignoring file /Users/Kevin Chen/Desktop/Parking Director/Libraries/libiPhone-lib.a, missing required architecture arm64 in file /Users/Mushrooms4Eva/Desktop/Parking Director/Libraries/libiPhone-lib.a (2 slices)
All of the following links and solutions did not work for me:
https://teamtreehouse.com/forum/apple-macho-linker-error-xcode-61
Apple Mach-O Linker Error when compiling for device
Sounds like your library libiPhone-lib.a is not compiled for arm64, but your project is set to be compiled for this architecture.
I think all the errors are triggered by this "warning" as the library is ignored, and therefore you may have a lot of missing references.
Your options:
Get a version of the lib compiled for arm64, or do it yourself, if you have the code
Remove arm64 architecture from your project (which I don't recommend, as you'll need to provide an 64bit build for the App Store, but that's another story)
How to make 64bit builds (available from Unity 4.6.2+)
iOS platform
Other Settings
Scripting Backend => IL2CPP
Architecture => Universal (to target both 32 and 64 bit)
How to build for simulator
Player Settings
iOS platform
SDK Version => Simulator SDK

ld: library not found for (on Simulator only)

Suddenly began getting this error when running my app on iOS 7 Simulator.
ld: library not found for -lacmobileshim
clang: error: linker command failed with exit code 1 (use -v to see
invocation)
On Device this problem doesn't happen and the app runs OK.
Have already searched for this library inside SDK but couldn't find it. Have no idea what's going on cause it was running OK both on Simulator and Devices before and haven't added any additional library to my project.
Is there a way to set Library Search Path in Build Settings just for this library?
Should reinstall SDK be a workaround?
These are the libraries i'm including in my project:
After get the same headache as updated to Xcode 6/iOS 8 sdk, just found a simple way to solve this issue with libacmobileshim.dylib and also other dynamic libraries that were causing the same problem when building the app on simulator. Just delete the dynamic libraries from Build Phases settings and the app is running perfectly again on simulator. Hope it may help someone with the same problem.
libacmobileshim.dylib is in the iOS Device SDK, but it is not in the simulator SDK. External developers should have no need for this library, so I'm confused as to why you're linking against it.
Looking at that list of libraries that you're linking against, I suspect a bunch of them aren't even needed by your project. You should audit that list and eliminate unnecessary linkage.

Resources