Android Question Error in OKHttpUtill

Bel

Member
Licensed User
Hi
I use OkHttpUtill in my project
I dont have any problem when i use relate library in other project
but in current project occur error when use it
The project's library is :
Library1=core
Library2=stringutils
Library3=json
Library4=reflection
Library5=network
Library6=encryption
Library7=byteconverter
Library8=androidresources
Library9=ahlocale
Library10=resources
Library11=picasso
Library12=slidingmenuwrapper
Library13=viewsetting
Library14=phone
Library15=ahpreferenceactivity
Library16=date
Library17=dialogs
Library18=id
Library19=webviewextras2
Library20=sllvonscroll
Library21=settings
Library22=slidingpanels
Library23=touchimageview
Library24=richstring
Library25=datetimepicker
Library26=ime
Library27=randomaccessfile
Library28=threading
Library29=teameightjustify
Library30=checksignature
Library31=msshowtips
Library32=ahviewpager
Library33=javaobject
Library34=labelextras
Library35=googleprogressbar
Library36=sharemyapp
Library37=icosflip3dview
Library38=barcodegenerator
Library39=http
Library40=httputils2
and error :
* Activity (main) Pause, UserClosed = false **
** Activity (actmenu) Create, isFirst = true **
actmenu_activity_create (java line: 468)
java.lang.NoClassDefFoundError: com.squareup.okhttp.HttpResponseCache
at com.squareup.picasso_OkHttpLoader.<init>(OkHttpLoader.java:58)
at com.squareup.picasso_OkHttpLoader.<init>(OkHttpLoader.java:35)
at com.squareup.picasso_OkHttpLoader.<init>(OkHttpLoader.java:25)
at com.squareup.picasso.Utils$OkHttpLoaderCreator.create(Utils.java:287)
at com.squareup.picasso.Utils.createDefaultLoader(Utils.java:199)
at com.squareup.picasso.Picasso$Builder.build(Picasso.java:617)
at com.squareup.picasso.Picasso.with(Picasso.java:542)
at uk.co.martinpearman.b4a.squareup.picasso.Picasso.Initialize(Picasso.java:51)
at shop.opencart.appstudent.actmenu._activity_create(actmenu.java:468)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:525)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:169)
at shop.opencart.appstudent.actmenu.afterFirstLayout(actmenu.java:102)
at shop.opencart.appstudent.actmenu.access$000(actmenu.java:17)
at shop.opencart.appstudent.actmenu$WaitForLayout.run(actmenu.java:80)
at android.os.Handler.handleCallback(Handler.java:800)
at android.os.Handler.dispatchMessage(Handler.java:100)
at android.os.Looper.loop(Looper.java:194)
at android.app.ActivityThread.main(ActivityThread.java:5392)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:525)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:833)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600)
at dalvik.system.NativeStart.main(Native Method)
 

Bel

Member
Licensed User
I'm not Erel, but as it seems you have to Switch to a higher Version of Picasso.

As B4A compiles to Java you can do a Google search, too.
Oh i know you aren't Erel :)
I guest needed to new version picasso but there isn't new version in forum
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
do you have okhttp running or do you still use the old httputils? Edit; ok, due to your libs-list above you are still using the old httputils.

Maybe you just need to add okhttp reference when you compile.

Solution is probably: Swith to okHTTP and okHTTPUTILS
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
I use OkHttpUtill in my project
I read you post again but carefully.

NO, there is NO okHTTP and there is no okhttputils in your libslist!
But Picasso is using okHTTP to download so you need to add it to your project.

Library1=core
Library2=stringutils
Library3=json
Library4=reflection
Library5=network
Library6=encryption
Library7=byteconverter
Library8=androidresources
Library9=ahlocale
Library10=resources
Library11=picasso
Library12=slidingmenuwrapper
Library13=viewsetting
Library14=phone
Library15=ahpreferenceactivity
Library16=date
Library17=dialogs
Library18=id
Library19=webviewextras2
Library20=sllvonscroll
Library21=settings
Library22=slidingpanels
Library23=touchimageview
Library24=richstring
Library25=datetimepicker
Library26=ime
Library27=randomaccessfile
Library28=threading
Library29=teameightjustify
Library30=checksignature
Library31=msshowtips
Library32=ahviewpager
Library33=javaobject
Library34=labelextras
Library35=googleprogressbar
Library36=sharemyapp
Library37=icosflip3dview
Library38=barcodegenerator
Library39=http
Library40=httputils2

39 and 40 are NOT the ok-Variants
 
Last edited:
Upvote 0

Bel

Member
Licensed User
I read you post again but carefully.

NO, there is NO okHTTP and there is no okhttputils in your libslist!
But Picasso is using okHTTP to download so you need to add it to your project.



39 and 40 are NOT the ok-Variants
No there is no OKHttp lib in list but when i add it to library and remove httputil2 then it get error
I dont have a new version picasso
if i can get new version picasso lib,my problem will solve
other way?
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
attach sample project
The "old" picassonative.jar is not compatible

Solution: download a new picasso jar. i attach one

Edit picasso.xml and replace
<dependsOn>picassonative</dependsOn>
with
<dependsOn>picasso-2.5.2</dependsOn>
Run your sample again after you reloaded the libraries.
 

Attachments

  • picasso-2.5.2.jar
    117.6 KB · Views: 202
Upvote 0

Bel

Member
Licensed User
The "old" picassonative.jar is not compatible

Solution: download a new picasso jar. i attach one

Edit picasso.xml and replace

with

Run your sample again after you reloaded the libraries.
I test it,but again occur error.
error is :
java.lang.NoSuchMethodError: com.squareup.picasso.Picasso.load
at uk.co.martinpearman.b4a.squareup.picasso.Picasso.LoadUrl(Picasso.java:72)
at b4a.example.main._activity_create(main.java:339)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:525)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:169)
at b4a.example.main.afterFirstLayout(main.java:102)
at b4a.example.main.access$000(main.java:17)
at b4a.example.main$WaitForLayout.run(main.java:80)
at android.os.Handler.handleCallback(Handler.java:800)
at android.os.Handler.dispatchMessage(Handler.java:100)
at android.os.Looper.loop(Looper.java:194)
at android.app.ActivityThread.main(ActivityThread.java:5392)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:525)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:833)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600)
at dalvik.system.NativeStart.main(Native Method)
 
Upvote 0
Top