26005

Android Source code build problem

Question:

I've been going through the steps to build the Android Source code. After getting everything set up according to the instructions, I executed "make". The make process chugged along until the link where it ultimately failed with the following error:

Undefined symbols for architecture x86_64: "_main", referenced from: start in crt1.10.6.o ld: symbol(s) not found for architecture x86_64 collect2: ld returned 1 exit status

The other thing of note is that the link is generating a number of warning similar to this:

<blockquote>

ld: warning: ignoring file out/host/darwin-x86/obj/EXECUTABLES/emulator_intermediates/android/hw-kmsg.o, file was built for i386 which is not the architecture being linked (x86_64)

</blockquote>

Can anyone help me with the solution to this?

Thanks, Craig

Answer1:

Thanks dljava. Yes, Xcode 4.x is a problem, but not the only problem that I've found. I'm sorry I didn't come back and post some of my findings earlier. I've been locked down on something else.

Officially, the Android source build is only supported on Leopard, not Snow Leopard. Googling around you can find a number of posts about this and how people have gotten around it. The solution typically involved changing various makefiles and other settings. The one thing about those solutions are that many have become stale and no longer work. Some authors have updated their instructions, while others have not.

Additionally, the latest Xcode proved problematic as well. In general, my attempts to get the Android source built on my iOS dev machine with Snow Leopard and the latest XCode was like a never-ending frustrating game of whack-a-mole.

My solution was simply to use a Mac mini that wasn't being used at the moment as an Android source dev box. I did a clean install of Leopard on it. I installed the last version of the iPhone SDK + XCode that supported Leopard. I think that was for iOS 3.1.3. Then after following the instructions on the Android dev site for building the source, I was successful.

So I would suggest either what I did with a separate box, or if you are able to create a bootable partition on your box and install Leopard on it. That seems to be the way to do it with the least brain damage.

Good luck,

Craig

Answer2:

Upgrading to Xcode 4.x is the cause, try uninstalling and reinstalling 3.x

Answer3:

I have had better luck in compiling and extending CyanogenMod instead of using AOSP directly, and I'm building on Snow Leopard. There are <a href="http://wiki.cyanogenmod.com/index.php?title=Building_from_source" rel="nofollow">instructions</a> for a number of supported devices. Furthermore, Cyanogen seems to be following AOSP pretty closely, e.g. with the recent 2.3.4 support.

If you are building on the Mac for a device that is not officially supported by CyanogenMod, the <a href="http://wiki.cyanogenmod.com/index.php?title=Template%3aBuild_from_source_%28Mac%29" rel="nofollow">Mac template</a> is a good place to start.

Personally, I'm using homebrew rather than MacPorts, but that is a minor detail.

--Pekka Nikander

Answer4:

I can definitely second dljava. It <em>is</em> XCode 4.2 what causes the probs. I made exactly the same steps on an iMac SnowLeopard 10.6.8, running XCode 3.2.6 and everything was fine...after having days of trouble on my MacBook with XCode 4.2

Recommend

  • How to get a list of EntityObject's from an EF model
  • In PostgreSQL how do you join two tables whilst operating another function such as count
  • C++ : Association, Aggregation and Composition
  • Backport of RTTI.TRttiIndexedProperty to Delphi XE
  • Warning: require(…): failed to open stream: No such file or directory in
  • How to redirect search page liferay 6.2?
  • Visual studio feature - commenting code Ctrl K - Ctrl C
  • How to list all the bucket types in riak?
  • How to modify search result page given by Solr?
  • Timeout on a php Peg Puzzle solver
  • How to remote debug with Delve debugger in Visual Studio Code
  • How to connect localhost:3306 of mysql container via app container- docker
  • How To Delete All Words After X Characters
  • What's the essential difference between these two variadic functions?
  • Removing event listeners on automatically created multiple elements
  • Why does IE8 fail to resolve my JQuery selector for a checked radio option?
  • Rails AREL .where statement
  • include dlls in visual studio c++ 2008
  • Cross platform UI spacing/padding
  • Does Apportable support to build library binary (.a/.so)?
  • What is the purpose of TaskExecutor in spring?
  • MySQL Order by column = x, column asc?
  • Database structure design with variable amounts of fields
  • Highlight one bar in a series in highcharts?
  • swift auto completion not working in Xcode6-Beta
  • Excel - Autoshape get it's name from cell (value)
  • Check if a string to interpolate provides expected placeholders
  • Join two tables and save into third-sql
  • How to model a transition system with SPIN
  • ORA-29908: missing primary invocation for ancillary operator
  • XCode can't find symbols for a specific iOS library/framework project
  • RestKit - RKRequestDelegate does not exist
  • Traverse Array and Display in markup
  • Free memory of cv::Mat loaded using FileStorage API
  • -fvisibility=hidden not passed by compiler for Debug builds
  • Memory offsets in inline assembly
  • Turn off referential integrity in Derby? is it possible?
  • XCode 8, some methods disappeared ? ex: layoutAttributesClass() -> AnyClass
  • Converting MP3 duration time
  • jQuery Masonry / Isotope and fluid images: Momentary overlap on window resize