Hi,
I have a very strange error.
If I change the name of a classe, from clsinappbilling.bas to clsinappbilling3.bas, then the sub "ReadMapAsB4XObject" (the procedure is in a general module "mAllg") cannot read a file anymore, although the classe has not changed.
Where can the problem be?
The name "applizenz" is a type in the classe.
Modul mAllg:
In the classe the file is read with this procedure:
Error:
I have a very strange error.
If I change the name of a classe, from clsinappbilling.bas to clsinappbilling3.bas, then the sub "ReadMapAsB4XObject" (the procedure is in a general module "mAllg") cannot read a file anymore, although the classe has not changed.
Where can the problem be?
The name "applizenz" is a type in the classe.
B4X:
Type Applizenz(PurchaseTime As Long, PurchaseToken As String, Sku As String)
Modul mAllg:
B4X:
Public Sub ReadMapAsB4XObject(sDir As String, sFilename As String) As Map
Dim raf As RandomAccessFile
raf.Initialize2(sDir, sFilename, False, True)
Dim mp As Map = raf.ReadB4XObject(raf.CurrentPosition)
raf.Close
Return mp
End Sub
In the classe the file is read with this procedure:
B4X:
Private Sub GetOwnedProductsOffline
If File.Exists(File.DirInternal,"lizenz.mp") Then
'Der Lizenz-File wird als B4XObject gespeichert
ReadLizenzFile
End If
End Sub
Private Sub ReadLizenzFile
Dim lizenz As Applizenz
Dim mp As Map
mp.Initialize
mp = mAllg.ReadMapAsB4XObject(File.DirInternal, "lizenz.mp")
End If
Error:
*** Service (starter) Create ***
Error occurred on line: 890 (mAllg)
java.lang.RuntimeException: java.lang.ClassNotFoundException: fg.cronomillemiglia.clsinappbilling$_applizenz
at anywheresoftware.b4a.randomaccessfile.B4XSerializator.readType(B4XSerializator.java:314)
at anywheresoftware.b4a.randomaccessfile.B4XSerializator.readObject(B4XSerializator.java:374)
at anywheresoftware.b4a.randomaccessfile.B4XSerializator.readMap(B4XSerializator.java:248)
at anywheresoftware.b4a.randomaccessfile.B4XSerializator.readObject(B4XSerializator.java:364)
at anywheresoftware.b4a.randomaccessfile.B4XSerializator.ReadObject(B4XSerializator.java:129)
at anywheresoftware.b4a.randomaccessfile.RandomAccessFile.ReadB4XObject(RandomAccessFile.java:340)
at fg.cronomillemiglia.mallg._readmapasb4xobject(mallg.java:2211)
at fg.cronomillemiglia.clsinappbilling3._readlizenzfile(clsinappbilling3.java:1554)
at fg.cronomillemiglia.clsinappbilling3._getownedproductsoffline(clsinappbilling3.java:1524)
at fg.cronomillemiglia.clsinappbilling3._initialize(clsinappbilling3.java:440)
at fg.cronomillemiglia.starter._service_create(starter.java:1504)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:732)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:351)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:146)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:193)
at fg.cronomillemiglia.starter.onCreate(starter.java:56)
at android.app.ActivityThread.handleCreateService(ActivityThread.java:3342)
at android.app.ActivityThread.-wrap4(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1680)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6518)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
Caused by: java.lang.ClassNotFoundException: fg.cronomillemiglia.clsinappbilling$_applizenz
at java.lang.Class.classForName(Native Method)
at java.lang.Class.forName(Class.java:453)
at java.lang.Class.forName(Class.java:378)
at anywheresoftware.b4a.randomaccessfile.RandomAccessFile.readTypeClass(RandomAccessFile.java:583)
at anywheresoftware.b4a.randomaccessfile.B4XSerializator.readType(B4XSerializator.java:291)
... 27 more
Caused by: java.lang.ClassNotFoundException: Didn't find class "fg.cronomillemiglia.clsinappbilling$_applizenz" on path: DexPathList[[zip file "/data/app/fg.cronomillemiglia-sVbtZAWHHM9Wa59Pn9In2Q==/base.apk"],nativeLibraryDirectories=[/data/app/fg.cronomillemiglia-sVbtZAWHHM9Wa59Pn9In2Q==/lib/arm64, /system/lib64, /system/vendor/lib64]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:125)
at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
... 32 more
** Service (starter) Start **