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

Failed to find module with absolute path, crash in DEMO on Android #37

Closed
guru1966 opened this issue Sep 29, 2016 · 10 comments
Closed

Failed to find module with absolute path, crash in DEMO on Android #37

guru1966 opened this issue Sep 29, 2016 · 10 comments

Comments

@guru1966
Copy link

Hello !

I have done the following:
$ git clone https://github.com/bradmartin/nativescript-videoplayer.git
$ cd nativescript-videoplayer/demo
$tns install
$ tns --version
2.3.0
$tns run android

Here is crash log. I could repeatedly reproduce this crash on emulator or device no matter what I do.
Something you see I am doing wrong?

device-2016-09-29-201021

@bradmartin
Copy link
Collaborator

Well it shouldn't be looking in your app/ folder for the module, it's in node_modules. Did you change the path on the <Page xmlns=""> pointing to the plugin?

@bradmartin
Copy link
Collaborator

Another thing I never run tns install - I run build then run or livesync to start working.

So it's possible something went wrong during that step and the module never was installed correctly.

@guru1966
Copy link
Author

Ok, following steps were done:
$ rm -rf nativescript-videoplayer
$ git clone https://github.com/bradmartin/nativescript-videoplayer.git
$ cd nativescript-videoplayer/demo
$adb uninstall org.nativescript.demo
Success
$ tns build android
$ tns build run

Still same crash as before.

In my main-page.xml I have the following:

...
Should I change the path to xmlns:Video to something else than above inside Demo-app?

@bradmartin
Copy link
Collaborator

if you aren't modifying the demo then it should work, let me do a test run of it

@bradmartin
Copy link
Collaborator

bradmartin commented Sep 29, 2016

oh I think I know, it's likely not transpiling the TS. I manually do that just by habit. I bet that's the issue so if you went and looked in your node_modules you won't see any .js files - shouldn't even have the .ts source files. Let me know if you have nothing in the videoplayer folder in node_modules. there should be a few scripts you can run to prepare the demo and one of them handles the tsc command to transpile the source. After looking at the package.json this plugin I didn't ship with the scripts to prepare the demo and other things, my fault there. Before you run the app, go into the root where the plugin source is and kickoff the compiler via tsc then when you run the app you will have the .js source files in the node_modules where they should be.

@guru1966
Copy link
Author

I can only see .ts source files inside node_modules/nativescript-videoplayer/. Seems not compiled to .js source files. You maybe right regarding this. How to resolve that?

skarmavbild 2016-09-29 kl 21 06 53

@bradmartin
Copy link
Collaborator

run tsc in your terminal - when at the plugin source. So path to nativescript-videoplayer (the root of the cloned repo and run tsc you'll see it process and then you'll have .js files in the root for the plugin, then path to the demo project. Last run or livesync should prepare the plugin which should update the source in the node_modules for the videoplayer and then it will work.

@guru1966
Copy link
Author

Yes, running tsc and creating .js files inside nativescript-videoplayer resolved it ! Thank you !

@bradmartin
Copy link
Collaborator

Yea - I need to add the scripts to the package.json and doc it on the readme. Might do that later 👍

@bradmartin
Copy link
Collaborator

Copied some scripts over from another project, should fix the issue going forward to not skip the transpile step - didn't test though.

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

2 participants