android - FATAL EXCEPTION java.lang.NoClassDefFoundError: Failed resolution of: Lorg/apache/http/util/Args -
i sending recorded audio file server using httppost
method, receiving following error:
fatal exception java.lang.noclassdeffounderror: failed resolution of: lorg/apache/http/util/args
here code:
file = new file(environment.getexternalstoragedirectory().getabsolutepath()+"/" + "javacodegeeksrecording.3gpp"); string yournodejsbluemixroute = "http://mobilefeedbackform.mybluemix.net"; try { toast.maketext(mainactivity.this, "inside try", toast.length_long) .show(); system.out.println(is); httpclient client = new defaulthttpclient(); httppost post = new httppost(yournodejsbluemixroute); toast.maketext(mainactivity.this, "before sending", toast.length_long) .show(); post.setheader("enctype", "multipart/form-data"); /*filebody bin = new filebody(is);*/ filebody fb = new filebody(is, "audio/3gpp"); multipartentity reqentity = new multipartentity(httpmultipartmode.browser_compatible); reqentity.addpart("file", fb); /*i believe "file" name in php part*/ post.setentity(reqentity); httpresponse response = client.execute(post); toast.maketext(mainactivity.this, "now sending", toast.length_long) .show(); httpentity resentity = response.getentity(); if (resentity != null) { string responsebody = entityutils.tostring(resentity); string resp = responsebody; toast.maketext(mainactivity.this, resp, toast.length_long) .show(); log.i("response", entityutils.tostring(resentity)); } } catch (exception e) { e.printstacktrace(); } } catch (exception e) { // todo auto-generated catch block e.printstacktrace(); } }
what missing?
logcat errors:
08-19 19:57:17.517: e/androidruntime(1377): fatal exception: main 08-19 19:57:17.517: e/androidruntime(1377): process: com.example.android_test, pid: 1377 08-19 19:57:17.517: e/androidruntime(1377): java.lang.noclassdeffounderror: failed resolution of: lorg/apache/http/util/args; 08-19 19:57:17.517: e/androidruntime(1377): @ org.apache.http.entity.mime.content.abstractcontentbody.<init>(abstractcontentbody.java:48) 08-19 19:57:17.517: e/androidruntime(1377): @ org.apache.http.entity.mime.content.filebody.<init>(filebody.java:96) 08-19 19:57:17.517: e/androidruntime(1377): @ org.apache.http.entity.mime.content.filebody.<init>(filebody.java:85) 08-19 19:57:17.517: e/androidruntime(1377): @ com.example.android_test.mainactivity.play(mainactivity.java:181) 08-19 19:57:17.517: e/androidruntime(1377): @ com.example.android_test.mainactivity$3.onclick(mainactivity.java:91) 08-19 19:57:17.517: e/androidruntime(1377): @ android.view.view.performclick(view.java:4756) 08-19 19:57:17.517: e/androidruntime(1377): @ android.view.view$performclick.run(view.java:19749) 08-19 19:57:17.517: e/androidruntime(1377): @ android.os.handler.handlecallback(handler.java:739) 08-19 19:57:17.517: e/androidruntime(1377): @ android.os.handler.dispatchmessage(handler.java:95) 08-19 19:57:17.517: e/androidruntime(1377): @ android.os.looper.loop(looper.java:135) 08-19 19:57:17.517: e/androidruntime(1377): @ android.app.activitythread.main(activitythread.java:5221) 08-19 19:57:17.517: e/androidruntime(1377): @ java.lang.reflect.method.invoke(native method) 08-19 19:57:17.517: e/androidruntime(1377): @ java.lang.reflect.method.invoke(method.java:372) 08-19 19:57:17.517: e/androidruntime(1377): @ com.android.internal.os.zygoteinit$methodandargscaller.run(zygoteinit.java:899) 08-19 19:57:17.517: e/androidruntime(1377): @ com.android.internal.os.zygoteinit.main(zygoteinit.java:694) 08-19 19:57:17.517: e/androidruntime(1377): caused by: java.lang.classnotfoundexception: didn't find class "org.apache.http.util.args" on path: dexpathlist[[zip file "/data/app/com.example.android_test-1/base.apk"],nativelibrarydirectories=[/vendor/lib, /system/lib]] 08-19 19:57:17.517: e/androidruntime(1377): @ dalvik.system.basedexclassloader.findclass(basedexclassloader.java:56) 08-19 19:57:17.517: e/androidruntime(1377): @ java.lang.classloader.loadclass(classloader.java:511) 08-19 19:57:17.517: e/androidruntime(1377): @ java.lang.classloader.loadclass(classloader.java:469) 08-19 19:57:17.517: e/androidruntime(1377): ... 15 more 08-19 19:57:17.517: e/androidruntime(1377): suppressed: java.lang.classnotfoundexception: org.apache.http.util.args 08-19 19:57:17.517: e/androidruntime(1377): @ java.lang.class.classforname(native method) 08-19 19:57:17.517: e/androidruntime(1377): @ java.lang.bootclassloader.findclass(classloader.java:781) 08-19 19:57:17.517: e/androidruntime(1377): @ java.lang.bootclassloader.loadclass(classloader.java:841) 08-19 19:57:17.517: e/androidruntime(1377): @ java.lang.classloader.loadclass(classloader.java:504) 08-19 19:57:17.517: e/androidruntime(1377): ... 16 more 08-19 19:57:17.517: e/androidruntime(1377): caused by: java.lang.noclassdeffounderror: class not found using boot class loader; no stack available
i working on apache stuff, , run error. able fix downloading .jar , link in project settings manually.
you should move jar under app/build/libs files >> project structure >> dependencies >> + >> file dependencies >> , change provided instead of compile (compile cause java exit nonzero value 1 if importing jars)
Comments
Post a Comment