简体   繁体   中英

Mobile First Studio Hybrid App Xcode stuck at Splash Screen

I'm working on a Hybrid application with some basic UI with, built using IBM Mobile First Studio Eclipse plugin

What I've Done:
Simple app layout and I want to test it out on iPhone. With guidelines from IBM Knowledge Centre, I run it as Xcode project. It was successfully built with Xcode but unfortunately following problems stop me from proceeding.

Problem:
This problem occur for both iPhone device and simulator. During the first launch, the app will proceed to first page after displaying IBM splash screen for 2~3 seconds. However after running the app for the second time(in simulator) or reopening the app after killing it(in device), the app will not proceed pass the IBM splash screen.

Xcode Log:

Oct  1 17:22:05 Test-iPhone6 kernel[0] <Notice>: xpcproxy[2963] Container: /private/var/mobile/Containers/Data/Application/1ABEE18A-1EB8-47E5-B75A-24E461BA67D4 (sandbox)

    Oct  1 17:22:05 Test-iPhone6 SpringBoard[58] <Error>: CGContextSaveGState: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.

    Oct  1 17:22:05 Test-iPhone6 SpringBoard[58] <Error>: CGContextTranslateCTM: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.

    Oct  1 17:22:05 Test-iPhone6 SpringBoard[58] <Error>: CGContextRestoreGState: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.

    Oct  1 17:22:05 Test-iPhone6 SpringBoard[58] <Error>: CGContextSaveGState: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.

    Oct  1 17:22:05 Test-iPhone6 SpringBoard[58] <Error>: CGContextTranslateCTM: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.

    Oct  1 17:22:05 Test-iPhone6 SpringBoard[58] <Error>: CGContextRestoreGState: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.

    Oct  1 17:22:05 Test-iPhone6 firstApp[2963] <Warning>: [DEBUG] [WL_SPLASH] -[WLSplashView updateImage] in WLSplashView.m:189 :: Splash screen image is taken from UILaunchImages: Default-667h

    Oct  1 17:22:05 Test-iPhone6 firstApp[2963] <Warning>: [DEBUG] [WL_CONFIG] -[WLConfig init] in WLConfig.m:69 :: {

            "application id" = firstApp;

            "application version" = "1.0";

            authenticitySharedData = "${authenticitySharedData}";

            buildtime = 1443691154;

            environment = iphone;

            host = "192.168.210.163";

            ignoredFileExtensions = "";

            platformVersion = "7.1.0.0";

            port = 10080;

            protocol = http;

            testWebResourcesChecksum = false;

            wlAppFamily = "";

            wlMainFile = "index.html";

            wlSecureDirectUpdatePublicKey = "";

            wlServerContext = “/hybrid_firstProject/";

            wlShareCookies = “";

            wlShareUserCert = false;

            wlUid = "GMAhWz9yC4Qp9IrBzsM4oQ==";

        }

    Oct  1 17:22:05 Test-iPhone6 firstApp[2963] <Warning>: [DEBUG] [WL_SPLASH] -[WLSplashView updateImage] in WLSplashView.m:189 :: Splash screen image is taken from UILaunchImages: Default-667h

    Oct  1 17:22:05 Test-iPhone6 firstApp[2963] <Warning>: Apache Cordova native platform version 3.7.0 is starting.

    Oct  1 17:22:05 Test-iPhone6 firstApp[2963] <Warning>: Multi-tasking -> Device: YES, App: YES

    Oct  1 17:22:05 Test-iPhone6 firstApp[2963] <Warning>: Unlimited access to network resources

    Oct  1 17:22:05 Test-iPhone6 firstApp[2963] <Warning>: Restoring old webstorage backup. From: '/var/mobile/Containers/Data/Application/1ABEE18A-1EB8-47E5-B75A-24E461BA67D4/Library/WebKit/LocalStorage/file__0.localstorage' To: '/var/mobile/Containers/Data/Application/1ABEE18A-1EB8-47E5-B75A-24E461BA67D4/Library/Caches/file__0.localstorage'.

    Oct  1 17:22:05 Test-iPhone6 firstApp[2963] <Warning>: Removing old webstorage backup: '/var/mobile/Containers/Data/Application/1ABEE18A-1EB8-47E5-B75A-24E461BA67D4/Library/WebKit/LocalStorage/file__0.localstorage'.

    Oct  1 17:22:05 Test-iPhone6 firstApp[2963] <Warning>: [CDVTimer][wlapp] 0.182986ms

    Oct  1 17:22:05 Test-iPhone6 firstApp[2963] <Warning>: [CDVTimer][push] 0.155985ms

    Oct  1 17:22:05 Test-iPhone6 firstApp[2963] <Warning>: [CDVTimer][TotalPluginStartup] 0.817001ms

    Oct  1 17:22:05 Test-iPhone6 firstApp[2963] <Warning>: Unbalanced calls to begin/end appearance transitions for <UIViewController: 0x126e5a9b0>.

    Oct  1 17:22:05 Test-iPhone6 firstApp[2963] <Warning>: Resetting plugins due to page load.

    Oct  1 17:22:05 Test-iPhone6 firstApp[2963] <Error>: App Transport Security has blocked a cleartext HTTP (http://) resource load since it is insecure. Temporary exceptions can be configured via your app's Info.plist file.

    Oct  1 17:22:06 Test-iPhone6 firstApp[2963] <Warning>: Finished load of: file:///var/mobile/Containers/Bundle/Application/20C0066F-DBF8-48EA-896C-51BCCB8302B7/firstApp.app/www/default/index.html

What is it, exactly, that you're doing in your "simple app"?

Looks like your application is also attempting to connect to some server, probably the MobileFirst Server. This is evident from this log line:

Oct 1 17:22:05 Test-iPhone6 firstApp[2963] : App Transport Security has blocked a cleartext HTTP (http://) resource load since it is insecure. Temporary exceptions can be configured via your app's Info.plist file.

You will get such an error starting iOS 9 because the mentioned App Transport Security (ATS) is a new feature in this release, that prevents unsecure connections (HTTP).

You need to upgrade to the latest available MobileFirst Platform Foundation version. The updated version ensures that Hybrid applications will have ATS disabled (must be re-enabled once moving to a production environment).

  1. If you installed MobileFirst Studio from Eclipse, then go to Help > Check for updates and install the update.
  2. Once complete, in Eclipse, navigate to your-project\\apps\\your-app\\iphone\\ folder and delete the "native" folder.
  3. Re-build your project, open it again in Xcode and run it once more.

The app will now successfully connect to the server.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM