JoshDSommer / nativescript-slides

A NativeScript plugin that is for Intro Tutorials, Image Carousels or any other slide functionality
Other
70 stars 32 forks source link

tns-core-modules 3.0.0? #102

Closed Nikoms closed 7 years ago

Nikoms commented 7 years ago

Hello,

I saw that the code was ready to be used on 3.0 which is great. I still have a question about it, because I see in the package.json that tns-core-modules is still at a previous version (and on 3.0 branch, it's on the rc).

Is there any reason?

Thanks :)

JoshDSommer commented 7 years ago

That was the version it was developed with, however, it was tested with 3.0 and reported working. The dev dependencies won't have any impact on your application. Hope this helps.

Nikoms commented 7 years ago

Ok, understood. I thought it was used also to find the "best match" between all dependencies that I have.

I saw in another ticket that you had a blank page instead of slides and that it was resolved.

I have the exact same issue (on Android genymotion), you didn't do anything special?

I'm on tns 3.0.1, deleted platform/node_modules folders, but I still have the issue.

Any idea?

Nikoms commented 7 years ago

Here are my dependencies just in case:

  "dependencies": {
    "nativescript-floatingactionbutton": "^3.0.0",
    "nativescript-loading-indicator": "^2.2.2",
    "nativescript-pulltorefresh": "^2.0.0-rc.1",
    "nativescript-push-notifications": "^0.1.2",
    "nativescript-slides": "^2.2.8",
    "nativescript-telerik-ui": "^2.0.1",
    "nativescript-theme-core": "^1.0.4",
    "nativescript-toast": "^1.4.5",
    "object-assign": "^4.1.1",
    "tns-core-modules": "^3.0.0",
    "tns-platform-declarations": "^3.0.1"
  },
  "devDependencies": {
    "babel-traverse": "6.24.1",
    "babel-types": "6.24.1",
    "babylon": "6.17.1",
    "lazy": "1.0.11",
    "nativescript-dev-android-snapshot": "^0.*.*",
    "nativescript-dev-typescript": "~0.4.4",
    "typescript": "^2.3.2"
  }
Nikoms commented 7 years ago

I just tested with the "demo" code and I also have a blank page

Nikoms commented 7 years ago
tns --version
3.0.1
JoshDSommer commented 7 years ago

Strange, android or iOS?

Nikoms commented 7 years ago

On Android. Do I have to be on the 3.0 branch? I did

"npm run setup" and "npm run demo.android"

On master, I get this when the app is launched:

java.lang.RuntimeException: Unable to create application com.tns.NativeScriptApplication: com.tns.NativeScriptException: 

Error calling module function 

Error: com.tns.NativeScriptException: Failed to find module: "application", relative to: /app/tns_modules/
    com.tns.Module.resolvePathHelper(Module.java:220)
    com.tns.Module.resolvePath(Module.java:60)
    com.tns.Runtime.runModule(Native Method)
    com.tns.Runtime.runModule(Runtime.java:244)
    com.tns.Runtime.run(Runtime.java:238)
    com.tns.NativeScriptApplication.onCreate(NativeScriptApplication.java:17)
    android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1032)
    android.app.ActivityThread.handleBindApplication(ActivityThread.java:5885)
    android.app.ActivityThread.-wrap3(ActivityThread.java)
    android.app.ActivityThread$H.handleMessage(ActivityThread.java:1703)
    android.os.Handler.dispatchMessage(Handler.java:102)
    android.os.Looper.loop(Looper.java:154)
    android.app.ActivityThread.main(ActivityThread.java:6692)
    java.lang.reflect.Method.invoke(Native Method)
    com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1468)
    com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1358)
File: "<unknown>, line: 1, column: 265

StackTrace: 
    Frame: function:'require', file:'', line: 1, column: 266
    Frame: function:'', file:'/data/data/org.nativescript.demo/files/app/app.js', line: 2, column: 19
    Frame: function:'require', file:'', line: 1, column: 266

