TobiasHennig / nativescript-toast

A NativeScript Toast Plugin for Android and iOS apps.
MIT License
67 stars 19 forks source link

SWIFT_VERSION is empty #41

Open kefahB opened 5 years ago

kefahB commented 5 years ago

Hi,

I upgrade to the last version 2.0.0 and I have this error :

error: Value for SWIFT_VERSION cannot be empty. (in target 'SBToaster')

NS : 5.1.1

Thanks

damikael commented 5 years ago

I'm facing same issue tns-ios: 5.2.0 nativescript-toast: ^2.0.0

piotrilski commented 5 years ago

I can suggest a workaround that has worked for me:

sudo gem uninstall cocoapods
sudo gem install cocoapods -v 1.5.3
rm -Rf platforms
tns prepare ios --release
mennolp098 commented 5 years ago

Same issue on cloud building via sidekick tns-ios: 5.2.0 nativescript-toast: ^2.0.0

Charliebegood commented 5 years ago

Same issue here. Local builds via sidekick on tns-ios:5.2.0

hypery2k commented 5 years ago

can you give nativescript-toast@2.0.0-develop-7 a try?

kefahB commented 5 years ago

Hi @hypery2k I tested with your propasal version, the App crash when display the msg ! please see below

***** Fatal JavaScript exception - application has been terminated. *****
Native stack trace:
1   0x1019cf370 NativeScript::reportFatalErrorBeforeShutdown(JSC::ExecState*, JSC::Exception*, bool)
2   0x1019ffdec NativeScript::FFICallback<NativeScript::ObjCMethodCallback>::ffiClosureCallback(ffi_cif*, void*, void**, void*)
3   0x102464494 ffi_closure_SYSV_inner
4   0x1024681b4 .Ldo_closure
5   0x19fcbb5a0 <redacted>
6   0x1ce791804 <redacted>
7   0x1ce1f7eb8 <redacted>
8   0x1ce1f81ec <redacted>
9   0x1ce1f718c <redacted>
10  0x1ce7ccdac <redacted>
11  0x1ce7ce00c <redacted>
12  0x1ce7ac4ac <redacted>
13  0x1ce880ad4 <redacted>
14  0x1ce88358c <redacted>
15  0x1ce87becc <redacted>
16  0x1a0a5451c <redacted>
17  0x1a0a54498 <redacted>
18  0x1a0a53d50 <redacted>
19  0x1a0a4ea08 <redacted>
20  0x1a0a4e2e8 CFRunLoopRunSpecific
21  0x1a2d02be8 GSEventRunModal
22  0x1ce790088 UIApplicationMain
23  0x102468044 ffi_call_SYSV
24  0x102463bb4 ffi_call_int
25  0x1024636b0 ffi_call
26  0x101994b80 NativeScript::FunctionWrapper::call(JSC::ExecState*)
27  0x102462758 llint_entry
28  0x102461bb4 llint_entry
29  0x102461bb4 llint_entry
30  0x102461bb4 llint_entry
31  0x10245a61c vmEntryToJavaScript
JavaScript stack trace:
1   makeText@file:///app/tns_modules/nativescript-toast/toast.js:9:51
2   pay@file:///app/src/ViewsModels/MainPageVm/MainPageVm.js:88:27
3   notify@file:///app/tns_modules/tns-core-modules/data/observable/observable.js:107:37
4   _emit@file:///app/tns_modules/tns-core-modules/data/observable/observable.js:127:24
5   tap@file:///app/tns_modules/tns-core-modules/ui/button/button.js:216:24
6   UIApplicationMain@[native code]
7   start@file:///app/tns_modules/tns-core-modules/application/application.js:275:26
8   run@file:///app/tns_modules/tns-core-modules/application/application.js:303:10
9   anonymous@file:///app/app.js:92:24
10  evaluate@[native code]
11  moduleEvaluation@[native code]
12  promiseReactionJob@[native code]
JavaScript error:
file:///app/tns_modules/nativescript-toast/toast.js:9:51: JS ERROR TypeError: Toast.alloc().initWithTextDelayDuration is not a function. (In 'Toast.alloc().initWithTextDelayDuration(text,0,d)', 'Toast.alloc().initWithTextDelayDuration' is undefined)
*** JavaScript call stack:
(
0   UIApplicationMain@[native code]
1   start@file:///app/tns_modules/tns-core-modules/application/application.js:275:26
2   run@file:///app/tns_modules/tns-core-modules/application/application.js:303:10
3   anonymous@file:///app/app.js:92:24
4   evaluate@[native code]
5   moduleEvaluation@:1:11
6   promiseReactionJob@:1:11
)
*** Terminating app due to uncaught exception 'NativeScript encountered a fatal error: TypeError: Toast.alloc().initWithTextDelayDuration is not a function. (In 'Toast.alloc().initWithTextDelayDuration(text,0,d)', 'Toast.alloc().initWithTextDelayDuration' is undefined)
at
1   makeText@file:///app/tns_modules/nativescript-toast/toast.js:9:51
2   pay@file:///app/src/ViewsModels/MainPageVm/MainPageVm.js:88:27
3   notify@file:///app/tns_modules/tns-core-modules/data/observable/observable.js:107:37
4   _emit@file:///app/tns_modules/tns-core-modules/data/observable/observable.js:127:24
5   tap@file:///app/tns_modules/tns-core-modules/ui/button/button.js:216:24
6   UIApplicationMain@[native code]
7   start@file:///app/tns_modules/tns-core-modules/application/application.js:275:26
8   run@file:///app/tns_modules/tns-core-modules/application/application.js:303:10
9   anonymous@file:///app/app.js:92:24
10  evaluate@[native code]
11  moduleEvaluation@[native code]
12  promiseReactionJob@[native code]
', reaso<\M-b\M^@\M-&>
note: Using new build systemnote: Planning buildnote: Constructing build description
hypery2k commented 5 years ago

