致命异常:主要java.lang.noclassdeffounderror:外部library.jar.class android studio [英] Fatal exception: main java.lang.noclassdeffounderror: external library.jar.class android studio

查看:100
本文介绍了致命异常:主要java.lang.noclassdeffounderror:外部library.jar.class android studio的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个处理语音的Android应用程序,我在JAVA上准备了语音基本项目(依赖于android项目)所以我在JAVA 7编译器中编译了JAVA项目,并将该java项目导出为可运行的jar。我把这个jar放到我的android studio项目的l​​ibs文件夹中,右键单击选中的AS A库,我得到了构建成功的消息。但是当我尝试运行android项目时,它给出了我的错误说,

 FATAL EXCEPTION:main进程:in.automator.automator,PID:4242 
java.lang .NoClassDefFoundError:jar_filename.Storage.class_in_jar_file





但是所说的类在jar文件中,唯一可疑的是提到的类文件看起来像这样



 import javax.sound.sampled.AudioFileFormat; 
import javax.sound.sampled.AudioFormat;
import javax.sound.sampled.AudioFormat.Encoding;
import marf.util.InvalidSampleFormatException;

公共类MARFAudioFileFormat扩展AudioFileFormat {
....

...

....

}





它指的是javax.sound.sampled,所以可能会导致问题。



我在android studio中使用JRE 7并在Compiler&中导出java项目本身。



如何解决此错误?提前致谢。



我尝试了什么:



我尝试过在谷歌搜索问题,但没有得到解决方案,可以解决问题。我尝试了一切。

解决方案

请参阅 SpeechRecognizer | Android开发者 [ ^ ]

I am developing an android app which process speech and I have speech basic project (dependency for android project) ready on JAVA so I compiled JAVA project in eclipse in JAVA 7 compiler and exported that java project as a runnable jar. I put this jar into my android studio project's libs folder and by right clicking selected AS A library, I got build successful message. But when I try run the android project it gives me error saying,

FATAL EXCEPTION: main Process: in.automator.automator, PID: 4242
java.lang.NoClassDefFoundError: jar_filename.Storage.class_in_jar_file



but the said class is there in the jar file, the only doubtful thing is the mentioned class file looks something like this

import javax.sound.sampled.AudioFileFormat;
import javax.sound.sampled.AudioFormat;
import javax.sound.sampled.AudioFormat.Encoding;
import marf.util.InvalidSampleFormatException;

public class MARFAudioFileFormat extends AudioFileFormat {
....

 ...

....

}



It refers javax.sound.sampled, so possibly that might causing the problem.

I am using JRE 7 in android studio and exporting java project in Compiler & itself.

How to resolve this error? Thanks in advance.

What I have tried:

I tried searching on the google for the problem but didn't got the solution which can resolve the issue. I tried everything.

解决方案

See SpeechRecognizer | Android Developers[^].


这篇关于致命异常:主要java.lang.noclassdeffounderror:外部library.jar.class android studio的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