Android Question erro when i run app

Makumbi

Well-Known Member
Licensed User
Longtime User
B4X:
Invalid ID 0x00000000.
Stop listening is called on already closed AudioSource
ro.sf.lcd_density must be defined as a build property
ro.sf.lcd_density must be defined as a build property
** Activity (main) Create (first time) **
Couldn't load memtrack module
Error occurred on line: 0 (B4XPagesManager)
java.lang.Exception: Sub initialize signature does not match expected signature.
public static anywheresoftware.b4a.pc.RemoteObject b4a.example.b4xmainpage_subs_0._initialize(anywheresoftware.b4a.pc.RemoteObject,anywheresoftware.b4a.pc.RemoteObject) throws java.lang.Exception
class anywheresoftware.b4a.pc.RemoteObject,
channel 'fc855dd b4a.example/b4a.example.main (server)' ~ Channel is unrecoverably broken and will be disposed!
channel '802f3ee b4a.example/b4a.example.main (server)' ~ Channel is unrecoverably broken and will be disposed!
Missing BluetoothAdapter [CONTEXT service_id=111 ]
Scan couldn't start for Places [CONTEXT service_id=111 ]
Failed to open QEMU pipe 'qemud:network': Invalid argument
RemoteConnection failed to initialize: RemoteConnection failed to open pipe
Failed to open QEMU pipe 'qemud:network': Invalid argument
B4X:
Sub Activity_Create(FirstTime As Boolean)
    Dim pm As B4XPagesManager
    pm.Initialize(Activity)
End Sub
Error is flagged when i reach here
B4X:
Logger connected to: emulator-5554
--------- beginning of main
--------- beginning of system
Copying updated assets files (17)
** Activity (main) Create (first time) **
Error occurred on line: 0 (B4XPagesManager)
java.lang.Exception: Sub initialize signature does not match expected signature.
public static anywheresoftware.b4a.pc.RemoteObject b4a.example.b4xmainpage_subs_0._initialize(anywheresoftware.b4a.pc.RemoteObject,anywheresoftware.b4a.pc.RemoteObject) throws java.lang.Exception
class anywheresoftware.b4a.pc.RemoteObject,
B4X:
#Region Shared Files
#CustomBuildAction: folders ready, %WINDIR%\System32\Robocopy.exe,"..\..\Shared Files" "..\Files"
'Ctrl + click to sync files: ide://run?file=%WINDIR%\System32\Robocopy.exe&args=..\..\Shared+Files&args=..\Files&FilesSync=True
#End Region

#Macro: Title, Export B4XPages, ide://run?File=%B4X%\Zipper.jar&Args=%PROJECT_NAME%.zip

Sub Class_Globals
    Private Root As B4XView
    Private xui As XUI
    Dim dbName As String = "studentapp.db"
    Public SQL1 As SQL
    Private Phones As EditText
    Private Names As EditText
    Private Classr As EditText
    Private Button2 As Button
    Dim paydetail As Paycodes
    Public DbSql As B4XMainPage
End Sub
Private Sub InitializeDatabase
    Try
        Dim userData As Map
        userData.Initialize
        userData.Put("id", DBUtils.DB_INTEGER)
        userData.Put("regno", DBUtils.DB_TEXT)
        userData.Put("Name", DBUtils.DB_TEXT)
        userData.Put("Class", DBUtils.DB_TEXT)
        userData.Put("Stream", DBUtils.DB_TEXT)
        userData.Put("Paycode", DBUtils.DB_TEXT)
        userData.Put("account", DBUtils.DB_TEXT)
        userData.Put("date_fetched", DBUtils.DB_TEXT)

        If File.Exists(xui.DefaultFolder, dbName) = False Then
        DbSql.SQL1.Initialize(xui.DefaultFolder, dbName, True)
            DBUtils.CreateTable(DbSql.SQL1, "students", userData, "id")
            Log("DB Created Successfully")
            DBUtils.CreateTable(DbSql.SQL1, "DBVersion", CreateMap("version": DBUtils.DB_INTEGER), "")
            Log("DB Version: " & DBUtils.GetDBVersion(DbSql.SQL1))
        Else
            DbSql.SQL1.Initialize(xui.DefaultFolder, dbName, True)
            Log("Database already exists")
        End If
    Catch
        Log("InitializeDatabase Error: " & LastException.Message)
    End Try
End Sub
Public Sub Initialize
'    B4XPages.GetManager.LogEvents = True
    DbSql.SQL1.Initialize(xui.DefaultFolder, dbName, True)
End Sub

'This event will be called once, before the page becomes visible.
Private Sub B4XPage_Created (Root1 As B4XView)
    Root = Root1
   Root.LoadLayout("MainPage")
   DbSql = B4XPages.MainPage
 
    B4XPages.SetTitle(Me, "Dashboard")
    paydetail.Initialize
    'pgSingle.Initialize
 
 
    B4XPages.AddPage("idAdd",paydetail)
    'B4XPages.AddPage("idSingle",pgSingle)
    InitializeDatabase
End Sub

'You can see the list of page related events in the B4XPagesManager object. The event name is B4XPage.

Private Sub Button1_Click
    xui.MsgboxAsync("Hello world!", "B4X")
End Sub

Private Sub Button2_Click
 
    B4XPages.ShowPage("idAdd")
End Sub
 

Attachments

  • Backup sampleb4a 2026-09-11 18.08.zip
    14.3 KB · Views: 27
Last edited:

Sagenut

Expert
Licensed User
Longtime User
Your example run on both real device and emulator.
So I think that you could have some problems with B4A installation.
I would suggest to reinstall everything from zero like a first install redownloading all the needed components, from here:
https://www.b4x.com/b4a.html
Otherwise explain better if you get the error on startup or doing some actions.
 
Last edited:
Upvote 0
Top