Android Question ClassNotFoundException

Discussion in 'Android Questions' started by mw71, Apr 14, 2019.

  1. mw71

    mw71 Active Member Licensed User


    i use this Modul (ZipManager, with Inline Java) to Zip the Files before upload to Google Drive:

    now a user and Firebase Report a Crash. The Main reason/error is:
    Caused by java.lang.ClassNotFoundException
    Didn't find class "$ResumableSub_upload_Backup" on path: DexPathList[[zip file "/system/framework/org.apache.http.legacy.boot.jar", zip file "/data/app/"],nativeLibraryDirectories=[/data/app/, /system/lib64, /vendor/lib64]]
    dalvik.system.BaseDexClassLoader.findClass (
    (if you Need more Error Message vom CrashAnalyics, or Code, let me know)

    Device is a Samsung with Android 9 (on my Device with Android 9, and lower, all fine)

    what is the reason and what can i do to fix it?
  2. Erel

    Erel Administrator Staff Member Licensed User

    It is not related to the zip feature. Are you using the old Http library instead of OkHttpUtils2?
  3. mw71

    mw71 Active Member Licensed User

    no, the new, internal, OkHttpUtils2
  4. Erel

    Erel Administrator Staff Member Licensed User

    Can you post the code in: upload_Backup ?
  5. mw71

    mw71 Active Member Licensed User

    Sub Process_Globals
    Dim FileList_Backup As List
    Dim FileList_Backup_Archiv As List
    Dim FileList_Backup_Remote As Map
    Dim FileList_Backup_Remote_Archiv As Map
    FileList_Backup_Remote, hold the Name and ID from the Files in the Google Drive
    FileList_Backup & FileList_Backup_Archiv hold the Phat and Name from the local Files to Upload

    Sub upload_Backup
        varSize=FileList_Backup.Size + FileList_Backup_Archiv.Size

    For i=0 To FileList_Backup.Size-1
            varCounter=i + 
            varDrive_qDatei = FileList_Backup.Get(i)
            varReturn_FileFound_ID =
    Dim erweiterung As String
    If varDrive_qDatei.Contains(".zip"Then
    End If
    If FileList_Backup_Remote.ContainsKey(varDrive_qDatei & erweiterung)=True Then
    "* Datei Remote")
                varDrive_zFileID=FileList_Backup_Remote.Get(varDrive_qDatei & erweiterung)
    "* Datei new")
    End If

    "Upload_File_to_Google, File: " & varDrive_qPhath & "/" & varDrive_qDatei)
            GDrive.UploadFile(varDrive_qDatei & erweiterung,varDrive_qPhath,varDrive_qDatei,varDrive_zPhath_ID,varDrive_zFileID)
    wait for Drive_FileUploaded(FileID As String)
    End Sub
    Upload the File to Google Part:
    'Upload a file to Google Drive
    'Name       - The Name of the filename (Name at Google Drive)
    'UploadDir  - The (local) folder of the upload file.
    'UploadFile - Filename (local) of the upload file
    'FileID     - The file ID on Google Drive. If not known, a new file will created.
    'Events : FileUploadDone(FileID as string)
    'Update einbauen/Testen
    'Parrent testen
    Sub UploadFile(Name As String, LocalDir As String, LocalFilename As String, Parrent As String, FileId As String)
    "GoogleDrive, UploadFile")

    Dim data() As Byte

    If Name = "" Then Name = LocalFilename
    "LocalDir:" & LocalDir)
    "LocalFilename:" & LocalFilename)
    "Parent:" & Parrent)
    "FileID:" & FileId)
    Dim h_ul As HttpJob
    If FileId = "" Then
    "Upload w/o File ID (create new File)")
    'Create the stream
                Dim boundary As String = "foo_bar_baz"
    Dim ContentType As String = "application/octet-stream"
    Dim EOL As StringChr(13) & Chr(10)

    Dim In As InputStream = File.OpenInput(LocalDir, LocalFilename)
    Dim out2 As OutputStream

    Dim m As Map
    "name", Name)
    If Parrent <>"" Then m.Put("parents",Array As String(Parrent))

    Dim Jg As JSONGenerator

    'The first half of the POST contains the JSON data AND the Content Type from above.
                Dim RR As String = "--" & boundary & EOL & _
    "Content-Type: application/json; charset=UTF-8" & EOL & EOL & _
                                Jg.ToString & EOL & EOL & _
    "--" & boundary & EOL & _
    "Content-Type: " & ContentType & EOL & EOL
                data = (RR).GetBytes(
    0, data.Length)                            'Write it To the Stream.
                File.Copy2(In, out2)                                            'Add the File itself To the Stream.
                data = (EOL & EOL & "--" & boundary & "--").GetBytes("UTF-8")    'Add the final boundary to the POST
                out2.WriteBytes(data, 0, data.Length)                            'Write it To the Stream Then make the Bytes the complete Stream.
                data = out2.ToBytesArray
    "", data)
    "multipart/related; boundary=" & boundary)
    "Authorization""Bearer " & myAccessToken)
    "Upload mit File ID (File Content Update)")
    'Create a new stream
                Dim OutUpdate As OutputStream
    Dim InUpate As InputStream = File.OpenInput(LocalDir, LocalFilename)
    1000)            'Initialize the stream
                File.Copy2(InUpate, OutUpdate)                    'Copy the filestream in the output stream
                data = OutUpdate.ToBytesArray                    'Fill export data array
    "" & "/" & FileId & "?uploadType=media", data)
    "Authorization""Bearer " & myAccessToken)
    End If

    wait For (h_ul) JobDone(h_ul As HttpJob)

    If h_ul.Success Then
    "Upload File Success")
                Dim j As JSONParser
    Dim Map1 As Map
                Map1 = J.NextObject
    End If

    "GoogleUpload File Error")
    Dim writer As TextWriter
            writer.WriteLine(LocalFilename & 
    ", " & LastException.Message)
    End Try
        CallSubDelayed2(evModule, evName & 
    "_FileUploaded", FileId)
    End Sub
  6. Erel

    Erel Administrator Staff Member Licensed User

    This code is not needed. HttpJob has built-in support for multipart requests.

    This is a strange error. If there is only a single report of this error then you should probably ignore it for now.
  7. mw71

    mw71 Active Member Licensed User

    now, i know (and use it for new cases). i have write this code a view years before and it works.

    Yes, at the moment it is a single Report (1 User/Device, a view times). I will see what will happen in the future.

    many thanks for view/help
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice