Click here to Skip to main content
15,891,253 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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.
Posted
Comments
Richard MacCutchan 12-Feb-16 3:37am    
Try building the jarfile in Android Studio rather than eclipse.
prafull agrawal 12-Feb-16 5:23am    
@Richard What about that javax.sound.sampled reference in a class inside of jar, when building on android studio??
Richard MacCutchan 12-Feb-16 5:38am    
It would appear that it is not available in Android.
prafull agrawal 12-Feb-16 5:42am    
@Richard firs of all thanks for the reply. I will give it a try but still I am confused that if it will give above said error then how would I get the desired jar package??
Richard MacCutchan 12-Feb-16 6:54am    
If the package is not available in Android then you cannot use it. Are you sure that the error message you see actually refers to the class you are trying to use?

1 solution

 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900