在ios白色屏幕上的Cordova混合app

时间:2014-04-27 03:39:46

标签: ios cordova

如果使用cordova emulate ios在ios模拟器上启动应用程序时出现白屏,并且您已尝试过以下操作,该怎么办:

  1. 选择ios app后,在Safari中打开控制台日志--->没有显示任何内容,因为在应用程序启动之前您无法连接,这意味着您无法看到任何启动日志...(据我所知)

  2. 仔细查看了ios模拟器的系统日志,但未发现任何揭示线索。有很多错误,但不确定哪个属于哪个,如果有的话?我会在这里复制并粘贴日志......

  3. 已下载Ripple并尝试在其上运行应用。纹波仿真器上的一切都很好。该应用程序似乎适用于浏览器和涟漪,但ios模拟器上的白色屏幕。

  4. ios模拟器日志:

    Apr 26 22:31:03 JayPrimes-MacBook-Pro syslogd[4128] <Notice>: --- syslogd restarted ---
    Apr 26 22:31:03 JayPrimes-MacBook-Pro.local backboardd[4116] <Warning>: <CAWindowServerDisplay:0x54684d0 TVOut 0x0>: Ignoring call to setTVSignalType: in simulator.
    Apr 26 22:31:03 JayPrimes-MacBook-Pro.local backboardd[4116] <Notice>: void __IOHIDPlugInLoadBundles(): Loaded 0 HID plugins
    Apr 26 22:31:03 JayPrimes-MacBook-Pro.local backboardd[4116] <Notice>: Posting 'com.apple.iokit.hid.displayStatus' notifyState=1
    Apr 26 22:31:03 JayPrimes-MacBook-Pro.local backboardd[4116] <Notice>: ____IOHIDSessionScheduleAsync_block_invoke: thread_id=0xb0219000
    Apr 26 22:31:03 JayPrimes-MacBook-Pro.local backboardd[4116] <Notice>: HID Session async scheduling initiated.
    Apr 26 22:31:03 JayPrimes-MacBook-Pro.local backboardd[4116] <Notice>: HID Session async root queue running at priority 63 and schedule 2.
    Apr 26 22:31:03 JayPrimes-MacBook-Pro.local backboardd[4116] <Notice>: HID Session async scheduling complete.
    Apr 26 22:31:03 JayPrimes-MacBook-Pro.local locationd[4119] <Notice>: Logging binary sensor data to /Users/justin/Library/Application Support/iPhone Simulator/7.1/Library/Caches/locationd/locationdSensors.bin
    Apr 26 22:31:03 JayPrimes-MacBook-Pro.local backboardd[4116] <Notice>: Successfully opened the IOHIDSession
    Apr 26 22:31:03 JayPrimes-MacBook-Pro.local installd[4122] <Notice>: 0x13471a8 check_freshness: sb.st_mtime = 1398565636 reference_mtime = 1398565631
    Apr 26 22:31:03 JayPrimes-MacBook-Pro.local mstreamd[4123] <Notice>: (Note ) mstreamd: mstreamd starting up.
    Apr 26 22:31:03 JayPrimes-MacBook-Pro.local installd[4122] <Notice>: 0x13471a8 check_stale_maps: /Users/justin/Library/Application Support/iPhone Simulator/7.1/Applications appears stale
    Apr 26 22:31:03 JayPrimes-MacBook-Pro.local locationd[4119] <Error>: NBB-Could not get UDID for stable refill timing, falling back on random
    Apr 26 22:31:03 JayPrimes-MacBook-Pro.local backboardd[4116] <Error>: HID: The 'Rate Controlled' connection 'backboardd' access to protected services is granted.
    Apr 26 22:31:04 --- last message repeated 1 time ---
    Apr 26 22:31:03 JayPrimes-MacBook-Pro.local mstreamd[4123] <Notice>: (Note ) PS: The subscription plugin class does not support push notification refreshing.
    Apr 26 22:31:03 JayPrimes-MacBook-Pro.local mstreamd[4123] <Notice>: (Note ) PS: Media stream daemon starting...
    Apr 26 22:31:03 JayPrimes-MacBook-Pro.local configd_sim[4118] <Notice>: network changed: v4(en0+:192.168.0.109) DNS+ Proxy+
    Apr 26 22:31:03 JayPrimes-MacBook-Pro.local locationd[4119] <Notice>: Location icon should now be in state 'Inactive'
    Apr 26 22:31:03 JayPrimes-MacBook-Pro.local installd[4122] <Error>: 0x13471a8 load_application_info: Info plist for /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.1.sdk//Applications/iOS Diagnostics.app was missing or empty
    Apr 26 22:31:03 JayPrimes-MacBook-Pro.local profiled[4120] <Notice>: (Note ) profiled: Service starting...
    Apr 26 22:31:03 JayPrimes-MacBook-Pro.local installd[4122] <Error>: 0x13471a8 load_application_info: Info plist for /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.1.sdk//Applications/Photo Booth.app was missing or empty
    Apr 26 22:31:04 JayPrimes-MacBook-Pro.local SimulatorBridge[4115] <Notice>: Switching to keyboard: en
    Apr 26 22:31:04 JayPrimes-MacBook-Pro.local SimulatorBridge[4115] <Warning>: KEYMAP: Chose mode=en_US@hw=US;sw=QWERTY from match=en_US@hw=US;sw=QWERTY from language=en
    Apr 26 22:31:04 JayPrimes-MacBook-Pro.local installd[4122] <Notice>: 0x13471a8 generate_application_map: Deferring user app list rebuild
    Apr 26 22:31:04 JayPrimes-MacBook-Pro.local securityd[4129] <Error>: unable to access hwaes key
    Apr 26 22:31:04 JayPrimes-MacBook-Pro.local installd[4122] <Notice>: 0x13471a8 generate_application_map: Saved updated install map for -|system|internal
    Apr 26 22:31:04 JayPrimes-MacBook-Pro.local installd[4122] <Notice>: 0xb0093000 load_application_type: No applications of type VPNPlugin found in /Users/justin/Library/Application Support/iPhone Simulator/7.1/Applications
    Apr 26 22:31:04 JayPrimes-MacBook-Pro.local distnoted[4131] <Warning>: # distnote server daemon  absolute time: 34423.868850975   civil time: Sat Apr 26 22:31:04 2014   pid: 4131 uid: 501  root: yes
    Apr 26 22:31:04 JayPrimes-MacBook-Pro.local installd[4122] <Notice>: 0xb0093000 generate_application_map: Saved updated install map for user|-|-
    Apr 26 22:31:04 JayPrimes-MacBook-Pro.local lsd[4132] <Warning>: LaunchServices: Seeding database
    Apr 26 22:31:04 JayPrimes-MacBook-Pro.local locationd[4119] <Warning>: Launch Services: Registering unknown app identifier com.apple.PassKit failed
    Apr 26 22:31:04 JayPrimes-MacBook-Pro.local locationd[4119] <Warning>: Launch Services: Unable to find app identifier com.apple.PassKit
    Apr 26 22:31:04 JayPrimes-MacBook-Pro.local backboardd[4116] <Warning>: Migration complete (if performed). (Elapsed time: 0.00 seconds)
    Apr 26 22:31:04 JayPrimes-MacBook-Pro.local backboardd[4116] <Warning>: -[BKSystemAppSentinel lock_bootstrap]: Telling the system app that it can start
    Apr 26 22:31:04 JayPrimes-MacBook-Pro.local SimulatorBridge[4115] <Warning>: LaunchServices: installing app for existing placeholder LSApplicationProxy: com.ionicframework.starter
    Apr 26 22:31:04 JayPrimes-MacBook-Pro.local SimulatorBridge[4115] <Warning>: LaunchServices: Not creating progress for LSApplicationProxy: com.ionicframework.starter since it is not a placeholder.
    Apr 26 22:31:04 JayPrimes-MacBook-Pro.local installd[4122] <Notice>: 0xb0115000 handle_install_for_ls: Install of "/Users/justin/repos/sprout/platforms/ios/build/emulator/Sprout.app" requested by SimulatorBridge
    Apr 26 22:31:04 JayPrimes-MacBook-Pro.local backboardd[4116] <Error>: HID: The 'Passive' connection 'SpringBoard' access to protected services is granted.
    Apr 26 22:31:04 JayPrimes-MacBook-Pro.local backboardd[4116] <Error>: HID: The 'Rate Controlled' connection 'SpringBoard' access to protected services is granted.
    Apr 26 22:31:04 JayPrimes-MacBook-Pro.local SpringBoard[4126] <Warning>: Loaded logger: SBAppInstallationLog
    Apr 26 22:31:04 JayPrimes-MacBook-Pro.local SpringBoard[4126] <Warning>: Loaded logger: SBIconLog
    Apr 26 22:31:04 JayPrimes-MacBook-Pro.local SpringBoard[4126] <Warning>: Loaded logger: SBWorkspaceLogging
    Apr 26 22:31:04 JayPrimes-MacBook-Pro.local backboardd[4116] <Warning>: -[BKSystemAppSentinel lock_notePresenceOfSystemApp:] Now monitoring "com.apple.SpringBoard"
    Apr 26 22:31:04 JayPrimes-MacBook-Pro.local SpringBoard[4126] <Warning>: *** error reading settings archive file: <SBRootSettings: /Users/justin/Library/Application Support/iPhone Simulator/7.1/Documents/com.apple.springboard.settings/RootSettings.plist> 
    Apr 26 22:31:04 JayPrimes-MacBook-Pro.local SpringBoard[4126] <Warning>: *** error reading settings archive file: <SBRootSettings: /Users/justin/Library/Application Support/iPhone Simulator/7.1/Documents/com.apple.springboard.settings/RootSettings.previous.plist> 
    Apr 26 22:31:04 JayPrimes-MacBook-Pro.local SpringBoard[4126] <Error>: libMobileGestalt MobileGestalt.c:200: string SBNonDefaultSystemAppTag is not a valid gestalt question
    Apr 26 22:31:04 JayPrimes-MacBook-Pro.local SpringBoard[4126] <Error>: libMobileGestalt MobileGestalt.c:200: string hidden is not a valid gestalt question
    Apr 26 22:31:04 JayPrimes-MacBook-Pro.local SpringBoard[4126] <Error>: libMobileGestalt MobileGestalt.c:835: still-camera is static and will never generate a notification
    Apr 26 22:31:04 JayPrimes-MacBook-Pro.local SpringBoard[4126] <Error>: libMobileGestalt MobileGestalt.c:835: stand-alone-contacts is static and will never generate a notification
    Apr 26 22:31:04 JayPrimes-MacBook-Pro.local SpringBoard[4126] <Warning>: BTM: attaching to BTServer
    Apr 26 22:31:04 JayPrimes-MacBook-Pro.local installd[4122] <Notice>: 0xb0115000 MobileInstallationInstall_Server: Installing app com.ionicframework.starter
    Apr 26 22:31:04 JayPrimes-MacBook-Pro.local installd[4122] <Notice>: 0xb0115000 install_application: Performing developer delta patch
    Apr 26 22:31:05 JayPrimes-MacBook-Pro.local installd[4122] <Notice>: 0xb0115000 MobileInstallationInstall_Server: Staging: 0.41s; Waiting: 0.00s; Installation: 0.21s; LS Sync: 0.00s; Overall: 0.63s
    Apr 26 22:31:05 JayPrimes-MacBook-Pro.local /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.1.sdk/usr/libexec/lsd[4132] <Error>: Need to synchronize with MobileInstallation
    Apr 26 22:31:05 JayPrimes-MacBook-Pro.local /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.1.sdk/usr/libexec/lsd[4132] <Notice>: LaunchServices: updating cache GUID and sequence number
    Apr 26 22:31:05 JayPrimes-MacBook-Pro.local lsd[4132] <Warning>: LaunchServices:(called by PID 4115) Identifiers file does not exist.
    Apr 26 22:31:05 JayPrimes-MacBook-Pro.local lsd[4132] <Warning>: LaunchServices:(called by PID 4115) Creating new identifiers file.
    Apr 26 22:31:05 JayPrimes-MacBook-Pro.local lsd[4132] <Warning>: LaunchServices: Updating identifier store
    Apr 26 22:31:05 JayPrimes-MacBook-Pro.local mediaremoted[4139] <Error>: Property list invalid for format: 200 (property lists cannot contain NULL)
    Apr 26 22:31:05 JayPrimes-MacBook-Pro.local SpringBoard[4126] <Error>: Normal message received by listener connection. Ignoring.
    Apr 26 22:31:05 --- last message repeated 2 times ---
    Apr 26 22:31:05 JayPrimes-MacBook-Pro.local SpringBoard[4126] <Warning>: could not find icon for representation -> com.sproutatwork.mobile
    Apr 26 22:31:05 JayPrimes-MacBook-Pro.local SpringBoard[4126] <Warning>: Using your own bundle identifier as an NSUserDefaults suite name does not make sense and will not work. Break on _NSUserDefaults_Log_Nonsensical_Suites to find this
    Apr 26 22:31:05 JayPrimes-MacBook-Pro.local SpringBoard[4126] <Warning>: Launch Services: Registering unknown app identifier com.apple.mobilemail failed
    Apr 26 22:31:05 JayPrimes-MacBook-Pro.local SpringBoard[4126] <Warning>: Launch Services: Unable to find app identifier com.apple.mobilemail
    Apr 26 22:31:05 JayPrimes-MacBook-Pro.local SpringBoard[4126] <Warning>: No conforming principal class found in NSBundle </Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.1.sdk/System/Library/BulletinBoardPlugins/SMSBBPlugin.bundle> (loaded)
    Apr 26 22:31:05 JayPrimes-MacBook-Pro.local SpringBoard[4126] <Warning>: Application windows are expected to have a root view controller at the end of application launch
    Apr 26 22:31:05 JayPrimes-MacBook-Pro.local SpringBoard[4126] <Error>: libMobileGestalt MobileGestalt.c:835: still-camera is static and will never generate a notification
    Apr 26 22:31:05 JayPrimes-MacBook-Pro.local SpringBoard[4126] <Error>: libMobileGestalt MobileGestalt.c:835: stand-alone-contacts is static and will never generate a notification
    Apr 26 22:31:05 JayPrimes-MacBook-Pro.local SpringBoard[4126] <Warning>: could not find icon for representation -> com.sproutatwork.mobile
    Apr 26 22:31:06 JayPrimes-MacBook-Pro.local locationd[4119] <Error>: Client '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.1.sdk/System/Library/CoreServices/SpringBoard.app/SpringBoard' is attempting to masquerade as uninstalled app with effective bundle identifier 'com.apple.reminders'
    Apr 26 22:31:06 JayPrimes-MacBook-Pro.local SimulatorBridge[4115] <Warning>: Application launched after 0.00 seconds.
    Apr 26 22:31:06 JayPrimes-MacBook-Pro.local SpringBoard[4126] <Warning>: SMS Plugin initialized.
    Apr 26 22:31:06 JayPrimes-MacBook-Pro.local SpringBoard[4126] <Warning>: Sharing Plugin initialized.
    Apr 26 22:31:06 JayPrimes-MacBook-Pro.local SpringBoard[4126] <Error>: Normal message received by listener connection. Ignoring.
    

