build error while add revmob ad in iOS app - ios

I want to add RevMob add in my app but there are some errors
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_SKStoreProductViewController", referenced from:
objc-class-ref in RevMobAds(RevMobStoreController.o)
"_SKStoreProductParameterITunesItemIdentifier", referenced from:
-[RevMobStoreController openStoreWithITunesItemId:] in RevMobAds(RevMobStoreController.o)
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I have added StoreKit,SystemConfiguration and RevMob Frameworks already.
I am using Xcode4.3 and ios4.2
Plz help me.
Thanks in advance.

You need to add the StoreKit framework
EDIT: I see now what you mean, there was an issue with the older versions, I'm adding a link to an edited framework to solve that issue: Edited Revmob Framework

You must link against StoreKit.framework

It looks like the ad sdk you have now does not include support for use with the simulator.
-[RevMobStoreController openStoreWithITunesItemId:] in RevMobAds(RevMobStoreController.o)
ld: symbol(s) not found for architecture i386
if you get anything that mentions "not found for architecture" means revmob didnt include classes for running on simulator. You have 2 choices. look for a missing library ".a file" or only compile for testing on a device.
I've ran into an issue with the new ios6 where revmob did not support the new iphone 5 armv7s architecture.
Double check your revmob installation or try compiling to your phone instead of the simulator

When your are dropping the files manually in xcode the files are not copied to Bundle. So "SKStoreProductViewController.m" was the file not copied in the bundle so the error occurred. To resolve the error. Drag the files only .m files to Copy Bundle Resourceas shown in the image

This error can also happen if you removed a file from your project and subsequently re-created it. Sometimes Xcode doesn't automatically re-include it in the 'compile sources' box (when you click on target).
Check the box and see if all of your source files are included, if not then drag them in and rebuild.

They release a new SDK version (4.6.0) that works perfectly on older Xcode versions!

This also happens with Appirater. I was getting this message:
Undefined symbols for architecture x86_64: "_OBJC_CLASS_$_SKStoreProductViewController", referenced from: objc-class-ref in Appirater.o "_SKStoreProductParameterITunesItemIdentifier", referenced from: +[Appirater rateApp] in Appirater.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation)
---To Fix---
add StoreKit.framwork in --> BuildPhases
---Under-> Link Libraries with Libraries
If you have more than one target you might need to add the
StoreKit.framwork to both Targets.

I faced similar issue and after long search and checking sample RevMob code, i found this solution, may be help others:
Under project target, select Build Settings, under Deployment, check iOS Deployment Target, change the value to 'iOS 9.0' or higher.
I hope this help.

Related

Adding Firebase Framework to iOS Undefined symbols

I am trying to add Firebase Messaging to my iOS Project. I can't use Pods because something with them is broken on my Developermachine. So I am adding the Framework manually. As mentioned by the Readme I added all Frameworks of the Analytics and Messaging Folders along with the Firebase.h to my Xcode Project. I added Storekit.framework, libz, libc++ and libsqlite3.0 as mentioned on other Stackoverflow Questions to get rid of the most linker errors. But still I can't compile/link my project because of the following errors:
Undefined symbols for architecture arm64:
"_OBJC_CLASS_$_SKPaymentQueue", referenced from:
objc-class-ref in FirebaseAnalytics(FIRAInAppPurchaseTransactionReporter_ca1fe3eb82b823d5f96d3f8b4baedc9c.o)
"_OBJC_CLASS_$_SKProductsRequest", referenced from:
objc-class-ref in FirebaseAnalytics(FIRAProductsRequest_8f770071350872416d311668917f3a41.o)
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I don't get why they are missing or which library I need to add to make this run. Does someone know what to do ?
And I should also mention that I am using Qt on this project.
Thanks in advance,
I had the same issue.
I don't know why this framework is required, but i added StoreKit.framework to Linked Frameworks and Libraries which made it compile.
Hope it helps! 👍
You can try go to the entry header file of your project then add
#import "Firebase.h"
to see if problem is solved.

google admob undefined symbol for architecture armv7

i have replaced older version of admob 6.6.1 with latest admob library version 6.12.0 but i get this error although every thing is fine. I am using xcode 6.0.1, how to resolve this issue, any help?
Undefined symbols for architecture armv7:
"_OBJC_CLASS_$_EKEvent", referenced from:
objc-class-ref in libGoogleAdMobAds.a(GADOpener.o)
"_OBJC_CLASS_$_EKEventEditViewController", referenced from:
objc-class-ref in libGoogleAdMobAds.a(GADOpener.o)
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I had same issue but i solved by adding eventKit and eventUIKit framework into my project. Hope it will work for you too.
This error is mostly because update of your ADMOB SDK.
1) Go to build phases->Open list of frameworks.
2) Locate libGoogleAdMobAds.a. Remove this file by pressing - sign.
3) Again add this libGoogleAdMobAds.a file back by pressing + sign and selecting "Add other". select this file from ADMOB folder of your project.
4) Clean, then build and run your project.
Also, check you have -ObjC set to Other Linker Flags in your project's target build settings and required frameworks are added.
add Framework EventKit and EventKitUI.

