issue in integration of google analytics in ios static library - iphone

Hey i want to integrate google analytics in my ios static library, but when i'm putting libGoogleAnalytics.a from google analytics sdk for ios in my own static library i'm getting this error
Libtool build/Debug-iphonesimulator/libHY5Lib.a normal i386
cd /Hy5Canvas/Lib/HY5Lib
setenv MACOSX_DEPLOYMENT_TARGET 10.6
setenv PATH "/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/libtool -static -arch_only i386 -syslibroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk -L/Hy5Canvas/Lib/HY5Lib/build/Debug-iphonesimulator -L/Hy5Canvas/Lib/HY5Lib/HY5Lib -L/Hy5Canvas/Lib/HY5Lib -filelist /Hy5Canvas/Lib/HY5Lib/build/HY5Lib.build/Debug-iphonesimulator/HY5Lib.build/Objects-normal/i386/HY5Lib.LinkFileList -ObjC -framework Foundation -lGoogleAnalytics -o /Hy5Canvas/Lib/HY5Lib/build/Debug-iphonesimulator/libHY5Lib.a
Command /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/libtool failed with exit code 1
Kindly help me out on this issue
Thanks,

The Google Analytics SDK for iOS isn't built for the armv7s architecture. This architecture just became available in Xcode 4.5 (released 9/12/2012), and is required for building for the new iPhone 5. Please release a new version of the SDK that includes this architecture.
Refer : Google Analytics Issue
Hope this helps :)

Related

The Google Analytics SDK for iOS isn't built for the armv7s architecture while instaling app on iPhone

When i am trying to install my application on iPhone/iPad I am getting the following error. I am using new Xcode 4.5. What should I do to remove this error. I need to test my app on device.
file is universal (3 slices) but does not contain a(n) armv7s slice: /Users/nishijain/Desktop/Backup SecondPrism/mobile/apps/SecondPrism/SecondPrism/Google Analytics SDK/libGoogleAnalytics.a for architecture armv7s
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Thanks
You need to download the latest version of the SDK, according to the Changelog there is support for armv7s in Version 1.5.1.
If the error still happens try an older version of Xcode (probably Xcode 4.4.1) which has no clue of armv7s and throws no error.
EDIT:
This should work too:
In your Build Settings remove armv7s from Valid Architectures.

iOS simulator on mac is running i386 architecture, not armv7?

I've got some static libraries I've built for use on armv7 architectures. When I try to use them in a iOS project which I testrun on the iphone 5.0 simulator, I get errors telling me about undefined symbols for architecture i386 in my static libraries.
So I guess this means the iphone simulator wants libraries compiled for i386? What is the point of the simulator then - why dosn't it emulate armv7 architecture as well?
So the only way I can test my static libraries is to connect a physical iOS device and run it?
Or did I get it wrong?
So I guess this means the iphone simulator wants libraries compiled
for i386? What is the point of the simulator then - why dosn't it
emulate armv7 architecture as well?
You've answered your own question. It's a simulator, not an emulator. Therefore it is a Mac OSX program, running on i386 architecture. If you compile your static libraries for i386 as well you will be able to use them on the simulator.
I am not very sure but i386 is for Simulator and armv7 is for Devices that you have connected to your Machine.
You can actually compile the app through Xcode command line tool using i386 architecture (there is also a way to run it in Xcode UI by modifying the build settings).
xcodebuild -sdk iphonesimulator6.1 -arch i386 VALID_ARCHS="i386 armv7 armv7s" clean install
Run this command in the directory that you have the projectName.xcodeproj file.
Here's a break down of the script:
-sdk iphonesimulator6.1 // Build the app on iPhone simulator 6.1
-arch i386 // Build your app using i386 architecture
VALID_ARCHS="i386 armv7 armv7s" // Specify these architectures are valid
clean install // Clean all the builds then re-build and install
If you want to try simulators with i386 just go for =< iPhone 5.

iOS: Error adding external framework to my project

