Android Question [SOLVED] Error Log - Section of #If JAVA - and crash

Harris

Expert
Licensed User
Longtime User
My app used to work until an hour ago (for 7 years)...
I am using an API and calling certain methods in it...

Can anyone read the debug and make any sense of it?
Do I have a corrupt file or what? I changed nothing in code and it started crashing with these results...

Thanks


B4X:
** Service (ecmmod) Start **
 Ecm Service Started
 ConnectTimeout - current status
java.lang.NoClassDefFoundError: Failed resolution of: Lorg/apache/http/util/EncodingUtils;
    at com.bluefire.api.Comm.SendData(Comm.java:775)
    at com.bluefire.api.Comm.SendData(Comm.java:754)
    at com.bluefire.api.Adapter.RebootAdapter(Adapter.java:1054)
    at com.bluefire.api.Adapter.Disconnect(Adapter.java:534)
    at com.bluefire.api.Adapter.Disconnect(Adapter.java:509)
    at cmv.btle.ecmmod$3.handleMessage(ecmmod.java:2669)
    at android.os.Handler.dispatchMessage(Handler.java:106)
    at android.os.Looper.loop(Looper.java:214)
    at android.app.ActivityThread.main(ActivityThread.java:7179)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:494)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:975)
Caused by: java.lang.ClassNotFoundException: Didn't find class "org.apache.http.util.EncodingUtils" on path: DexPathList[[zip file "/data/app/cmv.btle-UGUggbBDhdsCq2slEFmzNw==/base.apk"],nativeLibraryDirectories=[/data/app/cmv.btle-UGUggbBDhdsCq2slEFmzNw==/lib/arm, /system/lib, /system/vendor/lib]]
    at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:134)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
    ... 12 more
 

Johan Schoeman

Expert
Licensed User
Longtime User
It is missing a class - probably missing from #Additional jar: xxxxxx

Caused by: java.lang.ClassNotFoundException: Didn't find class "org.apache.http.util.EncodingUtils" on path: DexPathList[[zip file "/data/app/cmv.btle-UGUggbBDhdsCq2slEFmzNw==/base.apk"],nativeLibraryDirectories=[/data/app/cmv.btle-UGUggbBDhdsCq2slEFmzNw==/lib/arm, /system/lib, /system/vendor/lib]]
 
Upvote 0

Harris

Expert
Licensed User
Longtime User
Based on the section where the program dies, it is coming from the additional jar.
What gets me is that this process worked 100% up until now, with nothing changing in my source with regards to the api (jar).
 
Upvote 0

Harris

Expert
Licensed User
Longtime User

I said Nothing Changed? - famous last words....

Of course something changed -
<uses-sdk android:minSdkVersion="5" android:targetSdkVersion="28"/>
Was - targetSdkVersion="26" (or less) before...
NOW - targetSdkVersion="28"

Many things can go VERY sideways using 28, as well documented (and continually updated) by Erel.
My error was very similar to where I found the solution - and the exact problem.

Apparently, 28 strips out (or something) org.apache.http
The code below (manifest addition) forces it to stay - and be made available to my app (or more to the point, the #AdditionalJar that required it).

Thanks heavans for the search engine - and you smart guys that figure ALL this stuff out..., Good on ya...
B4X:
AddApplicationText(
<uses-library
      android:name="org.apache.http.legacy"
      android:required="false" />
)

Thx
 
Upvote 0

Harris

Expert
Licensed User
Longtime User
Had the issue before with BouncyCastle and SDK 26 vs SDK 28.
Thanks for pointing me in the right direction Johan (would have been lost without the nudge). After much review of 28, I was able to make it perform with 28. Guess I am good for Google Play! (not)
But, I am not going there... The lovely app updater does the job exceptionally well from my server (now that I got that running with OS 9 and sdk 28)- up here in the far north where the best connectivity is off the Northern Lights!
 
Upvote 0
Top