Android Question Errors in 6.80

NJDude

Expert
Licensed User
Longtime User
Playing with the new B4A and compiling some previous code I'm encountering several problems, now is with OkHTTP:
B4X:
** Activity (main) Resume **
** Activity (main) Pause, UserClosed = false **
** Activity (about) Create, isFirst = true **
** Activity (about) Resume **
** Activity (about) Pause, UserClosed = true **
** Activity (main) Resume **
** Service (njstreamplayer) Create **
java.lang.NoClassDefFoundError: Failed resolution of: Lokhttp3/OkHttpClient$Builder;
	at anywheresoftware.b4h.okhttp.OkHttpClientWrapper.sharedInit(OkHttpClientWrapper.java:112)
	at anywheresoftware.b4h.okhttp.OkHttpClientWrapper.Initialize(OkHttpClientWrapper.java:77)
	at uncledroid.radio.library.njstreamplayer._service_create(njstreamplayer.java:361)
	at java.lang.reflect.Method.invoke(Native Method)
	at anywheresoftware.b4a.BA.raiseEvent2(BA.java:179)
	at anywheresoftware.b4a.BA.raiseEvent(BA.java:163)
	at uncledroid.radio.library.njstreamplayer.onCreate(njstreamplayer.java:54)
	at android.app.ActivityThread.handleCreateService(ActivityThread.java:3191)
	at android.app.ActivityThread.-wrap5(ActivityThread.java)
	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1567)
	at android.os.Handler.dispatchMessage(Handler.java:102)
	at android.os.Looper.loop(Looper.java:154)
	at android.app.ActivityThread.main(ActivityThread.java:6119)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
Caused by: java.lang.ClassNotFoundException: Didn't find class "okhttp3.OkHttpClient$Builder" on path: DexPathList[[zip file "/data/app/uncledroid.radio.player.free-2/base.apk"],nativeLibraryDirectories=[/data/app/uncledroid.radio.player.free-2/lib/arm64, /system/lib64, /vendor/lib64]]
	at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:380)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
	... 16 more
java.lang.NoClassDefFoundError: Failed resolution of: Lokhttp3/OkHttpClient$Builder;
	at anywheresoftware.b4h.okhttp.OkHttpClientWrapper.sharedInit(OkHttpClientWrapper.java:112)
	at anywheresoftware.b4h.okhttp.OkHttpClientWrapper.Initialize(OkHttpClientWrapper.java:77)
	at uncledroid.radio.library.njstreamplayer._service_create(njstreamplayer.java:361)
	at java.lang.reflect.Method.invoke(Native Method)
	at anywheresoftware.b4a.BA.raiseEvent2(BA.java:179)
	at anywheresoftware.b4a.BA.raiseEvent(BA.java:163)
	at uncledroid.radio.library.njstreamplayer.onCreate(njstreamplayer.java:54)
	at android.app.ActivityThread.handleCreateService(ActivityThread.java:3191)
	at android.app.ActivityThread.-wrap5(ActivityThread.java)
	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1567)
	at android.os.Handler.dispatchMessage(Handler.java:102)
	at android.os.Looper.loop(Looper.java:154)
	at android.app.ActivityThread.main(ActivityThread.java:6119)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
Caused by: java.lang.ClassNotFoundException: Didn't find class "okhttp3.OkHttpClient$Builder" on path: DexPathList[[zip file "/data/app/uncledroid.radio.player.free-2/base.apk"],nativeLibraryDirectories=[/data/app/uncledroid.radio.player.free-2/lib/arm64, /system/lib64, /vendor/lib64]]
	at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:380)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
	... 16 more

I have the latest and greatest SDK installed, but it seems I'm missing something.

I haven't done any B4A writing in a long time, busy as hell at work. :p
 

DonManfred

Expert
Licensed User
Longtime User
Are you using a (old) library from you which depends on httputils?
If yes; try to recompile your old lib with b4a 6.8 to update the references to the newest okhttp.
If no: Can you strip it down to a small proect which shows the problem?
 
Upvote 0
Top