'No rule to process file … for architecture i386' when building with Xcode bot
Asked Answered
P

4

8

I set up continuous integration for my iOS XCode project, but I keep getting lots of warnings when the Xcode bot builds my project. When I build (for running, testing or archiving), I get no warnings.

I think this has something to do with my project setup. I have an 'inner' project in my main project, containing a library that I need. I'm building both projects for the i386 architecture so it can be run in the simulator (so the Xcode bot can run tests).

The exact warning is below. I get this warning for every .m file in my inner project.

Warning: no rule to process file '[…]/CDICMessage.m' of type sourcecode.c.objc for architecture i386

Most Google results on this warning are for .h files that are added to 'compile sources' by mistake, but my .m files should be in there, obviously.

Again, this warning only shows up on the Xcode server, local builds are fine. The build is ok otherwise, the tests succeed and an archive is built. The biggest problem is that the heap of warnings would drown out any other warnings the project might spawn.

Preface answered 2/7, 2014 at 12:2 Comment(2)
I have the same problem. I have absolutely no idea why this suddenly appeared. Removing i386 arch obviously dismisses the warning.Easement
currently having this issue. have you found a solution?Photographic
S
3

I was having this issue too, but under slightly different circumstances. With the inclusion of native Cocoa Touch Frameworks in iOS 8 I wanted to dump the use of an old, albeit, awesome hack to create iOS frameworks. In so doing, I started getting this exact same warning ... TONS of them! I resolved them by removing i386 and x86_64 from "Valid Architectures" in the Target's Build Settings.

I had added both of these architectures in the "Architectures" section AND in the "Valid Architectures" Build Setting, as I wanted to ensure that these architectures where both available to me when I ran lipo to create a universal (yup, Apple still isn't giving us a way to do this near as I can tell)

By REMOVING the i386 and x86_64 architectures from "Architectures" AND from "Valid Architectures". AND setting "Build Active Architecture Only" to "NO" for BOTH Debug AND Release. I was able to get the desired results without the loads of "No rule to process..." warnings that I was getting on my .m files.

Hope this helps!

Sextain answered 4/11, 2014 at 15:10 Comment(2)
heh.... you are removing x86_64/i386 support from your binary :D and you're happy with that?Coronagraph
No. I wouldn't say we were "happy." It wasn't an ideal solution. But the process that included these steps worked quite well for us.Sextain
B
2

I am having a similar problem, though in my case it's with several .c files (and a single .m file). warning: no rule to process file '[...]/ioapi.c' of type sourcecode.c.c for architecture x86_64

Now, obviously, I do need the .c files and the .m file to be compiled.

Clearly this isn't limited to .m files. If anyone has ideas for diagnostics to figure out more of the problem I would be happy to carry them out.

Beefburger answered 6/2, 2015 at 0:19 Comment(0)
B
2

I can't guarantee this will solve your version of this problem. But I finally got mine working.

The guy who said to remove i386 and x86_64 has part of the answer.

In my target, I set the architectures section as follows

Architectures <multiple values>
Debug
    Standard Architectures <$(ARCHS_STANDARD)>
        Any iOS Simulator SDK <i386 x86_64>
        Any iOS SDK <$(ARCHS_STANDARD)>
Release
    Standard Architectures <$(ARCHS_STANDARD)>
        Any iOS Simulator SDK <i386 x86_64>
        Any iOS SDK <$(ARCHS_STANDARD)>
Base SDK <Latest iOS>
Build active Architecture only <No>
Supported Platforms <iOS>
Valid Architectures <armv7 arm64 i386 x86_64>

I then created annother Target. This one an aggregate (File->new->Target->iOS->Other->Aggregate) I made no changes to the Build settings for this target, left them all default. In the Build Phases section, I dragged my preexisting target into the "Target Dependencies" section.

In the Run Script section I placed the following.

# define output folder environment variable
UNIVERSAL_OUTPUTFOLDER=${BUILD_DIR}/${CONFIGURATION}-universal

# Step 1. Build Device and Simulator versions
xcodebuild -target MiniZip ONLY_ACTIVE_ARCH=NO -configuration ${CONFIGURATION} -sdk iphoneos  BUILD_DIR="${BUILD_DIR}" BUILD_ROOT="${BUILD_ROOT}"
xcodebuild -target MiniZip ONLY_ACTIVE_ARCH=NO -configuration ${CONFIGURATION} -sdk iphonesimulator BUILD_DIR="${BUILD_DIR}" BUILD_ROOT="${BUILD_ROOT}"

# make sure the output directory exists
mkdir -p "${UNIVERSAL_OUTPUTFOLDER}"

# Step 2. Create universal binary file using lipo  "${BUILD_DIR}/${CONFIGURATION}-iphonesimulator/lib${PROJECT_NAME}.a"
lipo -create -output "${UNIVERSAL_OUTPUTFOLDER}/lib${PROJECT_NAME}.a" "${BUILD_DIR}/${CONFIGURATION}-iphoneos/lib${PROJECT_NAME}.a" "${BUILD_DIR}/${CONFIGURATION}-iphonesimulator/lib${PROJECT_NAME}.a"

# Last touch. copy the header files. Just for convenience
cp -R "${BUILD_DIR}/${CONFIGURATION}-iphoneos/include" "${UNIVERSAL_OUTPUTFOLDER}/"

I was trying to build the MiniZip library as a 4-way fat library, so where my script says "MiniZip", you will obviously put whatever the name of your target happens to be.

And my end result?

Admins-Mac-mini-2:scratch JoeC$ file libminizip.a
libminizip.a: Mach-O universal binary with 4 architectures
libminizip.a (for architecture armv7):  current ar archive random library
libminizip.a (for architecture i386):   current ar archive random library
libminizip.a (for architecture x86_64): current ar archive random library
libminizip.a (for architecture arm64):  current ar archive random library

Success! Well, for me anyway. I hope this solves your problem as well!

Edit: I should give much of the credit to Ray Wenderlich. My script is based on one he posted.

Beefburger answered 10/2, 2015 at 21:57 Comment(0)
M
0

the same problem

Unable to determine compiler to use - the abstract compiler specification is missing from this Xcode installation.

or

warning: no rule to process file '/Users/dfpo/Desktop/ImageCell.m' of type sourcecode.c.objc for architecture x86_64

try to open the project or workpalce by using "open the way",and then select your Xcode

Mulvaney answered 19/3, 2015 at 13:51 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.