triniwiz / nativescript-aws-sdk

Apache License 2.0
17 stars 15 forks source link

Module not found: Error: Can't resolve 'nativescript-aws-sdk' #9

Open szgozcan opened 5 years ago

szgozcan commented 5 years ago

demo app(s) for sample usage

I can't run the code because when I hit tns run android I get Module not found: Error: Can't resolve 'nativescript-aws-sdk'

Make sure to check the existing issues in this repository

If the demo apps cannot help and there is no issue for your problem, tell us about it

Please, ensure your title is less than 63 characters long and starts with a capital letter.

Which platform(s) does your issue occur on?

Emulator

Please, provide the following version numbers that your issue occurs with:

Please, tell us how to recreate the issue in as much detail as possible.

Describe the steps to reproduce it. I just want to download or upload json files from my aws s3 bucket, I try to use your demo app but when I hit tns run android app crashes and I get

ERROR in ./views/start-page/start-page.js
Module not found: Error: Can't resolve 'nativescript-aws-sdk'     in'/Users/sezginozcan/Deneme/app/views/start-page'
 @ ./views/start-page/start-page.js 3:11-42
 @ . sync (?<!\bApp_Resources\b.*)\.(xml|css|js|(?<!\.d\.)ts|(?<!\b_[\w-]*\.)scss)$
 @ ./app.js
Webpack compilation complete. Watching for file changes.
Webpack build done!
Project successfully prepared (android)
Successfully transferred runtime.js on device 192.168.56.101:5555.
 Restarting application on device 192.168.56.101:5555...
 Successfully synced application org.nativescript.Deneme on device 192.168.56.101:5555.
ActivityManager: Start proc org.nativescript.Deneme for activity    org.nativescript.Deneme/com.tns.NativeScriptActivity: pid=6587 uid=10059 gids={50059,    1028, 1015, 3003}
JS: HMR: Hot Module Replacement Enabled. Waiting for signal.
System.err: An uncaught Exception occurred on "main" thread.
System.err: Unable to start activity     ComponentInfo{org.nativescript.Deneme/com.tns.NativeScriptActivity}:    com.tns.NativeScriptException: Calling js method onCreate failed
System.err: Error: Building UI from XML. @app-root.xml:1:1
System.err:  > Cannot find module 'nativescript-aws-sdk'
System.err: StackTrace:
System.err: java.lang.RuntimeException: Unable to start activity     ComponentInfo{org.nativescript.Deneme/com.tns.NativeScriptActivity}:     com.tns.NativeScriptException: Calling js method onCreate failed
System.err: Error: Building UI from XML. @app-root.xml:1:1
System.err:  > Cannot find module 'nativescript-aws-sdk'
System.err:     at    android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2211)
System.err:     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2261)
System.err:     at android.app.ActivityThread.access$600(ActivityThread.java:141)
System.err:     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1256)
System.err:     at android.os.Handler.dispatchMessage(Handler.java:99)
System.err:     at android.os.Looper.loop(Looper.java:137)
System.err:     at android.app.ActivityThread.main(ActivityThread.java:5103)
System.err:     at java.lang.reflect.Method.invokeNative(Native Method)
System.err:     at java.lang.reflect.Method.invoke(Method.java:525)
System.err:     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
System.err:     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
System.err:     at dalvik.system.NativeStart.main(Native Method)
System.err: Caused by: com.tns.NativeScriptException: Calling js method onCreate failed
System.err: Error: Building UI from XML. @app-root.xml:1:1
System.err:  > Cannot find module 'nativescript-aws-sdk'
System.err:     at com.tns.Runtime.callJSMethodNative(Native Method)
System.err:     at com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1242)
System.err:     at com.tns.Runtime.callJSMethodImpl(Runtime.java:1122)
System.err:     at com.tns.Runtime.callJSMethod(Runtime.java:1109)
System.err:     at com.tns.Runtime.callJSMethod(Runtime.java:1089)
System.err:     at com.tns.Runtime.callJSMethod(Runtime.java:1081)
System.err:     at com.tns.NativeScriptActivity.onCreate(NativeScriptActivity.java:19)
System.err:     at android.app.Activity.performCreate(Activity.java:5133)
System.err:     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
System.err:     at   android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2175)
System.err:     ... 11 more
ActivityManager: Process org.nativescript.Deneme (pid 6587) has died. 

Is there any code involved?

GrempelsGabriel commented 4 years ago

try :

import { S3 } from 'nativescript-aws-sdk/s3';