Application error with + [NSDecimalNumber gad_negativeOne]: problem?

My application worked well until then I added admob frameworkand now it crashes.

Please check the crash logs,

enter image description here

I tried on Google, but there is no result in this crash.

If I commented on the contents inside viewDidAppear(), then the application is working (without downloading part of the application). But if I try to download "admob", then its crash.


The code:

-(void)viewDidAppear:(BOOL)animated{
    if([Connectivity hasConnectivity]){
        // [self loadAds];
        NSTimer* myTimer = [NSTimer scheduledTimerWithTimeInterval: 15.0 target: self
                                                          selector: @selector(callAfterSixtySecond:) userInfo: nil repeats: YES];
    }
}
-(void) callAfterSixtySecond:(NSTimer*) t
{

    if([GMMConnectivity hasConnectivity]){

        [self.adBanner removeFromSuperview];
        [self loadAdmob];
    }
}

-(void)loadAdmob{

    CGPoint origin;
    if(IS_RETINA){
        if([[UIScreen mainScreen] bounds].size.height >500){
            //        NSLog(@"5");
            origin = CGPointMake(0.0,
                                 568-
                                 CGSizeFromGADAdSize(kGADAdSizeSmartBannerPortrait).height);
        }else{
            //        NSLog(@"4");

            origin = CGPointMake(0.0,
                                 (480)-
                                 CGSizeFromGADAdSize(kGADAdSizeSmartBannerPortrait).height);
        }
    }else{
        //        NSLog(@"3");

        origin = CGPointMake(0.0,
                             (460)-
                             CGSizeFromGADAdSize(kGADAdSizeSmartBannerPortrait).height);

    }
    // Use predefined GADAdSize constants to define the GADBannerView.
    self.adBanner = [[GADBannerView alloc] initWithAdSize:kGADAdSizeSmartBannerPortrait
                                                   origin:origin]
    ;

    // Note: Edit SampleConstants.h to provide a definition for kSampleAdUnitID
    // before compiling.
    self.adBanner.adUnitID = MY_BANNER_UNIT_ID;
    self.adBanner.delegate = self;
    [self.adBanner setRootViewController:self];
    [self.view addSubview:self.adBanner];
    self.adBanner.center =
    CGPointMake(self.view.center.x, self.adBanner.center.y);
    [self.adBanner loadRequest:[self createRequest]];
    [self.view addSubview:adBanner_];
}
+4
source share
2 answers

You need to add " -ObjC " to the Other linker flags of the Build Settings tab . Good luck

+34
source

:

[GADStaticDictionary decrementNumberForKey: shouldNotifyDelegate:];

, , NSDecimalNumber, gad_negativeOne.

. , delegate, gad_negativeOne.

, , gad_, .

0

Source: https://habr.com/ru/post/1541931/


All Articles