Open sylwesterdigital opened 5 years ago
@sylwesterdigital Thank you for reporting this. It seems like the socketIO plugin uses Starscream
CocoaPod which in its latest version requires Swift 5.0. In order to use it, you would have to update Xcode to version 10.2.
Thanks Martin. Seems the problem solved and you can close the issue. Just in case: In order to get Xcode 10.2 I was forced to update MacOS to Mojave 10.14.5 which took me few hours. I replicated my steps again and running iOS app is fine but logs are not 100% clean, see below
[...]
Xcode build...
vueclitemplate/platforms/ios/Pods/Starscream/Sources/Starscream/Compression.swift:59:25: warning: 'withUnsafeBytes' is deprecated: use `withUnsafeBytes<R>(_: (UnsafeRawBufferPointer) throws -> R) rethrows -> R` instead
return try data.withUnsafeBytes { (bytes:UnsafePointer<UInt8>) -> Data in
^
vueclitemplate/platforms/ios/Pods/Starscream/Sources/Starscream/Compression.swift:140:14: warning: 'withUnsafeBytes' is deprecated: use `withUnsafeBytes<R>(_: (UnsafeRawBufferPointer) throws -> R) rethrows -> R` instead
data.withUnsafeBytes { (ptr:UnsafePointer<UInt8>) -> Void in
^
vueclitemplate/platforms/ios/Pods/Starscream/Sources/Starscream/WebSocket.swift:282:30: warning: 'withUnsafeMutableBytes' is deprecated: use `withUnsafeMutableBytes<R>(_: (UnsafeMutableRawBufferPointer) throws -> R) rethrows -> R` instead
let _ = peerName.withUnsafeMutableBytes { (peerNamePtr: UnsafeMutablePointer<Int8>) in
^
vueclitemplate/platforms/ios/Pods/Starscream/Sources/Starscream/WebSocket.swift:1326:14: warning: 'withUnsafeBytes' is deprecated: use `withUnsafeBytes<R>(_: (UnsafeRawBufferPointer) throws -> R) rethrows -> R` instead
data.withUnsafeBytes { _ = CC_SHA1($0, CC_LONG(data.count), &digest) }
^
vueclitemplate/platforms/ios/Pods/Starscream/Sources/Starscream/WebSocket.swift:1327:16: warning: 'init(bytes:)' is deprecated: use `init(_:)` instead
return Data(bytes: digest).base64EncodedString()
^
[...]
Full history and log
$ vue init nativescript-vue/vue-cli-template vueclitemplate
? Project name vueclitemplate
? Project description A native application built with NativeScript-Vue
? Application name NativeScript-Vue Application
? Unique application identifier com.flaboy.vueclitemplate
? Project version 1.0.0
? Author Sylwester K. Mielniczuk <sylwester@mielniczuk.com>
? License MIT
? Select the programming language javascript
? Select a preset (more coming soon) Simple
? Install vuex? (state management) Yes
? Install vue-devtools? Yes
? Color scheme none
vue-cli · Generated "vueclitemplate".
vue-cli · cd vueclitemplate
vue-cli · npm install
vue-cli · tns run android --bundle
vue-cli · # or
vue-cli · tns run ios --bundle
vue-cli · --
vue-cli · You may also try the new HMR mode by replacing --bundle
vue-cli · with --hmr, but note that this is a beta feature.
$ cd vueclitemplate/
$ npm install
npm WARN deprecated bfj-node4@5.3.1: Switch to the `bfj` package for fixes and new features!
> fsevents@1.2.9 install vueclitemplate/node_modules/fsevents
> node install
node-pre-gyp WARN Using request for node-pre-gyp https download
[fsevents] Success: "vueclitemplate/node_modules/fsevents/lib/binding/Release/node-v67-darwin-x64/fse.node" is installed via remote
> node-sass@4.12.0 install vueclitemplate/node_modules/node-sass
> node scripts/install.js
Cached binary found at /Users/misiak/.npm/node-sass/4.12.0/darwin-x64-67_binding.node
> core-js@2.6.9 postinstall vueclitemplate/node_modules/core-js
> node scripts/postinstall || echo "ignore"
Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfilling JavaScript standard library!
The project needs your help! Please consider supporting of core-js on Open Collective or Patreon:
> https://opencollective.com/core-js
> https://www.patreon.com/zloirock
Also, the author of core-js ( https://github.com/zloirock ) is looking for a good job -)
> core-js-pure@3.1.3 postinstall vueclitemplate/node_modules/core-js-pure
> node scripts/postinstall || echo "ignore"
Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfilling JavaScript standard library!
The project needs your help! Please consider supporting of core-js on Open Collective or Patreon:
> https://opencollective.com/core-js
> https://www.patreon.com/zloirock
Also, the author of core-js ( https://github.com/zloirock ) is looking for a good job -)
> electron@1.7.16 postinstall vueclitemplate/node_modules/electron
> node install.js
> nativescript-dev-webpack@0.25.0-next-2019-06-07-145038-01 postinstall vueclitemplate/node_modules/nativescript-dev-webpack
> node postinstall.js
The current project contains a webpack.config.js file located at vueclitemplate/webpack.config.js that differs from the one in the new version of the nativescript-dev-webpack plugin located at vueclitemplate/node_modules/nativescript-dev-webpack/templates/webpack.vue.js. Some of the plugin features may not work as expected until you manually update the webpack.config.js file or automatically update it using "./node_modules/.bin/update-ns-webpack --configs" command.
NativeScript Webpack plugin was successfully added.
You can now bundle your project by passing --bundle flag to NativeScript CLI commands:
- tns build android --bundle
- tns build ios --bundle
- tns run android --bundle
- tns run ios --bundle
You can also pass the "--env.uglify" flag to use Terser for minification.
For more information check out https://docs.nativescript.org/tooling/bundling-with-webpack#bundling.
> nativescript-vue@2.2.2 postinstall vueclitemplate/node_modules/nativescript-vue
> node postinstall.js
> node-sass@4.12.0 postinstall vueclitemplate/node_modules/node-sass
> node scripts/build.js
Binary found at vueclitemplate/node_modules/node-sass/vendor/darwin-x64-67/binding.node
Testing binary
Binary is fine
> webpack-cli@3.3.3 postinstall vueclitemplate/node_modules/webpack-cli
> node ./bin/opencollective.js
Thanks for using Webpack!
Please consider donating to our Open Collective
to help us maintain this package.
👉 Donate: https://opencollective.com/webpack/donate
npm WARN ts-loader@5.4.5 requires a peer of typescript@* but none is installed. You must install peer dependencies yourself.
npm WARN vueclitemplate@1.0.0 No repository field.
added 1063 packages from 528 contributors and audited 17774 packages in 41.713s
found 2 moderate severity vulnerabilities
run `npm audit fix` to fix them, or `npm audit` for details
$ tns run ios --bundle
Skipping node_modules folder! Use the syncAllFiles option to sync files from this folder.
Searching for devices...
Running webpack for iOS...
Bundling application for entryPath ./main.js...
clean-webpack-plugin: vueclitemplate/platforms/ios/vueclitemplate/app/**/* has been removed.
File change detected. Starting incremental webpack compilation...
webpack is watching the files…
[BABEL] Note: The code generator has deoptimised the styling of node_modules/@vue/devtools/build/backend.js as it exceeds the max of 500KB.
Hash: IUYuyruyiououiuyiu
Version: webpack 4.33.0
Time: 11940ms
Built at: 06/08/2019 3:38:58 AM
Asset Size Chunks Chunk Names
App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/Contents.json 1.84 KiB [emitted]
App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-1024.png 57.1 KiB [emitted]
App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29.png 1.64 KiB [emitted]
App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29@2x.png 3.09 KiB [emitted]
App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29@3x.png 4.36 KiB [emitted]
App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40.png 2.29 KiB [emitted]
App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40@2x.png 4.47 KiB [emitted]
App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40@3x.png 6.41 KiB [emitted]
App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-60@2x.png 6.41 KiB [emitted]
App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-60@3x.png 9.15 KiB [emitted]
App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-76.png 4.25 KiB [emitted]
App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-76@2x.png 8.69 KiB [emitted]
App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-83.5@2x.png 9.74 KiB [emitted]
App_Resources/iOS/Assets.xcassets/Contents.json 62 bytes [emitted]
App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Contents.json 4.15 KiB [emitted]
App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-1125h.png 160 KiB [emitted]
App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-568h@2x.png 62.2 KiB [emitted]
App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-667h@2x.png 112 KiB [emitted]
App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-736h@3x.png 180 KiB [emitted]
App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape-X.png 165 KiB [emitted]
App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape.png 60.9 KiB [emitted]
App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape@2x.png 187 KiB [emitted]
App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape@3x.png 198 KiB [emitted]
App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Portrait.png 59.5 KiB [emitted]
App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Portrait@2x.png 182 KiB [emitted]
App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default.png 20.3 KiB [emitted]
App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default@2x.png 61.4 KiB [emitted]
App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/Contents.json 373 bytes [emitted]
App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/LaunchScreen-AspectFill.png 1.67 KiB [emitted]
App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/LaunchScreen-AspectFill@2x.png 3.9 KiB [emitted]
App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/Contents.json 365 bytes [emitted]
App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/LaunchScreen-Center.png 65.3 KiB [emitted]
App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/LaunchScreen-Center@2x.png 202 KiB [emitted]
App_Resources/iOS/Info.plist 1.45 KiB [emitted]
App_Resources/iOS/LaunchScreen.storyboard 3.84 KiB [emitted]
App_Resources/iOS/build.xcconfig 504 bytes [emitted]
assets/images/NativeScript-Vue.png 8.22 KiB [emitted]
bundle.js 20.1 KiB bundle [emitted] bundle
package.json 135 bytes [emitted]
vendor.js 2.23 MiB vendor [emitted] vendor
Entrypoint bundle = vendor.js bundle.js
[./ sync ^\.\/app\.(css|scss|less|sass)$] . sync nonrecursive ^\.\/app\.(css|scss|less|sass)$ 175 bytes {bundle} [built]
[./ sync recursive (root|page)\.(xml|css|js|ts|scss)$] . sync (root|page)\.(xml|css|js|ts|scss)$ 160 bytes {bundle} [built]
[./app.scss] 334 bytes {bundle} [optional] [built]
[./main.js] 1.44 KiB {bundle} [built]
[./package.json] 120 bytes {bundle} [optional] [built]
[./store.js] 142 bytes {bundle} [built]
+ 169 hidden modules
Webpack compilation complete. Watching for file changes.
Webpack build done!
Copying template files...
Platform ios successfully added. v5.0.0
Preparing project...
Runtime versions lower than 5.1.0 have been deprecated and will not be supported as of v6.0.0 of NativeScript CLI. More info can be found in this issue https://github.com/NativeScript/nativescript-cli/issues/4518.
Installing pods...
Ignoring ffi-1.9.21 because its extensions are not built. Try: gem pristine ffi --version 1.9.21
Analyzing dependencies
Pre-downloading: `Socket.IO-Client-Swift` from `https://github.com/triniwiz/socket.io-client-swift.git`
Downloading dependencies
Installing Socket.IO-Client-Swift (15.1.0)
Installing Starscream (3.1.0)
Installing Toast (3.1.0)
Generating Pods project
Integrating client project
[!] Please close any current Xcode sessions and use `vueclitemplate.xcworkspace` for this project from now on.
Sending stats
Pod installation complete! There are 2 dependencies from the Podfile and 3 total pods installed.
[!] Automatically assigning platform `ios` with version `9.0` on target `vueclitemplate` because no platform was specified. Please specify a platform for this target in your Podfile. See `https://guides.cocoapods.org/syntax/podfile.html#platform`.
Project successfully prepared (iOS)
Building project...
Xcode requires a team id to be specified when building for device.
You can specify the team id by setting the DEVELOPMENT_TEAM setting in build.xcconfig file located in App_Resources folder of your app, or by using the --teamId option when calling run, debug or livesync commands.
Found and using the following development team installed on your system: S Mielniczuk (097098DUUY)
Xcode build...
vueclitemplate/platforms/ios/Pods/Starscream/Sources/Starscream/Compression.swift:59:25: warning: 'withUnsafeBytes' is deprecated: use `withUnsafeBytes<R>(_: (UnsafeRawBufferPointer) throws -> R) rethrows -> R` instead
return try data.withUnsafeBytes { (bytes:UnsafePointer<UInt8>) -> Data in
^
vueclitemplate/platforms/ios/Pods/Starscream/Sources/Starscream/Compression.swift:140:14: warning: 'withUnsafeBytes' is deprecated: use `withUnsafeBytes<R>(_: (UnsafeRawBufferPointer) throws -> R) rethrows -> R` instead
data.withUnsafeBytes { (ptr:UnsafePointer<UInt8>) -> Void in
^
vueclitemplate/platforms/ios/Pods/Starscream/Sources/Starscream/WebSocket.swift:282:30: warning: 'withUnsafeMutableBytes' is deprecated: use `withUnsafeMutableBytes<R>(_: (UnsafeMutableRawBufferPointer) throws -> R) rethrows -> R` instead
let _ = peerName.withUnsafeMutableBytes { (peerNamePtr: UnsafeMutablePointer<Int8>) in
^
vueclitemplate/platforms/ios/Pods/Starscream/Sources/Starscream/WebSocket.swift:1326:14: warning: 'withUnsafeBytes' is deprecated: use `withUnsafeBytes<R>(_: (UnsafeRawBufferPointer) throws -> R) rethrows -> R` instead
data.withUnsafeBytes { _ = CC_SHA1($0, CC_LONG(data.count), &digest) }
^
vueclitemplate/platforms/ios/Pods/Starscream/Sources/Starscream/WebSocket.swift:1327:16: warning: 'init(bytes:)' is deprecated: use `init(_:)` instead
return Data(bytes: digest).base64EncodedString()
^
note: Using new build systemnote: Planning buildnote: Constructing build description
Xcode build...
2019-06-08 03:39:59.384 xcodebuild[72014:688305] [MT] IDEDistribution: -[IDEDistributionLogging _createLoggingBundleAtPath:]: Created bundle at path '/var/folders/m6/3gy_fdtx795fbqn26p8mc3z40000gn/T/vueclitemplate_2019-06-08_03-39-59.381.xcdistributionlogs'.
Exported vueclitemplate to: vueclitemplate/platforms/ios/build/Debug-iphoneos
Project successfully built.
Installing on device ce90205f14de7e7f79899580ada08e0672f979ce...
Successfully installed on device with identifier 'ce90205f14de7e7f79899580ada08e0672f979ce'.
Restarting application on device ce90205f14de7e7f79899580ada08e0672f979ce...
Unzipping LiveSync folder. This could take a while...
Unzipped 4 entries in 27.261972ms.
tns_modules folder not livesynced. Using tns_modules from the already deployed bundle...
Retrieving resting unlock: 0
Faulting in NSHTTPCookieStorage singleton
Faulting in CFHTTPCookieStorage singleton
Creating default cookie storage with default identifier
TIC TCP Conn Start [1:0x1c0174b80]
Task <0E77E14E-07FA-49B4-936B-B0D1E3EB0A84>.<1> setting up Connection 1
[1 <private> <private>] start
TIC TCP Conn Event [1:0x1c0174b80]: 3
TIC TCP Conn Failed [1:0x1c0174b80]: 1:61 Err(61)
TIC TCP Conn Cancel [1:0x1c0174b80]
Task <0E77E14E-07FA-49B4-936B-B0D1E3EB0A84>.<1> HTTP load failed (error code: -1004 [1:61])
[1 <private> stream, pid: 262, url: http://127.0.0.1:8098/socket.io/?transport=polling&b64=1] cancelled. Events:
0.000s [1 28B947E7-8B17-4072-8BBC-BFCC919E8D9D 127.0.0.1:49603-><private> socket-flow] path:start
0.000s [1 28B947E7-8B17-4072-8BBC-BFCC919E8D9D 127.0.0.1:49603-><private> socket-flow] path:satisfied
Task <0E77E14E-07FA-49B4-936B-B0D1E3EB0A84>.<1> finished with error - code: -1004
0.002s [1 28B947E7-8B17-4072-8BBC-BFCC919E8D9D 127.0.0.1:49603-><private> socket-flow] flow:start_connect
0.007s [1 28B947E7-8B17-4072-8BBC-BFCC919E8D9D 127.0.0.1:49603-><private> socket-flow] flow:failed_connect Error Domain=kNWErrorDomainPOSIX Code=61 "Connection refused" UserInfo={NSDescription=Connection refused}
0.008s [1] path:cancel
CONSOLE LOG file:///app/vendor.js:15970:14: '{NSVue (Vue: 2.5.22 | NSVue: 2.2.2)} -> CreateElement(NativeFrame)'
Successfully synced application com.flaboy.vueclitemplate on device ce90205f14de7e7f79899580ada08e0672f979ce.
CONSOLE LOG file:///app/vendor.js:15970:14: '{NSVue (Vue: 2.5.22 | NSVue: 2.2.2)} -> CreateElement(NativePage)'
CONSOLE LOG file:///app/vendor.js:15970:14: '{NSVue (Vue: 2.5.22 | NSVue: 2.2.2)} -> CreateElement(NativeActionBar)'
CONSOLE LOG file:///app/vendor.js:15970:14: '{NSVue (Vue: 2.5.22 | NSVue: 2.2.2)} -> AppendChild(ElementNode(nativepage), ElementNode(nativeactionbar))'
CONSOLE LOG file:///app/vendor.js:15970:14: '{NSVue (Vue: 2.5.22 | NSVue: 2.2.2)} -> CreateElement(nativegridlayout)'
CONSOLE LOG file:///app/vendor.js:15970:14: '{NSVue (Vue: 2.5.22 | NSVue: 2.2.2)} -> CreateElement(nativelabel)'
CONSOLE LOG file:///app/vendor.js:15970:14: '{NSVue (Vue: 2.5.22 | NSVue: 2.2.2)} -> AppendChild(ElementNode(nativegridlayout), ElementNode(nativelabel))'
CONSOLE LOG file:///app/vendor.js:15970:14: '{NSVue (Vue: 2.5.22 | NSVue: 2.2.2)} -> AppendChild(ElementNode(nativepage), ElementNode(nativegridlayout))'
CONSOLE LOG file:///app/vendor.js:15970:14: '{NSVue (Vue: 2.5.22 | NSVue: 2.2.2)} -> AppendChild(ElementNode(nativeframe), ElementNode(nativepage))'
TIC TCP Conn Start [2:0x1c01759c0]
Task <CDD16C4B-D4EA-4814-85E7-1D107C2F0CB4>.<1> setting up Connection 2
[2 <private> <private>] start
TIC TCP Conn Event [2:0x1c01759c0]: 3
TIC TCP Conn Failed [2:0x1c01759c0]: 1:61 Err(61)
TIC TCP Conn Cancel [2:0x1c01759c0]
Task <CDD16C4B-D4EA-4814-85E7-1D107C2F0CB4>.<1> HTTP load failed (error code: -1004 [1:61])
[2 <private> stream, pid: 262, url: http://127.0.0.1:8098/socket.io/?transport=polling&b64=1] cancelled. Events:
0.000s [2 641684FB-E3B8-4681-B821-64A2E838D670 127.0.0.1:49604-><private> socket-flow] path:start
Task <CDD16C4B-D4EA-4814-85E7-1D107C2F0CB4>.<1> finished with error - code: -1004
0.001s [2 641684FB-E3B8-4681-B821-64A2E838D670 127.0.0.1:49604-><private> socket-flow] path:satisfied
0.001s [2 641684FB-E3B8-4681-B821-64A2E838D670 127.0.0.1:49604-><private> socket-flow] flow:start_connect
0.003s [2 641684FB-E3B8-4681-B821-64A2E838D670 127.0.0.1:49604-><private> socket-flow] flow:failed_connect Error Domain=kNWErrorDomainPOSIX Code=61 "Connection refused" UserInfo={NSDescription=Connection refused}
0.004s [2] path:cancel
got GAX status change notification. on: 0
got GAX status change notification. on: 0
Just ran into this as well... not the build error, but unclean logs ending with
warning: 'init(bytes:)' is deprecated: use
init(_:)instead return Data(bytes: digest).base64EncodedString()
Any fix for this?
I have this same error but, somehow, a time after show the error the console goes normal and run on iOS... How can we fix that?
I just build the project directly from Xcode (...project_path/platforms/ios/project_name.xcworkspace), when success, back to tns run android and it just worked...
Environment
tns info
No plugins, fresh vue template ie
Bug, can not create ARCHIVE and can not run iOS app, ie
Just wasted whole day and thinking about... SwiftUI :) Any idea how to fix this?
Additional info