mohsen programmer Member May 7, 2024 #1 Hello friends, I am working on a B4A project and I got java.lang.NoClassDefFoundError: Failed resolution of: Ljava/util/Base64 error on Android 7. I tried using try-catch to handle this error, but to no avail. The application closes completely on some devices (force close) I jetified the library but it didn't work. Why doesn't try-catch work in this case? Is there a solution to prevent the app from force closing?
Hello friends, I am working on a B4A project and I got java.lang.NoClassDefFoundError: Failed resolution of: Ljava/util/Base64 error on Android 7. I tried using try-catch to handle this error, but to no avail. The application closes completely on some devices (force close) I jetified the library but it didn't work. Why doesn't try-catch work in this case? Is there a solution to prevent the app from force closing?
Erel B4X founder Staff member Licensed User Longtime User May 7, 2024 #2 This is a more severe error so it cannot caught. Use StringUtils for base64 encoding. Upvote 0
mohsen programmer Member May 7, 2024 #3 Erel said: This is a more severe error so it cannot caught. Use StringUtils for base64 encoding. Click to expand... Thank you for your answer. I don't use encryption, but I use a library that probably uses the base64 class. Upvote 0
Erel said: This is a more severe error so it cannot caught. Use StringUtils for base64 encoding. Click to expand... Thank you for your answer. I don't use encryption, but I use a library that probably uses the base64 class.
Erel B4X founder Staff member Licensed User Longtime User May 7, 2024 #4 This means that this library is a Java library and isn't compatible with Android (at least not older versions). Upvote 0
This means that this library is a Java library and isn't compatible with Android (at least not older versions).
mohsen programmer Member May 7, 2024 #5 Erel said: This means that this library is a Java library and isn't compatible with Android (at least not older versions). Click to expand... It works on top Androids like 12 and 13, but not on Android 7. Can't we first check if the user's Android has base64 or not? Upvote 0
Erel said: This means that this library is a Java library and isn't compatible with Android (at least not older versions). Click to expand... It works on top Androids like 12 and 13, but not on Android 7. Can't we first check if the user's Android has base64 or not?
Erel B4X founder Staff member Licensed User Longtime User May 10, 2024 #6 B4X: Private Sub CheckIfClassExists (class As String) As Boolean Try Dim j As JavaObject j.InitializeStatic(class) Return True Catch Return False End Try End Sub Upvote 0
B4X: Private Sub CheckIfClassExists (class As String) As Boolean Try Dim j As JavaObject j.InitializeStatic(class) Return True Catch Return False End Try End Sub