Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does not run on simulator using LiveSync #5

Closed
raefa opened this issue Mar 12, 2016 · 16 comments
Closed

Does not run on simulator using LiveSync #5

raefa opened this issue Mar 12, 2016 · 16 comments

Comments

@raefa
Copy link

raefa commented Mar 12, 2016

Hello,

I was wondering if anyone else was experiencing this ... and has a solution. When I run this on the simulator ($ tns livesync ios --device --watch) and my controller calls loader.show(); the app crashes. This is in the log:

file:///app/tns_modules/nativescript-loading-indicator/loading-indicator.js:4:23: JS ERROR ReferenceError: Can't find variable: MBProgressHUD
Mar 12 15:00:15 192-168-1-101 com.apple.CoreSimulator.SimDevice.85E6BA3D-FD7F-4E98-B3D4-A40B4DDC6816.launchd_sim[98734] (UIKitApplication:*****************[0x6aba][5358]): Service exited due to signal: Segmentation fault: 11

It works fine on a device (tns run ios --release) and on the simulator without livesync ($ tns run ios --emulator)

FYI

$ gem which cocoapods
/Users/raef/.rvm/gems/ruby-2.2.1@global/gems/cocoapods-0.39.0/lib/cocoapods.rb
$ tns --version
1.6.1
@maknz
Copy link
Contributor

maknz commented Mar 12, 2016

That's very weird. Seems as though the MBProgressHUD constant which should be available by means of the JS bridge isn't being found when livesyncing.

I'll see if the {N} guys know what might be up. Could be a bug in livesync.

@raefa
Copy link
Author

raefa commented Mar 12, 2016

@maknz you might be on to something there. I just experience the same error with another module (https://www.npmjs.com/package/nativescript-toast) with LiveSync ... although I am not 100% sure about that because I can't build that in the simulator either. I can on a device!!!

file:///app/tns_modules/nativescript-toast/toast.js:9:19: JS ERROR ReferenceError: Can't find variable: JLToast
Mar 13 09:58:35 192-168-1-101 com.apple.CoreSimulator.SimDevice.85E6BA3D-FD7F-4E98-B3D4-A40B4DDC6816.launchd_sim[98734] (UIKitApplication:xxxxxxxxxxxxxxxx[0x39ee][12997]): Service exited due to signal: Segmentation fault: 11

@Daxito
Copy link

Daxito commented Mar 13, 2016

@maknz I also have that error "Can't find variable: JLToast" when trying to run the app, I thought this plugin was not supported or something and now I use snackbar instead.

@maknz
Copy link
Contributor

maknz commented Mar 13, 2016

Best report that to nativescript-toast then.

@Daxito
Copy link

Daxito commented Mar 13, 2016

@maknz agree, shouldn't even be mentioned here...

@m-abs
Copy link

m-abs commented Jul 20, 2016

Did you find a solution for this? It makes debugging troublesome.

@NathanWalker
Copy link
Owner

@Daxito @raefa The original issue reported here is related to an issue when starting a project for the first time using livesync. When doing so, no CocoaPods will be setup properly.
To resolve, run your project with this instead:

tns emulate ios

// or...

tns run android

Then after that, you will be able to run livesync with no issue 👍

@loyd-larazo
Copy link

@NathanWalker I have the same issue but emulate or run does not work for me either.

tns --version
2.1.1

@NathanWalker
Copy link
Owner

go ahead and upgrade to 2.2.1.
Then 'rm -rf node_modules platforms'
And rerun.

@relez
Copy link

relez commented Aug 31, 2016

Hello there, I am having the same issue, I am using Telerik AppBuilder for write/debug/build my projects, the latest {N} version available is 2.2.0. Will this situation prevent me to use this feature if I am using 2.2.0 or 2.1.0?

Thanks!

@NathanWalker
Copy link
Owner

Latest is 2.2.1. Shouldn't really matter though. I don't believe AppBuilder supports native plugins running in their debug mode?

@NathanWalker
Copy link
Owner

screen shot 2016-08-31 at 1 46 50 pm

@relez
Copy link

relez commented Aug 31, 2016

AppBuilder does, I am testing on an Android simulator and the plugin works fine, but in iOS doesnt. I am compiling the app in debug mode and installing it in my iPhone 6 via iTunes and the App crashes.

@relez
Copy link

relez commented Aug 31, 2016

This is a screenshot of my iPhone screen, I hope it means something for us.
img_1937

@NathanWalker
Copy link
Owner

Yep this error is indicative of the pod not installing.
rm -rf platforms/ios
Then re run using this first:
tns emulate ios

@rosen-vladimirov
Copy link

Hi @NathanWalker ,
I believe removing the platform and adding it again will not resolve all of the issues. Let me explain CLI's behavior for plugins which have nativescript key in their package.json.
As we know - in order to process the Podfile, NativeScript CLI requires adding a "nativescript" key in package.json of the plugin. This marks it as "nativescript" plugin. In the nativescript key, plugin authors can specify the minimum required version of ios and android runtime in order to use the plugin. So for example plugin's package.json may contain the following information:

"nativescript": {
     "platforms": {
      "android": "2.2.0",
      "ios": "2.2.1"
    }
}

This says to NativeScript CLI, that in case the Android platform version is 2.1.0, this plugin cannot be used. So when processing the node_modules of a project, this plugin will not be moved to platforms/android/src/... directory and will not be considered as part of the application.

So in the current case, if users have Android runtime 2.1.0 or iOS Runtime 2.2.0 (or earlier), they cannot use the plugin as NativeScript CLI will not add it to the native project.

Nathan, are these limitations necessary? Can we at least change the versions to 2.2.0 (or even earlier) and upload a new version of the plugin in npm. At the moment AppBuilder has 2.2.0 version of iOS runtime and the plugin cannot be used there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants