Bug 8315 - Error: Failed to strip the final binary. Please review the build log. (MT5204)
Summary: Error: Failed to strip the final binary. Please review the build log. (MT5204)
Alias: None
Product: iOS
Classification: Xamarin
Component: Tools ()
Version: 6.0.x
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
Depends on:
Reported: 2012-11-09 12:02 UTC by Dan
Modified: 2013-01-09 23:59 UTC (History)
3 users (show)

Is this bug a regression?: ---
Last known good build:

iphone adhoc build - Giving Build error cannot strip binary (16.89 KB, text/plain)
2013-01-09 05:52 UTC, sridhar.sundaram

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description Dan 2012-11-09 12:02:33 UTC
I am able to compile, build, and run on the iOS Simulator (iOS 6.0.1) and everything is working fine, but I am not able to do a Release|iPhone build without getting the MT5204 error.

I am using the following iPhone Build settings:
- SDK version: 6.0
- Linker behavior: Link SDK assemblies only
- Enable debugging: unchecked
- Supported architectures: ARMv7
- Use LLVM optimizing compiler: unchecked
- Use SGen generational garbage collector: unchecked
- Additional mtouch arguments: -aot="nimt-trampolines=2048" -gcc_flags "-L${ProjectDir}/Libs/iOS/Device -force_load ${ProjectDir}/Libs/iOS/Device/libRSQLite.a"
Comment 1 Sebastien Pouliot 2012-11-09 12:52:54 UTC
Simulator builds will be fine because stripping (both managed and native) only occurs on device release builds.

Stripping errors are uncommon and generally occurs because something else went wrong earlier in the build (like the error message said "Please review the build log.").

Could you:

* Add "-v -v -v" to your project options, in the "Additional mtouch arguments". That will augment the log verbosity so we'll have more clues about what happended in the build process;

* Clean and re-build your project

* Attach the build log (copy/paste from MonoDevelop's Build Log, inside the Error List pad) to this bug report (you can mark the attachment as private).

We'll review this asap. Thanks!
Comment 2 Dan 2012-11-12 10:32:06 UTC
Hi Sebastien,

I tried to capture the build log, but the Error List pad only contains information about the MT5204 error.  I also tried adding "-v -v -v" to the additional mtouch arguments, but it does not seem to add anything to the output.  My last attempt was to "Enable debugging" for Release|iPhone and now the project builds successfully, but the IPA file is doubled in size just as the comment says.  If I unmark the "Enable debugging" and then build again I am back to getting the MT5204 error.
Comment 3 Sebastien Pouliot 2012-11-12 10:36:36 UTC
There's a "Build Output" button in the "Error List" pad (just after the Error, Warning, Message filter buttons). If you click on it it will show you the whole build log (not just the list of warning and errors). This is what we need to diagnose the issue.

Enabling debugging disable stripping (along with adding debug information) which makes the .app a lot larger.
Comment 4 Dan 2012-11-12 10:40:40 UTC
I see that button and it does nothing.  All it does is shows/hides a scroll bar in the Error List window, but there is nothing there.  I scroll all the way to the bottom, but it is empty.

One more question, what does the "-nosymbolstrip" mtouch command do?  That seems to get me past this compile issue, but I would like to fully understand what that option does, and if I should be using it.
Comment 5 Sebastien Pouliot 2012-11-12 10:45:33 UTC
Once it's visible (the build text box) just clean and re-build your project (the log text box is cleared between operations). Once it's re-built (up to your error) then all the logs should then be inside this textbox (and ready to copy-paste).

Adding -nosymbolstrip won't do the "native" stripping, which is the step that gives you an error. However it's likely the "real" error occured before this - so turning the stripping off might just hide (not fix) the issue.
Comment 7 Dan 2012-11-12 12:02:58 UTC
Ok, the build output panel has a vertical split bar slim icon that was dragged all the way over to the right.  After noticing the tiny slim bar, I was able to drag it to the left and see the output.  Very frustrating.

Please find the Build Output attached...
Comment 8 Sebastien Pouliot 2012-11-12 12:42:36 UTC
I cannot see libRSQLite.a anywhere in your log. I think it's the reason for your error since the log shows a bunch of sqlite symbols could not be found (likely because they're not linked).

Is it possible your settings for Releases are incomplete / different from Debug ?
Comment 11 Dan 2012-11-13 10:20:58 UTC

I have contacted our tool provider (Resco) and they have provided me with an updated libRSQLite.a library that targets ARMv7.

Thank you for the help.  You can close this case.

Comment 12 Sebastien Pouliot 2012-11-13 10:29:49 UTC
wrong arch
Comment 13 Dan 2012-11-13 10:39:05 UTC
I'm not sure what you mean.  Doesn't iOS6 require you to target ARMv7?
Comment 14 sridhar.sundaram 2013-01-09 05:52:49 UTC
Created attachment 3182 [details]
iphone adhoc build - Giving Build error cannot strip binary

iphone adhoc build - Gives a build error -cannot strip binary
error MT5204: Failed to strip the final binary. Please review the build log.

Relevant log portion (I think) is - 
/Applications/Xcode.app/Contents/Developer/usr/bin/strip -s "/var/folders/kq/98n0mp7s561gxcbnc4s7883h0000gn/T/tmp1411b3c2.tmp/symbol-file" "/Users/sridhar/Documents/workspace/scienceengine/ScienceEngine-ios/scienceengine-ios/bin/iPhone/Ad-Hoc/scienceengineios.app/scienceengineios"
Process exited with code 1, command:
/Applications/Xcode.app/Contents/Developer/usr/bin/strip -s "/var/folders/kq/98n0mp7s561gxcbnc4s7883h0000gn/T/tmp1411b3c2.tmp/symbol-file" "/Users/sridhar/Documents/workspace/scienceengine/ScienceEngine-ios/scienceengine-ios/bin/iPhone/Ad-Hoc/scienceengineios.app/scienceengineios"
/Applications/Xcode.app/Contents/Developer/usr/bin/strip: symbols names listed in: /var/folders/kq/98n0mp7s561gxcbnc4s7883h0000gn/T/tmp1411b3c2.tmp/symbol-file not in: /Users/sridhar/Documents/workspace/scienceengine/ScienceEngine-ios/scienceengine-ios/bin/iPhone/Ad-Hoc/scienceengineios.app/scienceengineios
Comment 15 sridhar.sundaram 2013-01-09 23:59:09 UTC
solved - was missing MTouchExtraArgs.