Android Question Error example NavigationView

Jose Illescas

New Member
Hello everyone. Really this tool is great for development. Best regards for the devolpers. I’m newbie in this tool.
I trying to run the example. The project is up in google drive.Test app. I’m debugging and after installing crash with this error. Somebody can point me what error is?

This is the log:
Registo conectado a: emulator-5554

--------- beginning of system

--------- beginning of main

*** Service (starter) Create ***

** Service (starter) Start **

** Activity (main) Create, isFirst = true **

** Activity (main) Resume **

** Activity (main) Pause, UserClosed = true **

** Service (starter) Destroy (ignored)**

*** Service (starter) Create ***

** Service (starter) Start **

** Activity (main) Create, isFirst = true **

** Activity (main) Resume **

** Activity (main) Pause, UserClosed = true **

** Service (starter) Destroy (ignored)**

*** Service (starter) Create ***

** Service (starter) Start **

** Activity (main) Create, isFirst = true **

** Activity (main) Resume **

** Activity (main) Pause, UserClosed = true **

*** Service (starter) Create ***

** Service (starter) Start **

** Activity (main) Create, isFirst = true **

** Activity (main) Resume **

Clicked: cart

** Activity (main) Pause, UserClosed = true **

** Service (starter) Destroy (ignored)**

*** Service (starter) Create ***

:null,0

java.lang.RuntimeException: Unexpected command: 97

at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:426)

at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255)

at java.lang.reflect.Method.invoke(Native Method)

at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:144)

at example.navigationview.main.afterFirstLayout(main.java:104)

at example.navigationview.main.access$000(main.java:17)

at example.navigationview.main$WaitForLayout.run(main.java:82)

at android.os.Handler.handleCallback(Handler.java:873)

at android.os.Handler.dispatchMessage(Handler.java:99)

at android.os.Looper.loop(Looper.java:193)

at android.app.ActivityThread.main(ActivityThread.java:6669)

at java.lang.reflect.Method.invoke(Native Method)

at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)

at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)

** Activity (main) Resume **

** Activity (main) Pause, UserClosed = true **

:null,0

java.lang.RuntimeException: Unexpected command: 97

at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:426)

at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255)

at java.lang.reflect.Method.invoke(Native Method)

at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:144)

at example.navigationview.main.afterFirstLayout(main.java:104)

at example.navigationview.main.access$000(main.java:17)

at example.navigationview.main$WaitForLayout.run(main.java:82)

at android.os.Handler.handleCallback(Handler.java:873)

at android.os.Handler.dispatchMessage(Handler.java:99)

at android.os.Looper.loop(Looper.java:193)

at android.app.ActivityThread.main(ActivityThread.java:6669)

at java.lang.reflect.Method.invoke(Native Method)

at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)

at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)

** Activity (main) Resume **

** Activity (main) Pause, UserClosed = true **

java.lang.NoClassDefFoundError: Failed resolution of: Landroid/support/v4/view/PagerAdapter;

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.shell.Shell.getCorrectClassName(Shell.java:624)

at anywheresoftware.b4a.shell.Shell.createObject(Shell.java:611)

at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:366)

at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255)

at java.lang.reflect.Method.invoke(Native Method)

at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:144)

at example.navigationview.main.initializeGlobals(main.java:320)

at example.navigationview.main.afterFirstLayout(main.java:101)

at example.navigationview.main.access$000(main.java:17)

at example.navigationview.main$WaitForLayout.run(main.java:82)

at android.os.Handler.handleCallback(Handler.java:873)

at android.os.Handler.dispatchMessage(Handler.java:99)

at android.os.Looper.loop(Looper.java:193)

at android.app.ActivityThread.main(ActivityThread.java:6669)

at java.lang.reflect.Method.invoke(Native Method)

at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)

at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)

Caused by: java.lang.ClassNotFoundException: Didn't find class "android.support.v4.view.PagerAdapter" on path: DexPathList[[zip file "/system/framework/org.apache.http.legacy.boot.jar", zip file "/data/app/example.navigationview-c9l6afvE3X13rGlFZjtLzw==/base.apk"],nativeLibraryDirectories=[/data/app/example.navigationview-c9l6afvE3X13rGlFZjtLzw==/lib/x86_64, /system/lib64]]

at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:134)