Error: com.tns.NativeScriptException: Failed to find module: "application", relative to: /app/tns_modules/
    com.tns.Module.resolvePathHelper(Module.java:220)
    com.tns.Module.resolvePath(Module.java:60)
    com.tns.Runtime.runModule(Native Method)
    com.tns.Runtime.runModule(Runtime.java:244)
    com.tns.Runtime.run(Runtime.java:238)
    com.tns.NativeScriptApplication.onCreate(NativeScriptApplication.java:17)
    android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1032)
    android.app.ActivityThread.handleBindApplication(ActivityThread.java:5885)
    android.app.ActivityThread.-wrap3(ActivityThread.java)
    android.app.ActivityThread$H.handleMessage(ActivityThread.java:1703)
    android.os.Handler.dispatchMessage(Handler.java:102)
    android.os.Looper.loop(Looper.java:154)
    android.app.ActivityThread.main(ActivityThread.java:6692)
    java.lang.reflect.Method.invoke(Native Method)
    com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1468)
    com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1358)
File: "<unknown>, line: 1, column: 265

StackTrace: 
    Frame: function:'require', file:'', line: 1, column: 266
    Frame: function:'', file:'/data/data/org.nativescript.demo/files/app/app.js', line: 2, column: 19
    Frame: function:'require', file:'', line: 1, column: 266

    at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5888)
    at android.app.ActivityThread.-wrap3(ActivityThread.java)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1703)
    at android.os.Handler.dispatchMessage(Handler.java:102)
    at android.os.Looper.loop(Looper.java:154)
    at android.app.ActivityThread.main(ActivityThread.java:6692)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1468)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1358)
Caused by: com.tns.NativeScriptException: 

Error calling module function 

Error: com.tns.NativeScriptException: Failed to find module: "application", relative to: /app/tns_modules/
    com.tns.Module.resolvePathHelper(Module.java:220)
    com.tns.Module.resolvePath(Module.java:60)
    com.tns.Runtime.runModule(Native Method)
    com.tns.Runtime.runModule(Runtime.java:244)
    com.tns.Runtime.run(Runtime.java:238)
    com.tns.NativeScriptApplication.onCreate(NativeScriptApplication.java:17)
    android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1032)
    android.app.ActivityThread.handleBindApplication(ActivityThread.java:5885)
    android.app.ActivityThread.-wrap3(ActivityThread.java)
    android.app.ActivityThread$H.handleMessage(ActivityThread.java:1703)
    android.os.Handler.dispatchMessage(Handler.java:102)
    android.os.Looper.loop(Looper.java:154)
    android.app.ActivityThread.main(ActivityThread.java:6692)
    java.lang.reflect.Method.invoke(Native Method)
    com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1468)
    com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1358)
File: "<unknown>, line: 1, column: 265

StackTrace: 
    Frame: function:'require', file:'', line: 1, column: 266
    Frame: function:'', file:'/data/data/org.nativescript.demo/files/app/app.js', line: 2, column: 19
    Frame: function:'require', file:'', line: 1, column: 266

Error: com.tns.NativeScriptException: Failed to find module: "application", relative to: /app/tns_modules/
    com.tns.Module.resolvePathHelper(Module.java:220)
    com.tns.Module.resolvePath(Module.java:60)
    com.tns.Runtime.runModule(Native Method)
    com.tns.Runtime.runModule(Runtime.java:244)
    com.tns.Runtime.run(Runtime.java:238)
    com.tns.NativeScriptApplication.onCreate(NativeScriptApplication.java:17)
    android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1032)
    android.app.ActivityThread.handleBindApplication(ActivityThread.java:5885)
    android.app.ActivityThread.-wrap3(ActivityThread.java)
    android.app.ActivityThread$H.handleMessage(ActivityThread.java:1703)
    android.os.Handler.dispatchMessage(Handler.java:102)
    android.os.Looper.loop(Looper.java:154)
    android.app.ActivityThread.main(ActivityThread.java:6692)
    java.lang.reflect.Method.invoke(Native Method)
    com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1468)
    com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1358)