I'm trying to use the Unrar4iOS framework in my project. I built the Unrar4iOS project, copied the framework's folder to my project and added it to the project's existing frameworks. I have my Framework search paths all set. But when I compile I get this error:
cd /Users/alex/Documents/iphone/production/iphone/myapp
setenv MACOSX_DEPLOYMENT_TARGET 10.6
setenv PATH "/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/g++-4.2 -arch i386 -isysroot /Developer/Platforms/
ld: framework not found Unrar4iOS
Command /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/g++-4.2 failed with exit code 1
What do you think?
Upgrading to Xcode 4.2 and building on iOS 5 resolved the issue... Don't really know why...

Compiling for iOS 3.1.3 gives "Undefined symbols for architecture i386"

How can I compile an iPhone project against Base SDK "iOS 3.1.3" without getting error messages saying "Undefined symbols for architecture i386"?
When using Base SDK "iOS 5.0" everything works fine, but I need to make sure the application works under iOS 3.1.3.
I use XCode 4.2. My frameworks all point to
/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.1.3.sdk/...
BUILD LOG:
Ld "***" normal i386
cd ***
setenv MACOSX_DEPLOYMENT_TARGET 10.5
setenv PATH "/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/clang
-arch i386 -isysroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.1.3.sdk
-L/Users/***/Library/Developer/Xcode/DerivedData/***/Build/Products/Debug-iphonesimulator
-F/Users/***/Library/Developer/Xcode/DerivedData/***/Build/Products/Debug-iphonesimulator
-filelist "/Users/***/Library/Developer/Xcode/DerivedData/***/Build/Intermediates/***.build/Debug-iphonesimulator/***.build/Objects-normal/i386/***.LinkFileList"
-mmacosx-version-min=10.5
-Xlinker -objc_abi_version
-Xlinker 2 -Xlinker -no_implicit_dylibs
-D__IPHONE_OS_VERSION_MIN_REQUIRED=30000 -lsqlite3
-framework Foundation -framework UIKit -framework CoreGraphics
-o "/Users/***/Library/Developer/Xcode/DerivedData/***/Build/Products/Debug-iphonesimulator/***.app/***"
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_NSAutoreleasePool", referenced from:
"_OBJC_CLASS_$_NSDictionary", referenced from:
"_OBJC_CLASS_$_NSDecimalNumber", referenced from:
"_OBJC_CLASS_$_NSMutableCharacterSet", referenced from:
(and 50 more)
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
You should always compile against the latest SDK. If you need to support older devices, you need to change the "Deployment Target" build setting, and test on a real device (since Apple no longer supplies the 3.x simulators).
It seems your problem is more to do with device/simulator (i386 refers to the intel chips in your mac) rather than iOS 3.1.3 vs iOS 5.0.
Try to change MACOSX_DEPLOYMENT_TARGET in build settings to 10.6 or Compiler Default
Remove and read your frameworks.

iphone how to determine SDK used to build an app

I am getting an error when submitting to iTunes, "Apple is not currently accepting applications built with this version of the SDK". I have xcode_3.2.4_and_ios_sdk_4.1 installed. Xcode 4 is out, so I should be still good.
How can I determine what version was used if I only have the MyApp.app file?
Ian
I do have this in the build output, but 4.1 should be ok???
/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc-4.2 -arch armv6 -gdwarf-2 -miphoneos-version-min=3.2 -std=c99 -I/Developer/MonoTouch/SDKs/MonoTouch.iphoneos.sdk/usr/include -isysroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.1.sdk -c /var/folders/0I/0IVt0CAJH24x9KMyLBKAAk+++TI/-Tmp-/tmp43533fea.tmp/MonoTouch.UICatalog.dll.s -o /var/folders/0I/0IVt0CAJH24x9KMyLBKAAk+++TI/-Tmp-/tmp43533fea.tmp/MonoTouch.UICatalog.dll.o
You must install Xcode 3.2.6 with iOS SDK 4.3.1 for apple to accept the upload.