简体   繁体   English

com / sun / jna / android-arm / libjnidispatch.so在资源路径中找不到

[英]com/sun/jna/android-arm/libjnidispatch.so not found in resource path

All of the following is being done in Android Studio. 以下所有内容均在Android Studio中完成。

I have successfully compiled and tested the Android Watson Speech to Text demo app. 我已经成功编译并测试了Android Watson Speech to Text演示应用程序。 I then created a library project containing the Watson related API's and a 2nd app project with a simple UI that references the Watson library project. 然后,我创建了一个包含Watson相关API的库项目和一个带有引用Watson库项目的简单UI的第二个应用程序项目。 The UI successfully starts and calls Watson speech to text api's. UI成功启动并将Watson语音调用为文本api。 I thought I was set to use the Watson library project for real. 我以为我已经准备好使用Watson库项目了。

So I incorporated the Watson API project into my 'real' project. 所以我将Watson API项目合并到了我的“真实”项目中。 When I start the app connection to Watson I am getting: 当我启动与Watson的应用程序连接时,我得到:

E/AndroidRuntime: FATAL EXCEPTION: initStreamToServerThread
                   Process: com.sixflags.android, PID: 25481
java.lang.UnsatisfiedLinkError: Native library (com/sun/jna/android-arm/libjnidispatch.so) not found in resource path (.)
at com.sun.jna.Native.loadNativeDispatchLibraryFromClasspath(Native.java:786)                                                                              
at com.sun.jna.Native.loadNativeDispatchLibrary(Native.java:746)                                                                            
at com.sun.jna.Native.<clinit>(Native.java:135)                                                                          
at com.sun.jna.NativeLibrary.<clinit>(NativeLibrary.java:82)                                                                          
at com.sun.jna.NativeLibrary.getInstance(NativeLibrary.java:337)                                                                          
at com.ibm.watson.developer_cloud.android.speech_to_text.v1.opus.JNAOpus.<clinit>(JNAOpus.java:42)                                                                         
at com.ibm.watson.developer_cloud.android.speech_to_text.v1.audio.OggOpusEnc.initEncoderWithUploader(OggOpusEnc.java:53)
at com.ibm.watson.developer_cloud.android.speech_to_text.v1.audio.WebSocketUploader.initStreamAudioToServer(WebSocketUploader.java:113)
at com.ibm.watson.developer_cloud.android.speech_to_text.v1.audio.WebSocketUploader.access$000(WebSocketUploader.java:46)
at com.ibm.watson.developer_cloud.android.speech_to_text.v1.audio.WebSocketUploader$2.run(WebSocketUploader.java:175) 

I have included speech-android-wrapper.aar in the libs directory and have included in the gradle.build dependencies: 我在libs目录中包含了speech-android-wrapper.aar,并且包含在gradle.build依赖项中:

compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.ibm.watson.developer_cloud:java-sdk:2.10.0'
compile(name: 'speech-android-wrapper', ext: 'aar')

My app is rather large and is using multi-dex'ing so I am wondering if this could a clue to what is going wrong. 我的应用程序相当大,正在使用multi-dex'ing,所以我想知道这是否可以找出问题的线索。

I did run into one other issue with a AndroidManifest.xml manifest conflict in the application section that I resolved with adding: 我确实在应用程序部分遇到了另一个问题与AndroidManifest.xml清单冲突,我通过添加解决了这个问题:

tools:replace="android:icon,android:name"

I don't see how that could cause the link error but just throwing it out there in case I am missing the significance of it. 我不知道这怎么可能导致链接错误,但只是把它扔出去,以防我错过了它的重要性。

Looking for suggestions. 寻找建议。

If you're referencing the module of "speech-android-wrapper", please use this configuration in your gradle: 如果您正在引用“speech-android-wrapper”模块,请在您的gradle中使用此配置:

compile project(':speech-android-wrapper')

If you're using AAR libs, please try this: 如果您正在使用AAR库,请尝试以下操作:

dependencies {
  //...
  debugCompile(name:'speech-android-wrapper-debug', ext:'aar')
  releaseCompile(name:'speech-android-wrapper-release', ext:'aar')
}

... ...

repositories{
  //...
  flatDir{
    dirs 'libs'
  }
}

Icon issue was resolved already in another repo, will be merged to the Watson Developer Cloud repo soon. 图标问题已在另一个回购中解决,很快将合并到Watson Developer Cloud回购。

Hope it helps. 希望能帮助到你。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在资源路径中找不到 JNA 原生支持 (/com/sun/jna/linux-arm/libjnidispatch.so) - JNA native support (/com/sun/jna/linux-arm/libjnidispatch.so) not found in resource path 在资源路径中找不到本机库(com / sun / jna / android-aarch64 / libjnidispatch.so) - Native library (com/sun/jna/android-aarch64/libjnidispatch.so) not found in resource path UnsatisfiedLinkError:在资源路径 (.) 中找不到本机库 (com/sun/jna/android-x86-64/libjnidispatch.so) - UnsatisfiedLinkError: Native library (com/sun/jna/android-x86-64/libjnidispatch.so) not found in resource path (.) android-arm/libjnidispatch.so 未找到错误 - android-arm/libjnidispatch.so not found error 在资源路径中找不到线程“主” java.lang.UnsatisfiedLinkError中的异常:jnidispatch(/ com / sun /jna/win32-x86/jnidispatch.dll) - Exception in thread “main” java.lang.UnsatisfiedLinkError: jnidispatch (/com/sun /jna/win32-x86/jnidispatch.dll) not found in resource path 未找到 JNA。 本机方法将被禁用。 java.lang.ClassNotFoundException: com.sun.jna.Native - JNA not found. native methods will be disabled. java.lang.ClassNotFoundException: com.sun.jna.Native 在aarch64 Odroid C2上的Java 1.8.0_73上运行WebStorm-143.382.36在libjnidispatch.so上失败 - Running WebStorm-143.382.36 on Java 1.8.0_73 on aarch64 Odroid C2 fails on libjnidispatch.so JNA - 设置资源路径 - JNA - Set resource Path ARM64机器上的Cassandra启动失败(java.lang.NoClassDefFoundError:无法初始化类com.sun.jna.Native) - Cassandra Startup failure on ARM64 machine (java.lang.NoClassDefFoundError: Could not initialize class com.sun.jna.Native) 无法使用 JNA:com.sun.jna.Library is not access - Can not use JNA: com.sun.jna.Library is not accessible
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM