Could not successfully update network info during initialization
Asked Answered
S

6

20

I get the above mentioned issue all the time when I first launch the app in the day. When I first launch the app, I make server calls to get some data and then play animation video. Server calls is in a separate thread than main UI Thread. Is it something to do with Network Reachability or the animation video ? I think the first part is the major issue but cannot recreate this all the time.

Has anyone experienced the issue ?

Below is the code when I first launch the app.

override func viewDidLoad() {
        super.viewDidLoad();


        self.navigationController?.navigationBarHidden = true;
        self.view.backgroundColor = UIColor.whiteColor();
           dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0)) { () -> Void in
            Items.setup(); //AFNetworking call
        };

        animationViewController.delegate = self;
        animationViewController.view.autoresizesSubviews = true;
        animationViewController.view.autoresizingMask = [.FlexibleLeftMargin, .FlexibleRightMargin];
        animationViewController.view.center = CGPointMake(self.view.bounds.size.width / 2, self.view.bounds.size.height / 2);

        self.view.addSubview(animationViewController.view);    

    }
Syllabogram answered 18/12, 2015 at 15:50 Comment(6)
Possible duplicate of Why can't this iOS app access the network?Katlynkatmai
but there are no answers on it....And I am seeing the issue on Devices..Syllabogram
You're not giving us any details of what you do, when you do it, how you do it.Garlan
Its in swift....It compiles and works...Syllabogram
It is working and I can compile it too...if you want Ill edit it....Syllabogram
It is a method call to setup the network calls.I have changed the call so that it doesnt look like an array.Syllabogram
S
3

I have resolved this issue in Xcode 9.1 with below steps.

1.Select Simulator

2.Select Debug from top menu items.

3.Select Location from Debug menu list.

4.Select Apple location.

Swine answered 12/12, 2017 at 6:29 Comment(0)
C
1

Check if you have an exception breakpoint to capture "All Exceptions" in breakpoint navigator. This fixed it for me.

Carman answered 6/6, 2018 at 17:57 Comment(0)
E
0

I had similar problem. Turns out in the App/Capabilities, I have Wireless Accessory Configuration with some red warnings. Click the button automatically solved the problem.

Not sure if it would work for you. I am using Xcode 8.

Egyptology answered 17/10, 2016 at 18:14 Comment(0)
P
0

Was experiencing this too, fixed it by giving the simulator a default location. It may be a code smell so watch how you handle the new location permissions in iOS11.

Postmistress answered 19/10, 2017 at 13:50 Comment(0)
R
-1

Issue: same with Xcode 9.0 iOS11. Resolution: new iOS requires you to manually turn on privacy for new deployment apps. Upgrades of the app is not needed. Following these steps: (1) iPhone "Settings" icon: click (2) "Privacy": click (3) "Location Services": click (4) [Your app]: click on your app (5) "While Using the App": click

Raeleneraf answered 24/9, 2017 at 16:54 Comment(0)
A
-1

You might have overrided loadView() without calling super method.

Change

override func loadView() {

}

To

override func loadView() {
  super.loadView()
}
Audiophile answered 20/4, 2018 at 8:26 Comment(1)
the view controller lifecycle has nothing to do with this issue. besides, the documentation for that method clearly states that your custom implementation should not call super.Typewriter

© 2022 - 2024 — McMap. All rights reserved.