Closed karthikbalu closed 5 years ago
You must first build the plugin.
cd src/ && npm i && npm run demo.android
should be enough.
cd demo/ && npm run build.plugin && tns install && tns run android
should also work
Thanks a lot for your response :)
The issue still persists, Below is the error I get now, Please help!
$ tns run android
Skipping node_modules folder! Use the syncAllFiles option to sync files from this folder.
Searching for devices...
Executing before-watchPatterns hook from /nativescript-mqtt/demo/hooks/before-watchPatterns/nativescript-dev-typescript.js
Executing before-watchPatterns hook from /nativescript-mqtt/demo/hooks/before-watchPatterns/nativescript-dev-webpack.js
Executing before-watch hook from /nativescript-mqtt/demo/hooks/before-watch/nativescript-dev-typescript.js
Found peer TypeScript 2.8.4
Executing before-watch hook from /nativescript-mqtt/demo/hooks/before-watch/nativescript-dev-webpack.js
Executing before-shouldPrepare hook from nativescript-mqtt/demo/hooks/before-shouldPrepare/nativescript-dev-webpack.js
Executing before-prepare hook from/nativescript-mqtt/demo/hooks/before-prepare/nativescript-dev-typescript.js
Hook skipped because either bundling or livesync is in progress.
Preparing project...
Executing before-prepareJSApp hook from /nativescript-mqtt/demo/hooks/before-prepareJSApp/nativescript-dev-webpack.js
Successfully prepared plugin nativescript-theme-core for android.
Successfully prepared plugin nativescript-unit-test-runner for android.
nativescript-mqtt 5.0.0 for android is not compatible with the currently installed framework version 4.2.0.
Successfully prepared plugin nativescript-mqtt for android.
Successfully prepared plugin tns-core-modules for android.
Successfully prepared plugin nativescript-websockets for android.
Successfully prepared plugin tns-core-modules-widgets for android.
Project successfully prepared (Android)
Executing after-prepare hook from /nativescript-mqtt/demo/hooks/after-prepare/nativescript-dev-webpack.js
Executing after-prepare hook from /nativescript-mqtt/demo/hooks/after-prepare/nativescript-unit-test-runner.js
Building project...
Gradle build...
+ setting applicationId
+ applying user-defined configuration from /nativescript-mqtt/demo/app/App_Resources/Android/app.gradle
+ adding nativescript runtime package dependency: nativescript-optimized-with-inspector
+ adding jar plugin dependency: /nativescript-mqtt/src/node_modules/nativescript-websockets/platforms/android/websocket.jar
+ adding aar plugin dependency: //nativescript-mqtt/demo/node_modules/tns-core-modules-widgets/platforms/android/widgets-release.aar
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: /nativescript-mqtt/demo/platforms/android/app/src/main/java/technology/master/nativescript/WebSocket.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Project successfully built.
Installing...
Successfully installed on device with identifier '015d4a820420140f'.
Successfully transferred all files.
Refreshing application...
Successfully synced application org.nativescript.demo on device 015d4a820420140f.
ActivityManager: Start proc 6651:org.nativescript.demo/u0a86 for activity org.nativescript.demo/com.tns.NativeScriptActivity
System.err: android.content.res.Resources$NotFoundException: Resource ID #0xfffffff6
System.err: at android.content.res.Resources.getValue(Resources.java:1266)
System.err: at android.content.res.Resources.loadXmlResourceParser(Resources.java:2649)
System.err: at android.content.res.Resources.getAnimation(Resources.java:1106)
System.err: at android.view.animation.AnimationUtils.loadAnimation(AnimationUtils.java:73)
System.err: at android.support.v4.app.FragmentManagerImpl.loadAnimation(FragmentManager.java:1102)
System.err: at android.support.v4.app.FragmentManagerImpl.moveFragmentToExpectedState(FragmentManager.java:1600)
System.err: at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1641)
System.err: at android.support.v4.app.BackStackRecord.executeOps(BackStackRecord.java:794)
System.err: at android.support.v4.app.FragmentManagerImpl.executeOps(FragmentManager.java:2415)
System.err: at android.support.v4.app.FragmentManagerImpl.executeOpsTogether(FragmentManager.java:2200)
System.err: at android.support.v4.app.FragmentManagerImpl.optimizeAndExecuteOps(FragmentManager.java:2153)
System.err: at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:2063)
System.err: at android.support.v4.app.FragmentManagerImpl$1.run(FragmentManager.java:725)
System.err: at android.os.Handler.handleCallback(Handler.java:739)
System.err: at android.os.Handler.dispatchMessage(Handler.java:95)
System.err: at android.os.Looper.loop(Looper.java:135)
System.err: at android.app.ActivityThread.main(ActivityThread.java:5254)
System.err: at java.lang.reflect.Method.invoke(Native Method)
System.err: at java.lang.reflect.Method.invoke(Method.java:372)
System.err: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
ActivityManager: Process org.nativescript.demo (pid 6651) has died
Here's your issue:
you probably have to upgrade to NS 5 (CLI+runtime) to use the cross-platform modules 5.0.1.
It worked!, Thanks a lot, I really appreciate your efforts maintaining this repo, I already about to drop my project because of this issue before this new repo migration but you helped!
Glad it's working now! If you have any other issues with the plugin let me know.
Which platform(s) does your issue occur on?
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.
Simple, just clone the repo, cd demo, tns install, tns run android
below is the error `Found peer TypeScript 2.8.4 references.d.ts:1:22 - error TS6053: File '/Users/karthikbalu/MYDRIVE/DEVELOPMENT/temp/nativescript-mqtt/src/node_modules/tns-platform-declarations/ios.d.ts' not found. 1 ///
../src/references.d.ts:1:22 - error TS6053: File '/Users/karthikbalu/MYDRIVE/DEVELOPMENT/temp/nativescript-mqtt/src/node_modules/tns-platform-declarations/ios.d.ts' not found. 1 ///
Executing before-watch hook from /Users/karthikbalu/MYDRIVE/DEVELOPMENT/temp/nativescript-mqtt/demo/hooks/before-watch/nativescript-dev-webpack.js Executing before-shouldPrepare hook from /Users/karthikbalu/MYDRIVE/DEVELOPMENT/temp/nativescript-mqtt/demo/hooks/before-shouldPrepare/nativescript-dev-webpack.js Executing before-prepare hook from /Users/karthikbalu/MYDRIVE/DEVELOPMENT/temp/nativescript-mqtt/demo/hooks/before-prepare/nativescript-dev-typescript.js Hook skipped because either bundling or livesync is in progress. Preparing project... Executing before-prepareJSApp hook from /Users/karthikbalu/MYDRIVE/DEVELOPMENT/temp/nativescript-mqtt/demo/hooks/before-prepareJSApp/nativescript-dev-webpack.js Project successfully prepared (Android) Executing after-prepare hook from /Users/karthikbalu/MYDRIVE/DEVELOPMENT/temp/nativescript-mqtt/demo/hooks/after-prepare/nativescript-dev-webpack.js Executing after-prepare hook from /Users/karthikbalu/MYDRIVE/DEVELOPMENT/temp/nativescript-mqtt/demo/hooks/after-prepare/nativescript-unit-test-runner.js references.d.ts:1:22 - error TS6053: File '/Users/karthikbalu/MYDRIVE/DEVELOPMENT/temp/nativescript-mqtt/src/node_modules/tns-platform-declarations/ios.d.ts' not found. 1 ///
../src/references.d.ts:1:22 - error TS6053: File '/Users/karthikbalu/MYDRIVE/DEVELOPMENT/temp/nativescript-mqtt/src/node_modules/tns-platform-declarations/ios.d.ts' not found. 1 ///