at java.lang.ClassLoader.loadClass(ClassLoader.java:379)

at java.lang.ClassLoader.loadClass(ClassLoader.java:312)

... 20 more

** Activity (main) Create, isFirst = true **

:null,0

java.lang.RuntimeException: Unexpected command: 0

at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:426)

at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255)

at java.lang.reflect.Method.invoke(Native Method)

at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:144)

at example.navigationview.main.afterFirstLayout(main.java:104)

at example.navigationview.main.access$000(main.java:17)

at example.navigationview.main$WaitForLayout.run(main.java:82)

at android.os.Handler.handleCallback(Handler.java:873)

at android.os.Handler.dispatchMessage(Handler.java:99)

at android.os.Looper.loop(Looper.java:193)

at android.app.ActivityThread.main(ActivityThread.java:6669)

at java.lang.reflect.Method.invoke(Native Method)

at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)

at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)

:null,0

** Activity (main) Create, isFirst = true **

Error occurred on line: 54 (Main)

java.lang.RuntimeException: java.lang.NoSuchMethodException: _initialize [class anywheresoftware.b4a.BA, class java.lang.Object, class java.lang.String]

at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayout(LayoutBuilder.java:170)

at anywheresoftware.b4a.objects.ActivityWrapper.LoadLayout(ActivityWrapper.java:209)

at example.navigationview.main._activity_create(main.java:402)

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:144)

at example.navigationview.main.afterFirstLayout(main.java:104)

at example.navigationview.main.access$000(main.java:17)

at example.navigationview.main$WaitForLayout.run(main.java:82)

at android.os.Handler.handleCallback(Handler.java:873)

at android.os.Handler.dispatchMessage(Handler.java:99)

at android.os.Looper.loop(Looper.java:193)

at android.app.ActivityThread.main(ActivityThread.java:6669)

at java.lang.reflect.Method.invoke(Native Method)

at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)

at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)

Caused by: java.lang.NoSuchMethodException: _initialize [class anywheresoftware.b4a.BA, class java.lang.Object, class java.lang.String]

at java.lang.Class.getMethod(Class.java:2068)

at java.lang.Class.getMethod(Class.java:1690)

at anywheresoftware.b4a.objects.CustomViewWrapper.AfterDesignerScript(CustomViewWrapper.java:64)

at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayout(LayoutBuilder.java:162)

... 18 more

** Activity (main) Resume **

** Activity (main) Create, isFirst = true **

Error occurred on line: 54 (Main)

java.lang.RuntimeException: java.lang.NoSuchMethodException: _initialize [class anywheresoftware.b4a.BA, class java.lang.Object, class java.lang.String]

at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayout(LayoutBuilder.java:170)

at anywheresoftware.b4a.objects.ActivityWrapper.LoadLayout(ActivityWrapper.java:209)

at example.navigationview.main._activity_create(main.java:402)

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:144)

at example.navigationview.main.afterFirstLayout(main.java:104)

at example.navigationview.main.access$000(main.java:17)

at example.navigationview.main$WaitForLayout.run(main.java:82)

at android.os.Handler.handleCallback(Handler.java:873)

at android.os.Handler.dispatchMessage(Handler.java:99)

at android.os.Looper.loop(Looper.java:193)

at android.app.ActivityThread.main(ActivityThread.java:6669)

at java.lang.reflect.Method.invoke(Native Method)

at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)

at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)

Caused by: java.lang.NoSuchMethodException: _initialize [class anywheresoftware.b4a.BA, class java.lang.Object, class java.lang.String]

at java.lang.Class.getMethod(Class.java:2068)

at java.lang.Class.getMethod(Class.java:1690)

at anywheresoftware.b4a.objects.CustomViewWrapper.AfterDesignerScript(CustomViewWrapper.java:64)

at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayout(LayoutBuilder.java:162)

... 18 more

** Activity (main) Resume **

** Activity (main) Create, isFirst = true **

Error occurred on line: 54 (Main)

java.lang.RuntimeException: java.lang.NoSuchMethodException: _initialize [class anywheresoftware.b4a.BA, class java.lang.Object, class java.lang.String]

at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayout(LayoutBuilder.java:170)

at anywheresoftware.b4a.objects.ActivityWrapper.LoadLayout(ActivityWrapper.java:209)