File: "<unknown>, line: 1, column: 265

StackTrace: 
    Frame: function:'require', file:'', line: 1, column: 266
    Frame: function:'', file:'/data/data/org.nativescript.demo/files/app/app.js', line: 2, column: 19
    Frame: function:'require', file:'', line: 1, column: 266

    at com.tns.Runtime.runModule(Native Method)
    at com.tns.Runtime.runModule(Runtime.java:244)
    at com.tns.Runtime.run(Runtime.java:238)
    at com.tns.NativeScriptApplication.onCreate(NativeScriptApplication.java:17)
    at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1032)
    at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5885)
    ... 8 more

And on master:

demo/node_modules/tns-core-modules/tns-core-modules.d.ts(5,5): error TS2300: Duplicate identifier '"audio"'.
demo/node_modules/tns-core-modules/tns-core-modules.d.ts(5,14): error TS2300: Duplicate identifier '"beacon"'.
demo/node_modules/tns-core-modules/tns-core-modules.d.ts(5,24): error TS2300: Duplicate identifier '"cspreport"'.
demo/node_modules/tns-core-modules/tns-core-modules.d.ts(5,37): error TS2300: Duplicate identifier '"download"'.
demo/node_modules/tns-core-modules/tns-core-modules.d.ts(5,49): error TS2300: Duplicate identifier '"embed"'.
demo/node_modules/tns-core-modules/tns-core-modules.d.ts(5,58): error TS2300: Duplicate identifier '"eventsource"'.
demo/node_modules/tns-core-modules/tns-core-modules.d.ts(5,73): error TS2300: Duplicate identifier '"favicon"'.
demo/node_modules/tns-core-modules/tns-core-modules.d.ts(5,84): error TS2300: Duplicate identifier '"fetch"'.
demo/node_modules/tns-core-modules/tns-core-modules.d.ts(6,5): error TS2300: Duplicate identifier '"font"'.
demo/node_modules/tns-core-modules/tns-core-modules.d.ts(6,13): error TS2300: Duplicate identifier '"form"'.
demo/node_modules/tns-core-modules/tns-core-modules.d.ts(6,21): error TS2300: Duplicate identifier '"frame"'.
demo/node_modules/tns-core-modules/tns-core-modules.d.ts(6,30): error TS2300: Duplicate identifier '"hyperlink"'.
demo/node_modules/tns-core-modules/tns-core-modules.d.ts(6,43): error TS2300: Duplicate identifier '"iframe"'.
demo/node_modules/tns-core-modules/tns-core-modules.d.ts(6,53): error TS2300: Duplicate identifier '"image"'.
demo/node_modules/tns-core-modules/tns-core-modules.d.ts(6,62): error TS2300: Duplicate identifier '"imageset"'.
demo/node_modules/tns-core-modules/tns-core-modules.d.ts(6,74): error TS2300: Duplicate identifier '"import"'.
demo/node_modules/tns-core-modules/tns-core-modules.d.ts(7,5): error TS2300: Duplicate identifier '"internal"'.
demo/node_modules/tns-core-modules/tns-core-modules.d.ts(7,17): error TS2300: Duplicate identifier '"location"'.
demo/node_modules/tns-core-modules/tns-core-modules.d.ts(7,29): error TS2300: Duplicate identifier '"manifest"'.
demo/node_modules/tns-core-modules/tns-core-modules.d.ts(7,41): error TS2300: Duplicate identifier '"object"'.
demo/node_modules/tns-core-modules/tns-core-modules.d.ts(7,51): error TS2300: Duplicate identifier '"ping"'.
demo/node_modules/tns-core-modules/tns-core-modules.d.ts(7,59): error TS2300: Duplicate identifier '"plugin"'.
demo/node_modules/tns-core-modules/tns-core-modules.d.ts(7,69): error TS2300: Duplicate identifier '"prefetch"'.
demo/node_modules/tns-core-modules/tns-core-modules.d.ts(7,81): error TS2300: Duplicate identifier '"script"'.
demo/node_modules/tns-core-modules/tns-core-modules.d.ts(8,5): error TS2300: Duplicate identifier '"serviceworker"'.
demo/node_modules/tns-core-modules/tns-core-modules.d.ts(8,22): error TS2300: Duplicate identifier '"sharedworker"'.
demo/node_modules/tns-core-modules/tns-core-modules.d.ts(8,38): error TS2300: Duplicate identifier '"subresource"'.
demo/node_modules/tns-core-modules/tns-core-modules.d.ts(8,53): error TS2300: Duplicate identifier '"style"'.
demo/node_modules/tns-core-modules/tns-core-modules.d.ts(8,62): error TS2300: Duplicate identifier '"track"'.
demo/node_modules/tns-core-modules/tns-core-modules.d.ts(8,71): error TS2300: Duplicate identifier '"video"'.
demo/node_modules/tns-core-modules/tns-core-modules.d.ts(8,80): error TS2300: Duplicate identifier '"worker"'.
demo/node_modules/tns-core-modules/tns-core-modules.d.ts(9,5): error TS2300: Duplicate identifier '"xmlhttprequest"'.
demo/node_modules/tns-core-modules/tns-core-modules.d.ts(9,23): error TS2300: Duplicate identifier '"xslt"'.
demo/node_modules/tns-core-modules/tns-core-modules.d.ts(17,14): error TS2300: Duplicate identifier 'HeaderInit'.
demo/node_modules/tns-core-modules/tns-core-modules.d.ts(86,15): error TS2300: Duplicate identifier 'WeakRef'.
node_modules/tns-core-modules/tns-core-modules.d.ts(5,5): error TS2300: Duplicate identifier '"audio"'.
node_modules/tns-core-modules/tns-core-modules.d.ts(5,5): error TS2432: In an enum with multiple declarations, only one declaration can omit an initializer for its first enum element.
node_modules/tns-core-modules/tns-core-modules.d.ts(5,14): error TS2300: Duplicate identifier '"beacon"'.
node_modules/tns-core-modules/tns-core-modules.d.ts(5,24): error TS2300: Duplicate identifier '"cspreport"'.
node_modules/tns-core-modules/tns-core-modules.d.ts(5,37): error TS2300: Duplicate identifier '"download"'.
node_modules/tns-core-modules/tns-core-modules.d.ts(5,49): error TS2300: Duplicate identifier '"embed"'.
node_modules/tns-core-modules/tns-core-modules.d.ts(5,58): error TS2300: Duplicate identifier '"eventsource"'.
node_modules/tns-core-modules/tns-core-modules.d.ts(5,73): error TS2300: Duplicate identifier '"favicon"'.
node_modules/tns-core-modules/tns-core-modules.d.ts(5,84): error TS2300: Duplicate identifier '"fetch"'.
node_modules/tns-core-modules/tns-core-modules.d.ts(6,5): error TS2300: Duplicate identifier '"font"'.
node_modules/tns-core-modules/tns-core-modules.d.ts(6,13): error TS2300: Duplicate identifier '"form"'.
node_modules/tns-core-modules/tns-core-modules.d.ts(6,21): error TS2300: Duplicate identifier '"frame"'.
node_modules/tns-core-modules/tns-core-modules.d.ts(6,30): error TS2300: Duplicate identifier '"hyperlink"'.
node_modules/tns-core-modules/tns-core-modules.d.ts(6,43): error TS2300: Duplicate identifier '"iframe"'.
node_modules/tns-core-modules/tns-core-modules.d.ts(6,53): error TS2300: Duplicate identifier '"image"'.
node_modules/tns-core-modules/tns-core-modules.d.ts(6,62): error TS2300: Duplicate identifier '"imageset"'.
node_modules/tns-core-modules/tns-core-modules.d.ts(6,74): error TS2300: Duplicate identifier '"import"'.
node_modules/tns-core-modules/tns-core-modules.d.ts(7,5): error TS2300: Duplicate identifier '"internal"'.
node_modules/tns-core-modules/tns-core-modules.d.ts(7,17): error TS2300: Duplicate identifier '"location"'.
node_modules/tns-core-modules/tns-core-modules.d.ts(7,29): error TS2300: Duplicate identifier '"manifest"'.
node_modules/tns-core-modules/tns-core-modules.d.ts(7,41): error TS2300: Duplicate identifier '"object"'.
node_modules/tns-core-modules/tns-core-modules.d.ts(7,51): error TS2300: Duplicate identifier '"ping"'.
node_modules/tns-core-modules/tns-core-modules.d.ts(7,59): error TS2300: Duplicate identifier '"plugin"'.
node_modules/tns-core-modules/tns-core-modules.d.ts(7,69): error TS2300: Duplicate identifier '"prefetch"'.
node_modules/tns-core-modules/tns-core-modules.d.ts(7,81): error TS2300: Duplicate identifier '"script"'.
node_modules/tns-core-modules/tns-core-modules.d.ts(8,5): error TS2300: Duplicate identifier '"serviceworker"'.
node_modules/tns-core-modules/tns-core-modules.d.ts(8,22): error TS2300: Duplicate identifier '"sharedworker"'.
node_modules/tns-core-modules/tns-core-modules.d.ts(8,38): error TS2300: Duplicate identifier '"subresource"'.
node_modules/tns-core-modules/tns-core-modules.d.ts(8,53): error TS2300: Duplicate identifier '"style"'.
node_modules/tns-core-modules/tns-core-modules.d.ts(8,62): error TS2300: Duplicate identifier '"track"'.
node_modules/tns-core-modules/tns-core-modules.d.ts(8,71): error TS2300: Duplicate identifier '"video"'.
node_modules/tns-core-modules/tns-core-modules.d.ts(8,80): error TS2300: Duplicate identifier '"worker"'.
node_modules/tns-core-modules/tns-core-modules.d.ts(9,5): error TS2300: Duplicate identifier '"xmlhttprequest"'.
node_modules/tns-core-modules/tns-core-modules.d.ts(9,23): error TS2300: Duplicate identifier '"xslt"'.
node_modules/tns-core-modules/tns-core-modules.d.ts(17,14): error TS2300: Duplicate identifier 'HeaderInit'.
node_modules/tns-core-modules/tns-core-modules.d.ts(86,15): error TS2300: Duplicate identifier 'WeakRef'.
JoshDSommer commented 7 years ago

If you're trying to upgrade the project you will want to change some of the dependencies. Mainly I think tns-core-modules can go maybe otheres. You should be able to install the current release from npm with npm i -S nativescript-slides in a 3.0 project and it should "just work". Let me know

nicHoch commented 7 years ago

i also have a blank page in a NS 3.0.1 android project. Was working fine before the upgrade.

prochiner commented 7 years ago

(i had the same problem)there is a problem with "slideWidth"

you can use this temp. fix import * as slides from 'nativescript-slides/nativescript-slides'

var slideview = view.getViewById(page, "id_of_your_slideview"); slideview.set('slideWidth',platform.screen.mainScreen.widthDIPs)

nicHoch commented 7 years ago

still do not see any slider in Android and IOS also the fix above does not help

ghost commented 7 years ago

same problem here with the 3.0.1

JoshDSommer commented 7 years ago

I just published a fix, that seems to work for me in iOS and android tns modules 3.0.1. npm version 2.2.9. so you shouldn't have to do with width hack anymore