ZxingWidget archive error on ios6.0 - zxing

I try to archive the ZxingWedget Demo,scanTest. compile is ok. it can run on the simulator.
but it can not archive completely on ios6.0.
this is the error:
Stripping /Users/ganguo/Library/Developer/Xcode/DerivedData/ScanTest-gadjcaxemklyqpcxsvmiorzakfhu/Build/Intermediates/ArchiveIntermediates/ScanTest/IntermediateBuildFilesPath/ZXingWidget.build/Release-iphoneos/ZXingWidget.build/Objects-normal/armv7/libZXingWidget.a
cd /Users/ganguo/objc/lib/zxing/iphone/ZXingWidget
setenv PATH "/Applications/app/Xcode45-DP4.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/app/Xcode45-DP4.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Applications/app/Xcode45-DP4.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/strip -S /Users/ganguo/Library/Developer/Xcode/DerivedData/ScanTest-gadjcaxemklyqpcxsvmiorzakfhu/Build/Intermediates/ArchiveIntermediates/ScanTest/IntermediateBuildFilesPath/ZXingWidget.build/Release-iphoneos/ZXingWidget.build/Objects-normal/armv7/libZXingWidget.a
0 0x10eaf75f0 __assert_rtn + 144
1 0x10eb5ed12 ld::tool::FunctionStartsAtom<arm>::encode() const + 594
2 0x10eb4d05b ld::tool::OutputFile::updateLINKEDITAddresses(ld::Internal&) + 251
3 0x10eb483b8 ld::tool::OutputFile::write(ld::Internal&) + 136
4 0x10eaf7c5f main + 1263
A linker snapshot was created at:
/tmp/strip.7jH8OR-2012-07-16-113649.ld-snapshot
ld: Assertion failed: (addr != badAddress), function encode, file /SourceCache/ld64/ld64-134.5/src/ld/LinkEdit.hpp, line 1289.
/Applications/app/Xcode45-DP4.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/strip: internal link edit command failed
Command /Applications/app/Xcode45-DP4.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/strip failed with exit code 1

I filed the bug (12176840) with Apple for this problem today.

Do a clean and try again. If it still fails, file a bug with Apple. This is an xcode/toolchain bug (in prerelease software).

I believe that the zxing library doesn't support the armv7 architecture yet. I would love to be wrong, though...

Related

iOS crash reports: atos not working as expected