give nativescript-toast@2.0.0-bugfix-swift4-12 a try, but run pod repo update before

mennolp098 commented 5 years ago

@hypery2k I just tried via cloud building, still getting the same error. I also tried something suggested by Vladimirov on the Slack community channel Sidekick which was adding a Podfile to App_Resources/ios/Podfile Podfile:

post_install do |installer|
  installer.pods_project.targets.each do |target|
      if ['SBToaster'].include? target.name
          target.build_configurations.each do |config|
              config.build_settings['SWIFT_VERSION'] = '3.2'
          end
      end
  end
end

This also did not work for me.

hypery2k commented 5 years ago

@mennolp098 which version did you tried?

mennolp098 commented 5 years ago

@hypery2k Both of your new builds: nativescript-toast@2.0.0-develop-7 and nativescript-toast@2.0.0-bugfix-swift4-12

kefahB commented 5 years ago

hey @hypery2k

I tried nativescript-toast@2.0.0-bugfix-swift4-1 and got crash :-(

***** Fatal JavaScript exception - application has been terminated. *****
Native stack trace:
1   0x10f890c4f NativeScript::reportFatalErrorBeforeShutdown(JSC::ExecState*, JSC::Exception*, bool)
2   0x10f8c62c0 NativeScript::FFICallback<NativeScript::ObjCMethodCallback>::ffiClosureCallback(ffi_cif*, void*, void**, void*)
3   0x1101e9d06 ffi_closure_unix64_inner
4   0x1101ea72a ffi_closure_unix64
5   0x110fdcc38 -[UIControl sendAction:to:forEvent:]
6   0x110fdcf51 -[UIControl _sendActionsForEvents:withEvent:]
7   0x110fdbe4d -[UIControl touchesEnded:withEvent:]
8   0x110ec4545 -[UIWindow _sendTouchesForEvent:]
9   0x110ec5c33 -[UIWindow sendEvent:]
10  0x110e729ab -[UIApplication sendEvent:]
11  0x11165f72d __dispatchPreprocessedEventFromEventQueue
12  0x111658463 __handleEventQueue
13  0x11454c761 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__
14  0x11453198c __CFRunLoopDoSources0
15  0x114530e76 __CFRunLoopRun
16  0x114530884 CFRunLoopRunSpecific
17  0x11592ea6f GSEventRunModal
18  0x110e54c68 UIApplicationMain
19  0x1101ea56d ffi_call_unix64
20  0x12d7c4410
JavaScript stack trace:
1   makeText@file:///app/tns_modules/nativescript-toast/toast.js:9:22
2   pay@file:///app/src/ViewsModels/MainPageVm/MainPageVm.js:88:27
3   notify@file:///app/tns_modules/tns-core-modules/data/observable/observable.js:107:37
4   _emit@file:///app/tns_modules/tns-core-modules/data/observable/observable.js:127:24
5   tap@file:///app/tns_modules/tns-core-modules/ui/button/button.js:216:24
6   UIApplicationMain@[native code]
7   start@file:///app/tns_modules/tns-core-modules/application/application.js:275:26
8   run@file:///app/tns_modules/tns-core-modules/application/application.js:303:10
9   anonymous@file:///app/app.js:92:24
10  evaluate@[native code]
11  moduleEvaluation@[native code]
12  promiseReactionJob@[native code]
JavaScript error:
file:///app/tns_modules/nativescript-toast/toast.js:9:22: JS ERROR TypeError: Toast.text is not a function. (In 'Toast.text(text,0,d)', 'Toast.text' is undefined)
kefahB commented 5 years ago

Is strange .. when I installed nativescript-toast@2.0.0-bugfix-swift4-1 I do pod update, then the CLI install Toaster (1.0.1) and when I reinstall 1.4.6 (work fine at the moment) it will install Toaster (2.0.4) !

How the new version of nativescript-toast install old version of Toaster (1.0.1) and vis-versa ?!

hypery2k commented 5 years ago

it's Toastr (just tried with my own Pod), I know confusing, but for now I'm not having any further idea why it's not working. Actually having no time to look further into this. Sorry about that.

mpanje-fanuel commented 5 years ago

Looks to me like this plugin is not yet compatible with Swift 4

A work-around suggested by drewster's on StackOverFlow worked for me, https://stackoverflow.com/a/53089593/5182662

Run command: export SWIFT_VERSION=3, then build your project as usual

peace-bi commented 5 years ago

You can create a Podfile in App_Resources/iOS and copy code below into Podfile:


pre_install do |installer|
  installer.analysis_result.specifications.each do |s|
      if s.name == 'SBToaster'
          s.swift_version = '4.2'
      end
  end
end