at example.navigationview.main._activity_create(main.java:402)

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:144)

at example.navigationview.main.afterFirstLayout(main.java:104)

at example.navigationview.main.access$000(main.java:17)

at example.navigationview.main$WaitForLayout.run(main.java:82)

at android.os.Handler.handleCallback(Handler.java:873)

at android.os.Handler.dispatchMessage(Handler.java:99)

at android.os.Looper.loop(Looper.java:193)

at android.app.ActivityThread.main(ActivityThread.java:6669)

at java.lang.reflect.Method.invoke(Native Method)

at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)

at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)

Caused by: java.lang.NoSuchMethodException: _initialize [class anywheresoftware.b4a.BA, class java.lang.Object, class java.lang.String]

at java.lang.Class.getMethod(Class.java:2068)

at java.lang.Class.getMethod(Class.java:1690)

at anywheresoftware.b4a.objects.CustomViewWrapper.AfterDesignerScript(CustomViewWrapper.java:64)

at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayout(LayoutBuilder.java:162)

... 18 more

** Activity (main) Resume **

*** Service (starter) Create ***

** Service (starter) Start **

** Activity (main) Create, isFirst = true **

** Activity (main) Resume **

O MENU FOI ABERTO

O MENU FOI FECHADO

O MENU FOI ABERTO

** Activity (main) Pause, UserClosed = true **

** Service (starter) Destroy (ignored)**

** Activity (main) Create, isFirst = true **

Error occurred on line: 54 (Main)

java.lang.RuntimeException: java.lang.NoSuchMethodException: _initialize [class anywheresoftware.b4a.BA, class java.lang.Object, class java.lang.String]

at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayout(LayoutBuilder.java:170)

at anywheresoftware.b4a.objects.ActivityWrapper.LoadLayout(ActivityWrapper.java:209)

at example.navigationview.main._activity_create(main.java:402)

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:144)

at example.navigationview.main.afterFirstLayout(main.java:104)

at example.navigationview.main.access$000(main.java:17)

at example.navigationview.main$WaitForLayout.run(main.java:82)

at android.os.Handler.handleCallback(Handler.java:873)

at android.os.Handler.dispatchMessage(Handler.java:99)

at android.os.Looper.loop(Looper.java:193)

at android.app.ActivityThread.main(ActivityThread.java:6669)

at java.lang.reflect.Method.invoke(Native Method)

at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)

at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)

Caused by: java.lang.NoSuchMethodException: _initialize [class anywheresoftware.b4a.BA, class java.lang.Object, class java.lang.String]

at java.lang.Class.getMethod(Class.java:2068)

at java.lang.Class.getMethod(Class.java:1690)

at anywheresoftware.b4a.objects.CustomViewWrapper.AfterDesignerScript(CustomViewWrapper.java:64)

at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayout(LayoutBuilder.java:162)

... 18 more

** Activity (main) Resume **

** Activity (main) Create, isFirst = true **

Error occurred on line: 54 (Main)

java.lang.RuntimeException: java.lang.NoSuchMethodException: _initialize [class anywheresoftware.b4a.BA, class java.lang.Object, class java.lang.String]

at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayout(LayoutBuilder.java:170)

at anywheresoftware.b4a.objects.ActivityWrapper.LoadLayout(ActivityWrapper.java:209)

at example.navigationview.main._activity_create(main.java:402)

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:144)

at example.navigationview.main.afterFirstLayout(main.java:104)

at example.navigationview.main.access$000(main.java:17)

at example.navigationview.main$WaitForLayout.run(main.java:82)

at android.os.Handler.handleCallback(Handler.java:873)

at android.os.Handler.dispatchMessage(Handler.java:99)

at android.os.Looper.loop(Looper.java:193)

at android.app.ActivityThread.main(ActivityThread.java:6669)

at java.lang.reflect.Method.invoke(Native Method)

at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)

at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)

Caused by: java.lang.NoSuchMethodException: _initialize [class anywheresoftware.b4a.BA, class java.lang.Object, class java.lang.String]

at java.lang.Class.getMethod(Class.java:2068)

at java.lang.Class.getMethod(Class.java:1690)

at anywheresoftware.b4a.objects.CustomViewWrapper.AfterDesignerScript(CustomViewWrapper.java:64)

