我还是iOS开发的新手,我需要将google分析添加到我的phonegap项目中,但我不想使用javascript方式将其视为一个网站,我想使用Objective-C以正确的方式添加它.问题是每当我尝试添加谷歌分析文件和框架时,我都会收到以下错误:
Undefined symbols for architecture i386:
"_deflate", referenced from:
anon in libGoogleAnalyticsServices.a(NSData+zlib.o)
"_deflateEnd", referenced from:
anon in libGoogleAnalyticsServices.a(NSData+zlib.o)
"_deflateInit2_", referenced from:
anon in libGoogleAnalyticsServices.a(NSData+zlib.o)
"_inflate", referenced from:
anon in libGoogleAnalyticsServices.a(NSData+zlib.o)
"_inflateEnd", referenced from:
anon in libGoogleAnalyticsServices.a(NSData+zlib.o)
"_inflateInit2_", referenced from:
anon in libGoogleAnalyticsServices.a(NSData+zlib.o)
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Run Code Online (Sandbox Code Playgroud)
我也在使用admob与应用程序,但admob工作正常,我也尝试搜索重复文件的谷歌分析但找不到任何,当我尝试将谷歌分析添加到任何其他不包括phonegap的项目,它工作良好.请帮助我,我一直试图让这项工作持续2周.
我一直试图显示adob插页式广告没有运气,我曾经设法显示正常的横幅广告,但我不知道显示插页式广告的正确方法,这是我试过的代码(以下是admob指南)
在我的mainViewcontroller.h中
@interface MainViewController : CDVViewController
<GADBannerViewDelegate> {
GADBannerView *adBanner_;
GADInterstitial *interstitial_;
}
Run Code Online (Sandbox Code Playgroud)
在我的mainViewController.m上
@implementation MainViewController
@synthesize adBanner = adBanner_;
#pragma mark init/dealloc
// Implement viewDidLoad to do additional setup after loading the view,
// typically from a nib.
- (void)viewDidLoad {
[super viewDidLoad];
interstitial_ = [[GADInterstitial alloc] init];
interstitial_.adUnitID = @"XXXXXXXXXXXXXX";
[interstitial_ loadRequest:[GADRequest request]];
[interstitial_ presentFromRootViewController:self];
// Initialize the banner at the bottom of the screen.
[adBanner_ setFrame:CGRectMake(100,
100,
adBanner_.bounds.size.width,
adBanner_.bounds.size.height)];
// Use predefined GADAdSize constants to define the …Run Code Online (Sandbox Code Playgroud)