I tried using NeDB in NativeScript application, but could do it... it throws error saying this:
Blockquote
java.lang.RuntimeException: Unable to create application com.tns.NativeScriptApplication: com.tns.NativeScriptException: Failed to find module: "crypto", relative to: /app/tns_modules/ at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4710) at android.app.ActivityThread.-wrap1(ActivityThread.java) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1405) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:148) at android.app.ActivityThread.main(ActivityThread.java:5417) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616) Caused by: com.tns.NativeScriptException: Failed to find module: "crypto", relative to: /app/tns_modules/ at com.tns.Module.resolvePathHelper(Module.java:220) at com.tns.Module.resolvePath(Module.java:60) at com.tns.Runtime.runModule(Native Method) at com.tns.Runtime.runModule(Runtime.java:241) at com.tns.Runtime.run(Runtime.java:235) at com.tns.RuntimeHelper.initRuntime(RuntimeHelper.java:129) at com.tns.NativeScriptApplication.onCreate(NativeScriptApplication.java:13) at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1013) at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4707) ... 8 more
I first did npm install nedb --save and require it by
var nedb = require('nedb');
How can I fix it?
There are a number of npm modules that would not work because most of the node core modules are not available to use in NativeScript as yet you can track the issue here
Related
I'm on a Mac and I'm using java 1.8.0_333. I'm trying to run a jar file with java -jar in the terminal but I'm getting this error:
Exception in Application init method
Exception in thread "main" java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at sun.launcher.LauncherHelper$FXHelper.main(LauncherHelper.java:873)
Caused by: java.lang.RuntimeException: Exception in Application init method
at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:912)
at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$1(LauncherImpl.java:182)
at java.lang.Thread.run(Thread.java:750)
Caused by: java.lang.UnsatisfiedLinkError: dlopen(/var/folders/lq/6_jj02w93fl_clrlsthm_82c0000gn/T/jna-102528476/jna3490548316477581732.tmp, 0x0009): Symbol not found: __ZN3tbb4task13note_affinityEt
Referenced from: /private/var/folders/lq/6_jj02w93fl_clrlsthm_82c0000gn/T/jna-102528476/jna3490548316477581732.tmp
Expected in: /usr/local/Cellar/tbb/2021.5.0_1/lib/libtbb.12.5.dylib
at com.sun.jna.Native.open(Native Method)
at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:288)
at com.sun.jna.NativeLibrary.getInstance(NativeLibrary.java:427)
at com.sun.jna.Native.register(Native.java:1647)
at com.sun.jna.Native.register(Native.java:1360)
at billiards.wrapper.Wrapper.<clinit>(Wrapper.java:25)
at billiards.viewer.Main.init(Main.java:30)
at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:841)
... 2 more
It seems that the issue is that it can't find a library, but I don't know how to approach this. If anyone has any ideas on how to deal with this that would be great.
I am unable to run ImportSDKDemo it fails to load ffmepg.
hello I am unable to run this demo no matter what sdk version (24, 26, 28) I am using.
I have installed ffmpeg
`E/sdk: v19 install
V/sdk: DexInstall end
I/InstantRun: starting instant run server: is main process
I/art: Starting a blocking GC Instrumentation
W/art: Before Android 4.1, method android.graphics.PorterDuffColorFilter android.support.graphics.drawable.VectorDrawableCompat.updateTintFilter(android.graphics.PorterDuffColorFilter, android.content.res.ColorStateList, android.graphics.PorterDuff$Mode) would have incorrectly overridden the package-private method in android.graphics.drawable.Drawable
D/: HostConnection::get() New Host Connection established 0xe4248970, tid 2143
D/libEGL: Emulator has host GPU support, qemu.gles is set to 1.
E/libEGL: load_driver(/system/lib/egl/libGLES_emulation.so): dlopen failed: library "/system/lib/egl/libGLES_emulation.so" not found
D/libEGL: loaded /system/lib/egl/libEGL_emulation.so
D/libEGL: loaded /system/lib/egl/libGLESv1_CM_emulation.so
D/libEGL: loaded /system/lib/egl/libGLESv2_emulation.so
D/: HostConnection::get() New Host Connection established 0xe4248b20, tid 2165
I/OpenGLRenderer: Initialized EGL, version 1.4
D/OpenGLRenderer: Swap behavior 1
W/art: Before Android 4.1, method int android.support.v7.widget.ListViewCompat.lookForSelectablePosition(int, boolean) would have incorrectly overridden the package-private method in android.widget.ListView
E/linker: /data/app/com.dji.importSDKDemo-1/lib/x86/libffmpeg.so: has text relocations
W/System.err: java.lang.UnsatisfiedLinkError: dlopen failed: /data/app/com.dji.importSDKDemo-1/lib/x86/libffmpeg.so: has text relocations
W/System.err: at java.lang.Runtime.loadLibrary0(Runtime.java:977)
at java.lang.System.loadLibrary(System.java:1530)
at dji.midware.natives.SDKRelativeJNI.<clinit>(Unknown Source)
at dji.midware.natives.SDKRelativeJNI.native_getXXXX(Native Method)
at com.dji.g.a.a.c.b(Unknown Source)
at dji.midware.d.b(Unknown Source)
at dji.sdk.sdkmanager.DJISDKManager.<clinit>(Unknown Source)
W/System.err: at dji.sdk.sdkmanager.DJISDKManager.getInstance(Unknown Source)
at com.dji.importSDKDemo.MainActivity$1.run(MainActivity.java:122)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:243)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
at java.lang.Thread.run(Thread.java:761)
D/SDKRelativeJNI: Couldn't load lib
E/art: No implementation found for byte[] dji.midware.natives.SDKRelativeJNI.native_getXXXX(java.lang.String) (tried Java_dji_midware_natives_SDKRelativeJNI_native_1getXXXX and Java_dji_midware_natives_SDKRelativeJNI_native_1getXXXX__Ljava_lang_String_2)
E/AndroidRuntime: FATAL EXCEPTION: AsyncTask #1
Process: com.dji.importSDKDemo, PID: 2143
java.lang.UnsatisfiedLinkError: No implementation found for byte[] dji.midware.natives.SDKRelativeJNI.native_getXXXX(java.lang.String) (tried Java_dji_midware_natives_SDKRelativeJNI_native_1getXXXX and Java_dji_midware_natives_SDKRelativeJNI_native_1getXXXX__Ljava_lang_String_2)
at dji.midware.natives.SDKRelativeJNI.native_getXXXX(Native Method)
at com.dji.g.a.a.c.b(Unknown Source)
at dji.midware.d.b(Unknown Source)
at dji.sdk.sdkmanager.DJISDKManager.<clinit>(Unknown Source)
at dji.sdk.sdkmanager.DJISDKManager.getInstance(Unknown Source)
at com.dji.importSDKDemo.MainActivity$1.run(MainActivity.java:122)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:243)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
at java.lang.Thread.run(Thread.java:761)`
Please help
Thanks
the Android ImportSDKDemo is related to this tutorial: https://developer.dji.com/mobile-sdk/documentation/application-development-workflow/workflow-integrate.html#android-studio-project-integration , you can follow it to learn how to import the Android SDK.
If you just want to run the demo, just download the whole project from Github: https://github.com/DJI-Mobile-SDK-Tutorials/Android-ImportAndActivateSDKInAndroidStudio and replace with your applied App key in the AndroidManifest.xml file to run it directly. No need to install the ffmpeg. It works on my side.
I'm trying to install the ruby-runtime (0.12) plugin for Jenkins, but getting the following error:
ruby-runtime
Failure -
java.lang.NullPointerException
at java.lang.Class.isAssignableFrom(Native Method)
at org.jenkinsci.jruby.JavaProxyConverter.canConvert(JavaProxyConverter.java:43)
at com.thoughtworks.xstream.core.DefaultConverterLookup.registerConverter(DefaultConverterLookup.java:74)
at com.thoughtworks.xstream.XStream$2.registerConverter(XStream.java:502)
at com.thoughtworks.xstream.XStream.registerConverter(XStream.java:1422)
at com.thoughtworks.xstream.XStream.registerConverter(XStream.java:1417)
at org.jenkinsci.jruby.JRubyXStream.register(JRubyXStream.java:26)
at ruby.RubyRuntimePlugin.initRubyXStreams(RubyRuntimePlugin.java:44)
at ruby.RubyRuntimePlugin.start(RubyRuntimePlugin.java:28)
at hudson.ClassicPluginStrategy.startPlugin(ClassicPluginStrategy.java:539)
at hudson.ClassicPluginStrategy.load(ClassicPluginStrategy.java:528)
Caused: java.io.IOException: Failed to initialize
at hudson.ClassicPluginStrategy.load(ClassicPluginStrategy.java:531)
at hudson.PluginManager.dynamicLoad(PluginManager.java:872)
Caused: java.io.IOException: Failed to install ruby-runtime plugin
at hudson.PluginManager.dynamicLoad(PluginManager.java:881)
at hudson.PluginManager.dynamicLoad(PluginManager.java:820)
at hudson.model.UpdateCenter$InstallationJob._run(UpdateCenter.java:1889)
Caused: java.io.IOException: Failed to dynamically deploy this plugin
at hudson.model.UpdateCenter$InstallationJob._run(UpdateCenter.java:1893)
at hudson.model.UpdateCenter$DownloadJob.run(UpdateCenter.java:1651)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at hudson.remoting.AtmostOneThreadExecutor$Worker.run(AtmostOneThreadExecutor.java:110)
at java.lang.Thread.run(Thread.java:748)
I've found some questions on similar issues, however none of them seem to address this specific issue. Would greatly appreciate any assistance or where to go towards in terms of troubleshooting.
JMeter (version 4.0) plugins manager (jmeter-plugins-manager-1.0.2) failed to install plugins.
Following error is thrown.
2018-05-29 12:39:00,977 ERROR o.j.r.PluginManager: Failed to download cmdrunner>=2.2
java.io.IOException: The filename, directory name, or volume label syntax is incorrect
at java.io.WinNTFileSystem.createFileExclusively(Native Method) ~[?:1.8.0_161]
at java.io.File.createTempFile(Unknown Source) ~[?:1.8.0_161]
at java.io.File.createTempFile(Unknown Source) ~[?:1.8.0_161]
at org.jmeterplugins.repository.JARSourceHTTP.getJAR(JARSourceHTTP.java:395) ~[jmeter-plugins-manager-1.0.2.jar:?]
at org.jmeterplugins.repository.PluginManager.applyChanges(PluginManager.java:167) [jmeter-plugins-manager-1.0.2.jar:?]
at org.jmeterplugins.repository.PluginManagerDialog$4.run(PluginManagerDialog.java:226) [jmeter-plugins-manager-1.0.2.jar:?]
quick fix:
download jar from https://mvnrepository.com/artifact/kg.apc/cmdrunner/2.2.1
and place it int jmeter/library folder
I'm doing in Movie project with CastButton, I completed a sample and this worked perfect. But when I'm doing in true project I have a problem.
I imported compile into my grande file, but when I create MediaRouteButton I have I got error, I tried many ways but I can't fix it, so I now I really need a help:
This is: compile file:
compile 'com.android.support:appcompat-v7:25.0.0'
compile 'com.android.support:mediarouter-v7:25.0.0'
compile 'com.googlecode.android-query:android-query:0.25.9'
compile 'com.google.android.gms:play-services-cast-framework:10.2.0'
this is logcat:
Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Landroid/support/v7/app/MediaRouteButton;
at com.jlabs.pluginplayer.view.MediaPlayerView.addMediaButton(MediaPlayerView.java:533)
at com.jlabs.pluginplayer.view.MediaPlayerView.access$4200(MediaPlayerView.java:53)
at com.jlabs.pluginplayer.view.MediaPlayerView$3.run(MediaPlayerView.java:514)
at android.app.Activity.runOnUiThread(Activity.java:5524)
at com.jlabs.pluginplayer.view.MediaPlayerView.preload(MediaPlayerView.java:490)
at com.jlabs.pluginplayer.PlayerActivity.onResume(PlayerActivity.java:330)
at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1258)
at android.app.Activity.performResume(Activity.java:6327)
at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3092)
at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3134)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2481)
at android.app.ActivityThread.-wrap11(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5417)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
Caused by: java.lang.ClassNotFoundException: Didn't find class "android.support.v7.app.MediaRouteButton" on path: DexPathList[[zip file "/data/app/jp.tsutayamovie-1/base.apk"],nativeLibraryDirectories=[/data/app/jp.tsutayamovie-1/lib/arm, /data/app/jp.tsutayamovie-1/base.apk!/lib/armeabi-v7a, /vendor/lib, /system/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
at com.jlabs.pluginplayer.view.MediaPlayerView.addMediaButton(MediaPlayerView.java:533)
at com.jlabs.pluginplayer.view.MediaPlayerView.access$4200(MediaPlayerView.java:53)
at com.jlabs.pluginplayer.view.MediaPlayerView$3.run(MediaPlayerView.java:514)
at android.app.Activity.runOnUiThread(Activity.java:5524)
at com.jlabs.pluginplayer.view.MediaPlayerView.preload(MediaPlayerView.java:490)
at com.jlabs.pluginplayer.PlayerActivity.onResume(PlayerActivity.java:330)
at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1258)
at android.app.Activity.performResume(Activity.java:6327)
at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3092)
at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3134)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2481)
at android.app.ActivityThread.-wrap11(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5417)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
Suppressed: java.lang.ClassNotFoundException: android.support.v7.app.MediaRouteButton
at java.lang.Class.classForName(Native Method)
at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
... 20 more
Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack trace available
How can I fix it?
Based from this thread, you are getting that error because of the following reasons:
In your gradle build file, maybe your app is targeting and compiling with the beta version of android that is still in development with:
compileSdkVersion 'android-L'
buildToolsVersion '20'
as well as
minSdkVersion 20
targetSdkVersion 20
First thing to note is that this app will not run correctly (at this time) on any device without android-L flashed to it.
Additional reference: java.lang.NoClassDefFoundError: Failed resolution of: Landroid/support/v4/os/BuildCompat
Check your classpath contains that jar (AppCompat), if your classpath doesn't contain the jar then just add that class in your classpath.
Hope this helps!