I'm looking at a crash report provided by Apple
Hardware Model: iPhone4,1
Version: ??? (???)
Code Type: ARM (Native)
Parent Process: launchd [1]
Date/Time: 2012-11-18 16:03:44.951 -0600
OS Version: iOS 6.0.1 (10A523)
Report Version: 104
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x51fe5264
Crashed Thread: 0
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0 libobjc.A.dylib 0x352925b0 objc_msgSend + 16
1 MYAPP 0x0006573a -[MyViewController(Images) didReceiveImage:context:etag:expires:] + 42
2 MYAPP 0x0004fb26 -[MyImageTask didReceiveImage:] + 98
3 Foundation 0x361ac8e8 __NSThreadPerformPerform
4 CoreFoundation 0x3b37d680 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__
5 CoreFoundation 0x3b37cee4 __CFRunLoopDoSources0
6 CoreFoundation 0x3b37bcb2 __CFRunLoopRun
7 CoreFoundation 0x3b2eeeb8 CFRunLoopRunSpecific
8 CoreFoundation 0x3b2eed44 CFRunLoopRunInMode
9 GraphicsServices 0x396bc2e6 GSEventRunModal
10 UIKit 0x3452e2f4 UIApplicationMain
11 MYAPP 0x0004934a main + 70
12 MYAPP 0x000492fc start + 36
The funny thing is when I use atos to lookup the line of code that corresponds to address locations 0x0006573a and 0x0004fb26 I get completely different match. The atos output is not even from the same class that's mentioned in the crash log (MyViewController, MyImageTask). Instead atos points me to totally benign lines of code in a completely unrelated class. I verified again that I'm working with the exact dSYM and IPA that I submitted to Apple.
My atos command
/Applications/Xcode.app/Contents/Developer/usr/bin/atos -arch armv7 -o MYAPP.app/MYAPP 0x0004fb26
Same result with /usr/bin/atos and for armv7s.
Has anyone else experienced this issue? Can you please advise? Thanks.
A simpler alternative: you can use the atos -l flag to make it do the maths for you.
Say you've got the following line in your crash log that you want to symbolicate:
5 MyApp 0x0044e89a 0x29000 + 4348058
The first hex number is the stack address, and the second hex number is the load address. You can ignore the last number. You don't need to worry about slide addresses either.
To symbolicate, do the following:
atos -o MyApp.app/MyApp -arch armv7 -l 0x29000 0x0044e89a
If you can't find your MyApp.app/MyApp file, rename your '.ipa' file to a '.zip', unzip it, and it'll be in the Payload folder.
And if you're not sure which architecture to use (for example, armv7 or armv7s), scroll to the 'Binary Images' part of the crash file and you can find it in there.
Cheers
You have to calculate the address to use with atos, you can't just use the one in the stacktrace.
symbol address = slide + stack address - load address
The slide value is the value of vmaddr in LC_SEGMENT cmd (Mostly this is 0x1000). Run the following to get it:
otool -arch ARCHITECTURE -l "APP_BUNDLE/APP_EXECUTABLE" | grep -B 3 -A 8 -m 2 "__TEXT"
Replace ARCHITECTURE with the actual architecture the crash report shows, e.g. armv7.
Replace APP_BUNDLE/APP_EXECUTABLE with the path to the actual executable.
The stack address is the hex value from the crash report.
The load address can be is the first address showing in the Binary Images section at the very front of the line which contains your executable. (Usually the first entry).
Since in the past value of the slide was equal to value of the load address this always worked. But since Apple introduced Address space layout randomization beginning with iOS 4.3 (in different variations), the apps loading address is randomized for security reasons.
Simply use dwarfdump:
dwarfdump --arch armv7 myApp.dSYM --lookup 0xaabbccdd | grep 'Line table'
No need to do any calculations at all.
(From Get symbol by address (symbolicating binary, iOS build)).
For whom that certain times doesn't have the value for Load Address like this:
Jan 14 11:02:39 Dennins-iPhone AppName[584] <Critical>: Stack Trace: (
0 CoreFoundation 0x2c3084b7 <redacted> + 150
1 libobjc.A.dylib 0x39abec8b objc_exception_throw + 38
2 CoreFoundation 0x2c21cc35 CFRunLoopRemoveTimer + 0
3 AppName 0x0005a7db AppName + 272347
I've created a simple bash to help me debug:
#! /bin/bash
read -p "[Path] [App Name] [Stack Address] [DecimalSum] " path appName stackAddress decimalSum
loadAddress=`echo "obase=16;ibase=10;$((stackAddress-decimalSum))" | bc`
atos -o $path/Payload/$appName.app/$appName -l $loadAddress $stackAddress -arch armv7
It just reads the path for the app, the app name, the stack address, and the value after "+" signal (the decimal value) and then find the value for load address to run atos command.

Error Creating IPA File for Enterprise Distribution: "PackageApplication failed with exit code 1"

I am running XCode 4.2 and when I Build, Archive, and then attempt to create the IPA file in Organizer, I get the following error message:
PackageApplication failed with exit code 1.
Packaging application: '/Users/Brad/Library/Developer/Xcode/Archives/2011-08-06/*** 8-6-11 4.21 PM.xcarchive/Products/Applications/***.app'
Arguments: embed=/Users/Brad/Library/MobileDevice/Provisioning Profiles/***.mobileprovision verbose=1 output=/var/folders/-K/-K95TJ0AGgaHq4MSn8EjL++++TI/-Tmp-/1376A091-5CA1-4393-AF29-34FFBFD49C74-1082-00000C64DB251DF1/app.ipa sign=iPhone Distribution: ***.
Environment variables:
HOME = /Users/Brad
LOGNAME = Brad
__CF_USER_TEXT_ENCODING = 0x1F5:0:0
DISPLAY = /tmp/launch-r5c1Ou/org.x:0
COMMAND_MODE = unix2003
VERSIONER_PERL_PREFER_32_BIT = no
PATH = /Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin
SHELL = /bin/bash
SSH_AUTH_SOCK = /tmp/launch-SjRZET/Listeners
Apple_PubSub_Socket_Render = /tmp/launch-4KUyaU/Render
TMPDIR = /var/folders/-K/-K95TJ0AGgaHq4MSn8EjL++++TI/-Tmp-/
USER = Brad
VERSIONER_PERL_VERSION = 5.10.0
Output directory: '/var/folders/-K/-K95TJ0AGgaHq4MSn8EjL++++TI/-Tmp-/1376A091-5CA1-4393-AF29-34FFBFD49C74-1082-00000C64DB251DF1/app.ipa'
Temporary Directory: '/var/folders/-K/-K95TJ0AGgaHq4MSn8EjL++++TI/-Tmp-/kNwZk2Uc3U' (will NOT be deleted on exit when verbose set)
+ /bin/cp -Rp /Users/Brad/Library/Developer/Xcode/Archives/2011-08-06/*** 8-6-11 4.21 PM.xcarchive/Products/Applications/***.app /var/folders/-K/-K95TJ0AGgaHq4MSn8EjL++++TI/-Tmp-/kNwZk2Uc3U/Payload
Program /bin/cp returned 0 : []
### Checking original app
+ /usr/bin/codesign --verify -vvvv /Users/Brad/Library/Developer/Xcode/Archives/2011-08-06/*** 8-6-11 4.21 PM.xcarchive/Products/Applications/***.app
Program /usr/bin/codesign returned 0 : [/Users/Brad/Library/Developer/Xcode/Archives/2011-08-06/*** 8-6-11 4.21 PM.xcarchive/Products/Applications/***.app: valid on disk
/Users/Brad/Library/Developer/Xcode/Archives/2011-08-06/*** 8-6-11 4.21 PM.xcarchive/Products/Applications/***.app: satisfies its Designated Requirement
]
Done checking the original app
### Embedding '/Users/Brad/Library/MobileDevice/Provisioning Profiles/***.mobileprovision'
+ /bin/rm -rf /var/folders/-K/-K95TJ0AGgaHq4MSn8EjL++++TI/-Tmp-/kNwZk2Uc3U/Payload/***.app/embedded.mobileprovision
Program /bin/rm returned 0 : []
+ /bin/cp -rp /Users/Brad/Library/MobileDevice/Provisioning Profiles/***.mobileprovision /var/folders/-K/-K95TJ0AGgaHq4MSn8EjL++++TI/-Tmp-/kNwZk2Uc3U/Payload/***.app/embedded.mobileprovision
Program /bin/cp returned 0 : []
+ /usr/bin/codesign -d --entitlements /var/folders/-K/-K95TJ0AGgaHq4MSn8EjL++++TI/-Tmp-/kNwZk2Uc3U/entitlements_rawunFQiwaj /var/folders/-K/-K95TJ0AGgaHq4MSn8EjL++++TI/-Tmp-/kNwZk2Uc3U/Payload/***.app
Program /usr/bin/codesign returned 0 : [Executable=/var/folders/-K/-K95TJ0AGgaHq4MSn8EjL++++TI/-Tmp-/kNwZk2Uc3U/Payload/***.app/***
]
+ /usr/libexec/PlistBuddy -c Set :get-task-allow NO /var/folders/-K/-K95TJ0AGgaHq4MSn8EjL++++TI/-Tmp-/kNwZk2Uc3U/entitlements_plistNowUyBmz
Program /usr/libexec/PlistBuddy returned 0 : []
+ /usr/bin/plutil -lint /var/folders/-K/-K95TJ0AGgaHq4MSn8EjL++++TI/-Tmp-/kNwZk2Uc3U/entitlements_plistNowUyBmz
Program /usr/bin/plutil returned 0 : [/var/folders/-K/-K95TJ0AGgaHq4MSn8EjL++++TI/-Tmp-/kNwZk2Uc3U/entitlements_plistNowUyBmz: OK
]
### Codesigning '/Users/Brad/Library/MobileDevice/Provisioning Profiles/***.mobileprovision' with 'iPhone Distribution: ***.'
+ /usr/bin/codesign --force --preserve-metadata --sign iPhone Distribution: ***. --resource-rules=/var/folders/-K/-K95TJ0AGgaHq4MSn8EjL++++TI/-Tmp-/kNwZk2Uc3U/Payload/***.app/ResourceRules.plist --entitlements /var/folders/-K/-K95TJ0AGgaHq4MSn8EjL++++TI/-Tmp-/kNwZk2Uc3U/entitlements_plistNowUyBmz /var/folders/-K/-K95TJ0AGgaHq4MSn8EjL++++TI/-Tmp-/kNwZk2Uc3U/Payload/***.app
Program /usr/bin/codesign returned 1 : [/var/folders/-K/-K95TJ0AGgaHq4MSn8EjL++++TI/-Tmp-/kNwZk2Uc3U/Payload/***.app: replacing existing signature
codesign_allocate: object: /var/folders/-K/-K95TJ0AGgaHq4MSn8EjL++++TI/-Tmp-/kNwZk2Uc3U/Payload/***.app/*** malformed object (unknown load command 8)
/var/folders/-K/-K95TJ0AGgaHq4MSn8EjL++++TI/-Tmp-/kNwZk2Uc3U/Payload/***.app: object file format invalid or unsuitable
]
error: codesign failed with error 1
Note: I replaced any names with *.
There is no single answer to this problem, partly because Apple's error message(s) is/are not terribly specific.
For my case the solution was this:
Open this Perl script:
/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/PackageApplication
and insert this line near the top, like right after the "my $xxxx" declarations:
$ENV{CODESIGN_ALLOCATE} = '/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/codesign_allocate';
Credit to http://loopingrecursion.com/index.php?t=codesign for this answer.
The problem seemed to arise after installing some XCode 4.2 beta 7. I eventually uninstalled that one and reinstalled 4.1 from scratch but still couldn't Validate or Share, until I employed this fix.
Ran into this myself a few minutes ago.
Make sure you have a Distribution Certificate in your keychain (you can create one in your Provisioning Portal), and also a Distribution Profile (also you can create this in you Provisioning Portal).
After that, go into your Project properties, to the 'Build Settings' tab.
You'll find a section called 'Code Signing', and at the 'Code Signing Identity' part, at 'Release' you select 'iPhone Distribution'.
That was how i fixed it,
Good luck!
EDIT: just saw you're in the Enterprise program, i'm not sure if my solution works for Enterprise..
The "PackageApplication failed with exit code 1." error during archiving can also be caused by a missing resource. Check your error message for which resource it can't find.
Just to put my 5 cents on this. I had the same error and it turned out that I had 2 Distribution certificates in my keychain. One of them appeared with a red X next to it. After deleting it the error was resolved.

iphone :How to do symobolication of crash report?

In my app i got crash report
Exception Type: EXC_BAD_ACCESS (SIGBUS)
Exception Codes: KERN_PROTECTION_FAILURE at 0x00000000
Crashed Thread: 7
In Thread 7 :
Thread 7 Crashed:
0 CoreFoundation 0x3728ba96 0x37278000 + 80534
1 CFNetwork 0x36617b84 0x36616000 + 7044
2 CFNetwork 0x36617af6 0x36616000 + 6902
3 MusicBandApp 0x0000bbfc 0x1000 + 44028
4 MusicBandApp 0x0000b740 0x1000 + 42816
5 Foundation 0x33b88382 0x33b6b000 + 119682
6 Foundation 0x33bfa5c6 0x33b6b000 + 587206
7 libsystem_c.dylib 0x3579530a 0x35762000 + 209674
8 libsystem_c.dylib 0x35796bb4 0x35762000 + 215988
but can"t show particular crash file name & line number.
How can sybolicate this crash report.
We need a file called symbolitecrash to process this file. This file can be located in /Developer/Platforms/iPhoneOS.platform/Developer/Library/PrivateFrameworks/DTDeviceKit.framework/Versions/A/Resources
Open the Terminal.
Copy symbolitecrash file to the default location shown when the terminal is opened.
eg. Terminal window :-
Last login: Wed Jun 22 15:28:21 on ttys000
UserMM:~ user$
Here, the default location is the directory "user".
Running this script with the -h option provides the minimal help:
UserMM:~ user$ symbolitecrash -h
usage:
/usr/local/bin/symbolicatecrash [-Ah] [-o ] LOGFILE [SYMBOL_PATH ...]
Symbolicates a crashdump LOGFILE which may be "-" to refer to stdin. By default,
all heuristics will be employed in an attempt to symbolicate all addresses.
Additional symbol files can be found under specified directories.
Options:
-A Only symbolicate the application, not libraries
-o If specified, the symbolicated log will be written to OUTPUT_FILE (defaults to stdout)
-h Display this message
-v Verbose
Place the .crash file in the same location where symbolitecrash file is copied.
To add symbols to the crash log you need the dSYM file generated by the linker when you compiled your application for AppStore. In other words, when you build for AppStore you should keep the dSYM package in a safe place backed up by Time Machine. This is very important. You should keep a copy of the dSYM for each version of your application ever shipped. If you have the package, translating code offsets to function names with line numbers has never been easier:
$ symbolicatecrash MiMo_2011-06-22-143801_Anands-Ipod.crash myApp.app.dSYM > myApp_2011-06-22-143801_Anands-Ipod1.crash
myApp_2011-06-22-143801_Anands-Ipod1.crash is the new crash file generated in the same location.
Here is the result:
Thread 0 Crashed:
0 libobjc.A.dylib 0x300c87ec objc_msgSend + 20
1 myApp 0x00006434 -[BoardView setSelectedPiece:] (BoardView.m :321)
I also described how to do this step by step in this post
It worked fine for me:
Crash Symbolized http://k.minus.com/jk4X2obwZMI7j.png

Getting numerous odd errors through NSLog upon launching the app

This is what i get:
warning: Unable to read symbols for /Developer/Platforms/iPhoneOS.platform/DeviceSupport/4.2.1 (8C148)/Symbols/usr/lib/info/dns.so (file not found).
2011-02-26 21:17:43.274 Treacle[2493:5c03] [NMSP_ERROR] readCallBack(): Network error, calling closeCallback! Error:2517952
2011-02-26 21:17:43.284 Treacle[2493:5c03] [NMSP_ERROR] writeCallBack() Received error kCFStreamEventErrorOccurred.
2011-02-26 21:17:43.539 Treacle[2493:307] [NMSP_ERROR] check status Error: -12986 -> line: 434
2011-02-26 21:17:43.689 Treacle[2493:307] [NMSP_ERROR] check status Error: -12986 -> line: 434
I don't know what file it has a problem with at line 434 but on my view controller.m that line has been there for ages without causing problems and is contained in a method, which isn't triggered when the app starts.
This is a known problem. Just go to /Developer/Platforms/iPhoneOS.platform/DeviceSupport/4.2.1 (8C148) and copy /Symbols/usr/lib/info/dns.so file from 4.2 Symbols folder to 4.2.1 (8C148)/Symbols/usr/lib/info folder. It's just not there. Quit your Xcode and open it again. It should work.
Are you using location services?
It looks like LocationKit is talking to a location NMSP server (likely your router?) and having problems with it...
Try running on the device with wi-fi off and see if the problem persists.

How to found the problem of Device crash log in Iphone

I am new one to develop iphone App. so help me to found out error in crash log. In crash log contains only library or framework. Help me to found out crash line .
Check the crash log and find the memory address where it is crashed .
(see MyApp 0x35626f5a 0x1000 + 22516)
Crash log:
0 WebCore 0x35626e8a 0x3023d000 + 23455
1 Foundation 0x3565ebf8 0x3023d000 + 56767
... ... ...
17 MyApp 0x35626f5a 0x1000 + 22516
Steps to analyze crash report:
Copy the .app file and the .dSYM file that was created at the time of release to a folder (say CrashTest).
Open the Crash report.
Open 'Terminal' application and go to the folder (CrashTest) created above (using CD command).
Use this command :atos -arch armv7 -o 'app_name.app'/'app_name' 'crashed_memory_location'.
(crashed_memory_location ->The memory location should be the one at which the app crashed as per the report).
Eg : atos -arch armv7 -o MyApp.app/MyApp 0x35626f5a
This would show you the exact line, method name which resulted in crash.
o/p format : [classname functionName:]; and line number
Eg : +[MyController formatMyAddress:] (in MyApp) (MyController.m:401)
Did u view a debug build or release build?
Release builds do not contain all the information about the crash.