Android Question Strange ClassNotFoundException

Discussion in 'Android Questions' started by Arf, Oct 9, 2019 at 12:32 PM.

  1. Arf

    Arf Active Member Licensed User

    I can't seem to resolve an issue I'm having.
    I changed the Bluetooth Chat tutorial project to suit my needs, all was working well.
    I got rid of the BluetoothManager class file, and shifted all the functionality from there into the Starter Service, in an experiment of sorts to see if the behaviour was the same (Iam getting slightly different behaviour in my modified project than I do in my old reliable project, which runs the bluetooth code from a Service).

    Anyhow, I get this error at runtime:
    *** Service (starter) Create ***
    ** Service (starter) Start **
    ** Activity (main) Create, isFirst = true **
    Error occurred on line: 38 (Main)
    java.lang.RuntimeException: java.lang.ClassNotFoundException: anywheresoftware.b4a.samples.bluetooth.bluetoothmanager$_nameandmac
    at anywheresoftware.b4a.randomaccessfile.B4XSerializator.readType(
    at anywheresoftware.b4a.randomaccessfile.B4XSerializator.readObject(
    at anywheresoftware.b4a.randomaccessfile.B4XSerializator.ReadObject(
    at ...blah blah blah

    I don't understand why there is a 'bluetoothmanager$_nameandmac mentioned. I deleted the BluetoothManager file from the project, and cleaned the project before compiling.
    The NameAndMac type defition is now in a code module called 'Types'.

    Any ideas as to what I am doing wrong?
  2. agraham

    agraham Expert Licensed User

    Have you got a left-over global in Starter still referencing BluetoothManager.NameAndMac?
  3. Arf

    Arf Active Member Licensed User

    No, a 'Find all references' finds no record of 'BluetoothManager' anywhere.
  4. DonManfred

    DonManfred Expert Licensed User

    you are reading a serialized object back?
    At time you wrote the serialized object the bluetoothmanager was in your project?
    Arf likes this.
  5. Arf

    Arf Active Member Licensed User

    That'll be it :)
  6. DonManfred

    DonManfred Expert Licensed User

    so there is nothing strange here
  7. Arf

    Arf Active Member Licensed User

    No. The serializer is simply far cleverer than I am.
  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