ios - NativeScript 应用程序无法在 IOS 上运行

标签 ios nativescript angular2-nativescript

我正在评估 nativescript,但我无法让它在 IOS 上运行。不过,在 Android 设备/模拟器上运行时(来自 Mac),这一切都运行良好。

我根据 tutorial 设置了所有内容在 nativescript 网站上,并再次尝试重新结帐 angular2-seed-advanced .

  • 上运行时IOS模拟器应用程序启动,但不要越过初始屏幕(杂货显示其自己的 Logo ,播种 nativescript Logo )。
    Successfully deployed on device with identifier 'yyyyyyyyyyyyyyyyyyyyy'.
    Aug 30 00:13:35 macmini com.apple.CoreSimulator.SimDevice.yyyyyyyyyyyyyyyyyyyyy.launchd_sim[59384] (UIKitApplication:org.nativescript.groceries[0x9af7][60400]): Service exited due to signal: Killed: 9
    
  • 当试图在 上运行时IOS设备 (iPhone 5),我在尝试部署过程中遇到另一个错误(两个项目相同),因此应用程序甚至没有部署到设备上。似乎依赖于 nativescript(FiberFuture?)在等待物理设备回调时没有得到解决(模拟器似乎通过了这一步)。
    TypeError: Cannot read property 'id' of undefined
    at FiberFuture.Future.wait (/usr/local/lib/node_modules/nativescript/node_modules/fibers/future.js:566:15)
    at /usr/local/lib/node_modules/nativescript/lib/common/errors.js:128:33
    

    查看完整的 --log 跟踪
    macmini:nativescript xxx$ tns run ios --log trace
    execFile: /usr/local/opt/android-sdk/platform-tools/adb "help"
    execFile: /usr/local/opt/android-sdk/platform-tools/adb "help"
    spawn: /usr/local/opt/android-sdk/platform-tools/adb "--help"
    Socket {
      connecting: false,
      _hadError: false,
      _handle: 
       Pipe {
         bytesRead: 0,
         _externalStream: {},
         fd: 15,
         writeQueueSize: 0,
         owner: [Circular],
         onread: [Function: onread],
         reading: true },
      _parent: null,
      _host: null,
      _readableState: 
       ReadableState {
         objectMode: false,
         highWaterMark: 16384,
         buffer: BufferList { head: null, tail: null, length: 0 },
         length: 0,
         pipes: null,
         pipesCount: 0,
         flowing: null,
         ended: false,
         endEmitted: false,
         reading: true,
         sync: false,
         needReadable: true,
         emittedReadable: false,
         readableListening: false,
         resumeScheduled: false,
         defaultEncoding: 'utf8',
         ranOut: false,
         awaitDrain: 0,
         readingMore: false,
         decoder: null,
         encoding: null },
      readable: true,
      domain: null,
      _events: 
       { end: { [Function: g] listener: [Function: onend] },
         finish: [Function: onSocketFinish],
         _socketEnd: [Function: onSocketEnd],
         close: [Function] },
      _eventsCount: 4,
      _maxListeners: undefined,
      _writableState: 
       WritableState {
         objectMode: false,
         highWaterMark: 16384,
         needDrain: false,
         ending: false,
         ended: false,
         finished: false,
         decodeStrings: false,
         defaultEncoding: 'utf8',
         length: 0,
         writing: false,
         corked: 0,
         sync: true,
         bufferProcessing: false,
         onwrite: [Function],
         writecb: null,
         writelen: 0,
         bufferedRequest: null,
         lastBufferedRequest: null,
         pendingcb: 0,
         prefinished: false,
         errorEmitted: false,
         bufferedRequestCount: 0,
         corkedRequestsFree: CorkedRequest { next: null, entry: null, finish: [Function] } },
      writable: false,
      allowHalfOpen: false,
      destroyed: false,
      _bytesDispatched: 0,
      _sockname: null,
      _writev: null,
      _pendingData: null,
      _pendingEncoding: '',
      server: null,
      _server: null }
    Exec uname -a 
     stdout: Darwin macmini 15.6.0 Darwin Kernel Version 15.6.0: Thu Jun 23 18:25:34 PDT 2016; root:xnu-3248.60.10~1/RELEASE_X86_64 x86_64
    
     stderr: 
    Exec npm -v 
     stdout: 3.10.3
    
     stderr: 
    spawn: java "-version"
    Exec node-gyp -v 
     stdout: v3.4.0
    
     stderr: 
    Exec xcodebuild -version 
     stdout: Xcode 7.3.1
    Build version 7D1014
    
     stderr: 
    Exec gem which xcodeproj 
     stdout: /Users/rob/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/xcodeproj-1.2.0/lib/xcodeproj.rb
    
     stderr: 
    Exec pod --version 
     stdout: 1.0.1
    
     stderr: 
    Exec '/usr/local/opt/android-sdk/platform-tools/adb' version 
     stdout: Android Debug Bridge version 1.0.36
    Revision af05c7354fe1-android
    
     stderr: 
    spawn: /usr/local/opt/android-sdk/tools/android "-h"
    Result when throw error is false:
    { stdout: '\n       Usage:\n       android [global options] action [action options]\n       Global options:\n  -s --silent     : Silent mode, shows errors only.\n  -v --verbose    : Verbose mode, shows errors, warnings and all messages.\n     --clear-cache: Clear the SDK Manager repository manifest cache.\n  -h --help       : Help on a specific command.\n\n                                                                    Valid\n                                                                    actions\n                                                                    are\n                                                                    composed\n                                                                    of a verb\n                                                                    and an\n                                                                    optional\n                                                                    direct\n                                                                    object:\n-    sdk              : Displays the SDK Manager window.\n-    avd              : Displays the AVD Manager window.\n-   list              : Lists existing targets or virtual devices.\n-   list avd          : Lists existing Android Virtual Devices.\n-   list target       : Lists existing targets.\n-   list device       : Lists existing devices.\n-   list sdk          : Lists remote SDK repository.\n- create avd          : Creates a new Android Virtual Device.\n-   move avd          : Moves or renames an Android Virtual Device.\n- delete avd          : Deletes an Android Virtual Device.\n- update avd          : Updates an Android Virtual Device to match the folders\n                        of a new SDK.\n- create project      : Creates a new Android project.\n- update project      : Updates an Android project (must already have an\n                        AndroidManifest.xml).\n- create test-project : Creates a new Android project for a test package.\n- update test-project : Updates the Android project for a test package (must\n                        already have an AndroidManifest.xml).\n- create lib-project  : Creates a new Android library project.\n- update lib-project  : Updates an Android library project (must already have\n                        an AndroidManifest.xml).\n- create uitest-project: Creates a new UI test project.\n- update adb          : Updates adb to support the USB devices declared in the\n                        SDK add-ons.\n- update sdk          : Updates the SDK by suggesting new platforms to install\n                        if available.\n',
      stderr: '',
      exitCode: 1 }
    Exec mono --version 
     stdout: Mono JIT compiler version 4.4.1 (Nightly 4.4.1.0/4747417 Tue Jul  5 17:44:19 BST 2016)
    Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
            TLS:           normal
            SIGSEGV:       altstack
            Notification:  kqueue
            Architecture:  amd64
            Disabled:      none
            Misc:          softdebug 
            LLVM:          supported, not enabled.
            GC:            sgen
    
     stderr: 
    Exec git --version 
     stdout: git version 2.7.4 (Apple Git-66)
    
     stderr: 
    Exec gradle -v 
     stdout:  
     stderr: /bin/sh: gradle: command not found
    
    Exec "javac" -version 
     stdout:  
     stderr: javac 1.8.0_102
    
    System information:
    { procInfo: 'nativescript/2.2.1',
      platform: 'darwin',
      os: 'Darwin macmini 15.6.0 Darwin Kernel Version 15.6.0: Thu Jun 23 18:25:34 PDT 2016; root:xnu-3248.60.10~1/RELEASE_X86_64 x86_64\n',
      shell: '/bin/bash',
      dotNetVer: null,
      procArch: 'x64',
      nodeVer: 'v6.3.1',
      npmVer: '3.10.3',
      javaVer: '1.8.0',
      nodeGypVer: 'v3.4.0\n',
      xcodeVer: 'Xcode 7.3.1\nBuild version 7D1014\n',
      xcodeprojGemLocation: '/Users/rob/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/xcodeproj-1.2.0/lib/xcodeproj.rb\n',
      itunesInstalled: true,
      cocoapodVer: '1.0.1',
      adbVer: 'Android Debug Bridge version 1.0.36',
      androidInstalled: true,
      monoVer: '4.4.1',
      gitVer: '2.7.4 (Apple Git-66)',
      gradleVer: null,
      javacVersion: '1.8.0_102' }
    Initializing analytics statuses.
    Analytics statuses: 
    { TrackFeatureUsage: 1, TrackExceptions: 1 }
    Trying to track feature 'CLI' with value 'run'.
    Looking for project in '/Users/xxx/workspace/angular2-seed-advanced/nativescript'
    Project directory is '/Users/xxx/workspace/angular2-seed-advanced/nativescript'.
    Analytics statuses: 
    { TrackFeatureUsage: 1, TrackExceptions: 1 }
    Trying to track feature 'CLI' with value 'run|ios'.
    startLookingForDevices; platform is iOS
    Found device with identifier 'c28457499xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
    Exec ps cax | grep launchd_sim 
     stdout: 51449   ??  S      0:01.63 launchd_sim
    
     stderr: 
    TypeError: Cannot read property 'id' of undefined
        at FiberFuture.Future.wait (/usr/local/lib/node_modules/nativescript/node_modules/fibers/future.js:566:15)
        at /usr/local/lib/node_modules/nativescript/lib/common/errors.js:128:33
        at Function.settle (/usr/local/lib/node_modules/nativescript/node_modules/fibers/future.js:249:26)
        at FiberFuture.Future.wait (/usr/local/lib/node_modules/nativescript/node_modules/fibers/future.js:565:10)
        at /usr/local/lib/node_modules/nativescript/lib/common/services/commands-service.js:84:106
        at Function.settle (/usr/local/lib/node_modules/nativescript/node_modules/fibers/future.js:249:26)
        at FiberFuture.Future.wait (/usr/local/lib/node_modules/nativescript/node_modules/fibers/future.js:565:10)
        at /usr/local/lib/node_modules/nativescript/lib/common/yok.js:208:124
        at Function.settle (/usr/local/lib/node_modules/nativescript/node_modules/fibers/future.js:249:26)
        at FiberFuture.Future.wait (/usr/local/lib/node_modules/nativescript/node_modules/fibers/future.js:565:10)
        at /usr/local/lib/node_modules/nativescript/lib/common/services/commands-service.js:51:55
        at Function.settle (/usr/local/lib/node_modules/nativescript/node_modules/fibers/future.js:249:26)
        at FiberFuture.Future.wait (/usr/local/lib/node_modules/nativescript/node_modules/fibers/future.js:565:10)
        at /usr/local/lib/node_modules/nativescript/lib/common/errors.js:128:33
        at Function.settle (/usr/local/lib/node_modules/nativescript/node_modules/fibers/future.js:249:26)
        at FiberFuture.Future.wait (/usr/local/lib/node_modules/nativescript/node_modules/fibers/future.js:565:10)
        - - - - -
        at IOSSimulator.Object.defineProperty.get [as deviceInfo] (/usr/local/lib/node_modules/nativescript/lib/common/mobile/ios/simulator/ios-simulator-device.js:15:43)
        at IOSSimulatorDiscovery.DeviceDiscovery.addDevice (/usr/local/lib/node_modules/nativescript/lib/common/mobile/mobile-core/device-discovery.js:16:28)
        at IOSSimulatorDiscovery.createAndAddDevice (/usr/local/lib/node_modules/nativescript/lib/common/mobile/mobile-core/ios-simulator-discovery.js:58:14)
        at IOSSimulatorDiscovery.checkForDevices (/usr/local/lib/node_modules/nativescript/lib/common/mobile/mobile-core/ios-simulator-discovery.js:27:26)
        at IOSSimulatorDiscovery.startLookingForDevices (/usr/local/lib/node_modules/nativescript/lib/common/mobile/mobile-core/ios-simulator-discovery.js:20:21)
        at /usr/local/lib/node_modules/nativescript/lib/common/mobile/mobile-core/devices-service.js:215:50
        at Function.settle (/usr/local/lib/node_modules/nativescript/node_modules/fibers/future.js:249:26)
        at FiberFuture.Future.wait (/usr/local/lib/node_modules/nativescript/node_modules/fibers/future.js:565:10)
        at /usr/local/lib/node_modules/nativescript/lib/common/mobile/mobile-core/devices-service.js:330:48
        at Function.settle (/usr/local/lib/node_modules/nativescript/node_modules/fibers/future.js:249:26)
        at FiberFuture.Future.wait (/usr/local/lib/node_modules/nativescript/node_modules/fibers/future.js:565:10)
        at /usr/local/lib/node_modules/nativescript/lib/services/platform-service.js:366:103
        at Function.settle (/usr/local/lib/node_modules/nativescript/node_modules/fibers/future.js:249:26)
        at FiberFuture.Future.wait (/usr/local/lib/node_modules/nativescript/node_modules/fibers/future.js:565:10)
        at /usr/local/lib/node_modules/nativescript/lib/services/platform-service.js:402:58
        at Function.settle (/usr/local/lib/node_modules/nativescript/node_modules/fibers/future.js:249:26)
    Analytics statuses: 
    { TrackFeatureUsage: 1, TrackExceptions: 1 }
    Trying to track feature 'CLI' with value 'help'.
    List of registered commands: /?, appstore, appstore|upload, autocomplete, autocomplete|disable, autocomplete|enable, autocomplete|status, build, build|android, build|ios, create, debug, debug|android, debug|ios, deploy, dev-generate-help, dev-generate-messages, dev-post-install, dev-preuninstall, dev-test, dev-test|android, dev-test|ios, device, device|android, device|get-file, device|ios, device|list-applications, device|list-files, device|log, device|put-file, device|run, device|stop, device|uninstall, doctor, emulate, emulate|android, emulate|ios, error-reporting, help, info, init, install, livesync, platform, platform|add, platform|clean, platform|remove, platform|update, plugin, plugin|add, plugin|find, plugin|install, plugin|remove, plugin|search, plugin|update, prepare, publish, publish|ios, run, run|android, run|ios, test, test|android, test|init, test|ios, usage-reporting
    Reading help for command 'run|ios'. FileName is 'run-ios.md'.
    

  • 对此的任何帮助将不胜感激!

    谢谢,

    最佳答案

    我认为您应该尝试使用低于 6 的 Node 版本,

    Nativescript Manual Setup 提到“最新的 Node.js 0.10.x, 0.12.x, 4.x or 5.x stable 正式版”

    您可以使用 NVM 设置要使用的节点版本(节点版本管理)

    我希望这能解决您的问题。

    关于ios - NativeScript 应用程序无法在 IOS 上运行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39216201/

    相关文章:

    ios - 如何向原型(prototype)单元格添加两个以上的标签?

    android - 跨平台图像处理库

    javascript - Nativescript slider 值延迟

    android - native 脚本错误。在列表模板中找到多个 View

    angularjs - 页面加载时 NativeScript 无法获取或设置 UI 属性

    ios - 为什么我在尝试扫描 QR 码时在 Expo 中收到此错误?

    ios - 如何使用swift在IOS App中缓存过期图像

    NativeScript Hello World 应用大小

    android - NativeScript : custom camera view

    Angular 导航强制新组件