Linking libiconv on ios

I am trying to use the objective-git library for an ios application I am in the proccess of developing. I am able to get the library to compile, link, and run perfectly fine in the simulator. However, when I try to run the application on an actual iPad, I get the followign error:
Undefined symbols for architecture armv7s:
"_libiconv", referenced from:
_git_path_iconv in libObjectiveGit-iOS.a(path.c.o)
"_libiconv_close", referenced from:
_git_path_iconv_clear in libObjectiveGit-iOS.a(path.c.o)
"_libiconv_open", referenced from:
_git_path_iconv_init_precompose in libObjectiveGit-iOS.a(path.c.o)
ld: symbol(s) not found for architecture armv7s
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I believe the issue is that I am compiling the libgit2 library with a different version of iconv then the one included with ios. However, I have messed with the build script in an attempt to force it to link with the ios version, but the error persists. How should I go about properly linking the iconv library so that I can run the application on an actual device?
You need to add libiconv.tbd to 'Link Binary With Libraries' section in Build Phases.
Note: I know ObjectiveGit fixed this issue but maybe that helps to others those who are trying to use iconv in their projects.

Unable to link GoogleAnalytics 3.01 with XCode 5 (missing required architecture x86_64)

I have built my App (targeted for iOS7) and now want to apply Google Analytics as the last step before submission. What I did:
Downloaded GA for iOS 3.01
Imported content of /GoogleAnalytics/Library/ into group "GoogleAnalytics"
Imported libGoogleAnalyticsServices.a into group "GoogleAnalytics"
Added Build Phases and swapped build phase libGoogleAnalytics_debug.a with libGoogleAnalyticsServices.a
Added code block #include "GAI.h" to my -Prefix.pch-file.
Initialize the [GAI sharedInstance] in my AppDelegate.
I have attached screenshots of the setup in the bottom of this post.
When I try to build (either device or simulator, both 32bit), I get the following linker errors:
Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_GAI", referenced from:
objc-class-ref in FTVAppDelegate.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
How do I solve this?
UPDATE 1
I also get the warning
ld: warning: ignoring file .../libGoogleAnalyticsServices.a, missing required architecture x86_64 in file .../libGoogleAnalyticsServices.a (3 slices)
ld: warning: ignoring file .../SDWebImage.framework/SDWebImage, missing required architecture x86_64 in file .../SDWebImage.framework/SDWebImage (3 slices)
UPDATE 2
This error only occurs when building for 64bit. I had accidentally set "Build Only for active architectures" to NO, when this changed to YES, I was able to build yet again. This means that the App now does NOT work on iPhone 5S - which is still a problem.
You're not doing anything wrong. I'm pretty sure google has not yet provided a arm64 version of their libGoogleAnalyticsServices.a, which is really annoying ...it has been weeks since the public the release of Xcode 5GM.
For now, I guess only build for armv7, armv7s or remove google analytics until they get their head out of their pants.
UDATE: Finally fixed https://developers.google.com/analytics/devguides/collection/ios/resources
Select this option in the Architecture section in "Build Settings" and your code will run on iPhone 5S, I had the same trouble.
Good news everyone, fixed by the 3.03 release:
64-bit support is now available in v3.03 of the Google Analytics
Services SDK for iOS. (Source)
I see on first screenshot that your project has 2 targets.
Are you sure that libGoogleAnalyticsServices.a added to both targets?
Linked frameworks may differ from target to target, so it's most common error this way...
Also try remove GA from project, then Clean, then Clean Build Folder, then restart Xcode and add GA again =) Yesterday this helped me =)

xcode, launching on simulator is ok but cannot archive

I am new to Xcode.
I am adding some features on the old(iOS 3.2) xcode game project. This code never touched for more than a year until I touched.
It worked fine until I tried to make an .iap file. it ran ok and all my changes didn't make any error.
So I changed target device from iPhone 6.0 Simulator -> iOS Device, and tried archive. Unfortunately it generated bunch of errors:
ld: warning: ignoring file lib/libegn_neutron_http_Release_iphoneos.a, file was built for archive which is not the architecture being linked (armv7): lib/libegn_neutron_http_Release_iphoneos.a
Undefined symbols for architecture armv7:
"_EGN_setPollingInMenu", referenced from:
ExitGamesCreateSession(sLibraryData*) in exitgames.o
"_EGN_Neutron_New", referenced from:
ExitGamesInit(sLibraryData*) in exitgames.o
"_EGN_setServerUrl", referenced from:
ExitGamesCreateSession(sLibraryData*) in exitgames.o
......similar 34 errors continued
"_EGN_NeutronCls_Release", referenced from:
ExitGamesShutDown(sLibraryData*) in exitgames.o
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
This project uses some "exitgames" library which supports social features.
Also this project have some wrapping part of "Brew" c++ codes.
I don't know which part has the problem. tried to figure out and searched a whole day but still couldn't get a clue.
Can anybody give me an advice?
Thank you.
Try running lipo -info exitgames.a from the command line, it should tell you what architectures the framework is made to support.

Resources