2 个答案:

答案 0 :(得分:4)

当我更新ios平台时,我点击了WSoD,我认为(不确定)它还更新了一些插件。我完全无法调试问题,因为我没有任何控制台错误,而一切正常,没有实时重新加载。

事实证明问题出在白名单上。该应用程序根本不允许访问livereload服务器。我在config.xml添加了以下行,并且重新开始重新加载:

<allow-navigation href="*"/>

当然这是非常宽松的,不建议用于实际生产,但至少它可以解决问题。从技术上讲,如果不使用实时重载,这是不必要的,因此可以简单地省略生产。但是,如果担心安全问题,可以选择:

<allow-navigation href="*://localhost/*"/>

但是在执行此操作时,有必要在运行--address时添加emulate选项:

$ ionic emulate -lcs --address localhost ios

答案 1 :(得分:0)

在我的启动画面之后和我的cordova 3.6应用的第一页之前,我看到了一个白色屏幕。当我在平台iOS文件夹中安装org.apache.cordova.splashscreen插件并在autohidesplashscreen = false中创建config.xml时,问题就消失了。

然后,您可以使用以下方法隐藏设备中的启动画面:

document.addEventListener("deviceready", onDeviceReady, false);
        function onDeviceReady(){          
            console.log("ON DEVICE READY!!!");
            navigator.splashscreen.hide();
        }

要添加的另一件事是我仅使用.xcodeproj运行项目而不使用终端,我使用index.html内的platform/iOS