at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayout(LayoutBuilder.java:162)

... 18 more

** Activity (main) Resume **
 

Alexander Stolte

Expert
Licensed User
Please use
B4X:
code here...
tags when posting code.
Step 1:
1582035501345.png

Step 2:
1582035534055.png
 
Upvote 0

Jose Illescas

New Member
Thanks Erel and Alexander for the information.
I'm debugging this app. In line 54 i get error

Main:
#Region  Project Attributes
    #ApplicationLabel: PMT Online
    #VersionCode: 1
    #VersionName: 1.00
    'SupportedOrientations possible values: unspecified, landscape or portrait.
    #SupportedOrientations: unspecified
    #CanInstallToExternalStorage: False
#End Region

'#AdditionalRes: "..\resource"
#Extends: android.support.v7.app.AppCompatActivity

#Region  Activity Attributes
    #FullScreen: False
    #IncludeTitle: True
#End Region

Sub Process_Globals
    'These global variables will be declared once when the application starts.
    'These variables can be accessed from all modules.
    Public slogin As Int
    Public sagente As Int
    Public snomage As String

End Sub

Sub Globals
    'These global variables will be redeclared each time the activity is created.
    'These variables can only be accessed from this module.

    Private VP As AHViewPager
    'Private PC As AHPageContainer
    Private TabLayout As DSTabLayout
    Private ToolBar As ACToolBarLight
    
    Private NavDrawer As DSNavigationDrawer
    'Private Switch As ACSwitch
'    Private HeaderLabel As Label
    
    Dim ImageView1 As ImageView
End Sub

#Region Activity Events
Sub Activity_Create(FirstTime As Boolean)
    Dim xml As XmlLayoutBuilder

    'Initialize the NavDrawer object. This modifies the internal Layout structure of your Activity
    'and adds the Navigationdrawer.
    'Attention: THIS HAS TO BE DONE BEFORE LOADING A LAYOUT TO THE ACTIVITY!
    NavDrawer.Initialize2("NavDrawer", Activity, NavDrawer.DefaultDrawerWidth, NavDrawer.GRAVITY_START)

    'You can still load your normal layout to the Activity.
 
 Activity.LoadLayout("layout1")
 
    ImageView1.Visible=True
    ImageView1.Height = 640dip
    ImageView1.Width = 320dip
    ImageView1.Left = 60dip


and this is the log :

Log:
--------- beginning of main
--------- beginning of main
Copying updated assets files (4)
** Activity (main) Create, isFirst = true **
Error occurred on line: 54 (Main)
java.lang.RuntimeException: java.lang.NoSuchMethodException: _initialize [class anywheresoftware.b4a.BA, class java.lang.Object, class java.lang.String]
    at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayout(LayoutBuilder.java:170)
    at anywheresoftware.b4a.objects.ActivityWrapper.LoadLayout(ActivityWrapper.java:209)
    at example.navigationview.main._activity_create(main.java:399)
    at java.lang.reflect.Method.invoke(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:372)
    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 java.lang.reflect.Method.invoke(Method.java:372)
    at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:144)
    at example.navigationview.main.afterFirstLayout(main.java:104)
    at example.navigationview.main.access$000(main.java:17)
    at example.navigationview.main$WaitForLayout.run(main.java:82)
    at android.os.Handler.handleCallback(Handler.java:815)
    at android.os.Handler.dispatchMessage(Handler.java:104)
    at android.os.Looper.loop(Looper.java:194)
    at android.app.ActivityThread.main(ActivityThread.java:5682)
    at java.lang.reflect.Method.invoke(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:372)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:963)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:758)
Caused by: java.lang.NoSuchMethodException: _initialize [class anywheresoftware.b4a.BA, class java.lang.Object, class java.lang.String]
    at java.lang.Class.getMethod(Class.java:664)
    at java.lang.Class.getMethod(Class.java:643)
    at anywheresoftware.b4a.objects.CustomViewWrapper.AfterDesignerScript(CustomViewWrapper.java:64)
    at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayout(LayoutBuilder.java:162)
    ... 21 more
** Activity (main) Resume **

Can any point me to any direction? Thanks in advance.
B4a version: 9.80
Project attachment.
 

Attachments

  • NavigationView.zip
    76.1 KB · Views: 75
Upvote 0
Top