German Warum ist das nicht Initialisiert?

Sinan Tuzcu

Well-Known Member
Licensed User
Longtime User
Im Release läuft es aber in debug nicht. :)
 

Attachments

  • test.zip
    11.7 KB · Views: 329

DonManfred

Expert
Licensed User
Longtime User
Da fehlt eine font datei....

Logger connected to: 988ad036525346515630
--------- beginning of main
*** Service (starter) Create ***
** Service (starter) Start **
Starter.Service_Start(Intent { cmp=b4a.example.smsverify/.starter })
Starter.Service_Start()
Starter.Service_Start(null)
** Activity (main) Create, isFirst = true **
pkg: b4a.example.smsverify -- hash: YbnnsRMN+Ek
[YbnnsRMN+Ek]
** Activity (main) Resume **
SmsRetriever started. Wait for broadcast...
** Activity (main) Pause, UserClosed = false **
sending message to waiting queue (sleep)
running waiting messages (1)
** Activity (main) Resume **
Token from SMS: Code:GGFHJGEE
--------- beginning of system
** Activity (main) Pause, UserClosed = false **
** Activity (main) Resume **
** Activity (main) Pause, UserClosed = true **
** Service (starter) Destroy (ignored)**
** Activity (main) Create, isFirst = true **
java.lang.reflect.InvocationTargetException
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.DynamicBuilder.build(DynamicBuilder.java:21)
at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayoutHelper(LayoutBuilder.java:349)
at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayoutHelper(LayoutBuilder.java:454)
at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayoutHelper(LayoutBuilder.java:454)
at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayout(LayoutBuilder.java:148)
at anywheresoftware.b4a.objects.PanelWrapper.LoadLayout(PanelWrapper.java:134)
at KCSoft.ScrollViewBigPanel.main._activity_create(main.java:396)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:196)
at KCSoft.ScrollViewBigPanel.main.afterFirstLayout(main.java:104)
at KCSoft.ScrollViewBigPanel.main.access$000(main.java:17)
at KCSoft.ScrollViewBigPanel.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:214)
at android.app.ActivityThread.main(ActivityThread.java:7045)
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:964)
Caused by: java.lang.RuntimeException: Font asset not found opensans-semibold.ttf
at android.graphics.Typeface.createFromAsset(Typeface.java:947)
at anywheresoftware.b4a.keywords.constants.TypefaceWrapper.LoadFromAssets(TypefaceWrapper.java:48)
at anywheresoftware.b4a.objects.TextViewWrapper.build(TextViewWrapper.java:180)
at anywheresoftware.b4a.objects.LabelWrapper.build(LabelWrapper.java:36)
... 20 more
main_activity_create (java line: 396)
java.lang.RuntimeException: java.lang.RuntimeException: Object should first be initialized (Label).
at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayout(LayoutBuilder.java:170)
at anywheresoftware.b4a.objects.PanelWrapper.LoadLayout(PanelWrapper.java:134)
at KCSoft.ScrollViewBigPanel.main._activity_create(main.java:396)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:196)
at KCSoft.ScrollViewBigPanel.main.afterFirstLayout(main.java:104)
at KCSoft.ScrollViewBigPanel.main.access$000(main.java:17)
at KCSoft.ScrollViewBigPanel.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:214)
at android.app.ActivityThread.main(ActivityThread.java:7045)
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:964)
Caused by: java.lang.RuntimeException: Object should first be initialized (Label).
at anywheresoftware.b4a.AbsObjectWrapper.getObject(AbsObjectWrapper.java:50)
at anywheresoftware.b4a.objects.ViewWrapper.innerInitialize(ViewWrapper.java:73)
at anywheresoftware.b4a.objects.LabelWrapper.innerInitialize(LabelWrapper.java:28)
at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayoutHelper(LayoutBuilder.java:435)
at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayoutHelper(LayoutBuilder.java:454)
at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayoutHelper(LayoutBuilder.java:454)
at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayout(LayoutBuilder.java:148)
... 14 more
java.lang.RuntimeException: java.lang.RuntimeException: Object should first be initialized (Label).
** Activity (main) Pause, UserClosed = false **
** Activity (main) Resume **
 

Sinan Tuzcu

Well-Known Member
Licensed User
Longtime User
Ich habe nun den Code soweit gekürzt, aber de möchte immer noch ne Initialisierung.
 

Attachments

  • test.zip
    32.9 KB · Views: 321

DonManfred

Expert
Licensed User
Longtime User
Ich habe nun den Code soweit gekürzt, aber de möchte immer noch ne Initialisierung.
Du hast aber schon den Hinweis in dem Thread von der SlidingMenu library gelesen?
The open source project is no longer maintained and there are compatibility issues with newer versions of Android. It is recommended to use B4XDrawer instead.
 

Sinan Tuzcu

Well-Known Member
Licensed User
Longtime User
Das ist mir bewusst.
B4XDrawer war mein erster Versuch.

Das Problem bei B4XDrawer ist, der kann den unteren Haupt-Layout nicht nach rechts verschieben.
Stattdessen wird das Left Menue als Over Top von links auf den Haupt-Layout rein gefahren.
Und wenn man sogar auf dem Haupt-Layout dynamisch geladene Elemente hat, liegt das Left-Menue unter der dyn. Elemente.
Und da gibt es keine Elevator Einstellungen, noch gibt es Z-Order Eingabe.

Es sei denn du kennst da einen Trick.
Hatte ich bereits in einen Anderen Thread erwähnt.
https://www.b4x.com/android/forum/threads/slidemenue-b4xdrawer.103140/#post-647419

upload_2019-3-7_19-58-21.png
 

Attachments

  • upload_2019-3-7_19-58-11.png
    upload_2019-3-7_19-58-11.png
    130.3 KB · Views: 274

Sinan Tuzcu

Well-Known Member
Licensed User
Longtime User
Zurück zum Haupt Problem.

Das mit dem Slide-Menue funktioniert erstmal auch wenn dafür keinen Support mehr geben wird.
Und auch in Relase Modus läuft es auf dem Smartphone.
Mich stört es aber trotzdem, wenn ich in Debug-Modus ständig Errors bekommen.

So wie in diesem Fall:

Logger verbunden mit: Sony G8141
--------- beginning of main
Copying updated assets files (3)
** Activity (main) Create, isFirst = true **
Error occurred on line: 77 (Main)
java.lang.RuntimeException: java.lang.RuntimeException: Object should first be initialized (Label).
at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayout(LayoutBuilder.java:170)
at anywheresoftware.b4a.objects.PanelWrapper.LoadLayout(PanelWrapper.java:134)
at KCSoft.ScrollViewBigPanel.main._activity_create(main.java:441)
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 KCSoft.ScrollViewBigPanel.main.afterFirstLayout(main.java:104)
at KCSoft.ScrollViewBigPanel.main.access$000(main.java:17)
at KCSoft.ScrollViewBigPanel.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:280)
at android.app.ActivityThread.main(ActivityThread.java:6706)
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.RuntimeException: Object should first be initialized (Label).
at anywheresoftware.b4a.AbsObjectWrapper.getObject(AbsObjectWrapper.java:50)
at anywheresoftware.b4a.objects.ViewWrapper.innerInitialize(ViewWrapper.java:73)
at anywheresoftware.b4a.objects.LabelWrapper.innerInitialize(LabelWrapper.java:28)
at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayoutHelper(LayoutBuilder.java:435)
at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayoutHelper(LayoutBuilder.java:454)
at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayoutHelper(LayoutBuilder.java:454)
at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayout(LayoutBuilder.java:148)
... 18 more
** Activity (main) Resume **

Obwohl alles initialisiert sind.

B4X:
#Region Module Attributes
    #FullScreen: False
    #IncludeTitle: True
    #ApplicationLabel: ScrollViewBigPanel
    #VersionCode: 1
    #VersionName:
    #SupportedOrientations: unspecified
    #CanInstallToExternalStorage: False
#End Region

'Activity module
Sub Process_Globals
    'These global variables will be declared once when the application starts.
    'These variables can be accessed from all modules.

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.
    
    
    '########### SLIDE Menue ############
    Private sm As SlidingMenu
    Private ic1Menu As ImageView
    Private ic2Menu As ImageView
    Private ic3Menu As ImageView
    Private ic4Menu As ImageView
    Private ic5Menu As ImageView
    Private ic6Menu As ImageView
    Private btactionmenu As ImageView
    Private lb1Menu As Label
    Private lb2Menu As Label
    Private lb3Menu As Label
    Private lb4Menu As Label
    Private lb5Menu As Label
    Private lb6Menu As Label
    Private pArka01Menue As Panel
    Private pArka02Menue As Panel
    Private pArka03Menue As Panel
    Private pArka04Menue As Panel
    Private pArka05Menue As Panel
    Private pArka06Menue As Panel
    Private lbProfilInfo As Label

    Private ScrollView3 As ScrollView
    Private Panel1 As Panel
    '#####################################
    
    Private btnCreateConnection As Button
    Private btnInput As Button
    Private btnOutput As Button
    Private btnSettings As Button
    Private btnSwitchALLOFF As Button
    Private btnSwitchALLON As Button
    Private pArka01BeyazMenue As Panel
    Private pArka02BeyazMenue As Panel
    Private pArka03BeyazMenue As Panel
    Private pArka04BeyazMenue As Panel
    Private pArka05BeyazMenue As Panel
    Private pArka06BeyazMenue As Panel
    Private lbEmailMenu As Label
    Private lbNamen_Kurzel As Label
    Private pRedondoMenu As Panel
    Private pVerdeMenu As Panel
End Sub

Sub Activity_Create(FirstTime As Boolean)
    
    Activity.LoadLayout("main")
    
    '####################### SLIDE MENUE #############################
    sm.Initialize("sm")
    Dim offset As Int = 22%x
    sm.BehindOffset = offset
    sm.Mode = sm.LEFT
    sm.Menu.LoadLayout("LM_Input_Output")
    
        
    Dim jo As JavaObject = sm

    Dim Gradient1 As GradientDrawable
    Dim Clrs(2) As Int
    Clrs(0) = Colors.ARGB(0,0,0,0)
    Clrs(1) = Colors.ARGB(50,0,0,0)
    Gradient1.Initialize("LEFT_RIGHT", Clrs)
    jo.RunMethod("setShadowDrawable", Array(Gradient1))
    jo.RunMethod("setShadowWidth", Array(4%x))
    
    'Vorbereitung der Menütasten
    Dim jo As JavaObject = sm
    jo.RunMethod("setTouchmodeMarginThreshold", Array(50%x))
    
    'Wir machen die Veranstaltung zum Öffnen (wissen, wann das Menü geöffnet ist)
    Dim jo2 As JavaObject = sm
    Dim event As Object = jo2.CreateEventFromUI("com.jeremyfeinstein.slidingmenu.lib.SlidingMenu$OnOpenListener", "Open", Null)
    jo2.RunMethod("setOnOpenListener", Array(event))


    'WIR WÄHLEN DAS SCHLIESSENDE EREIGNIS (WISSEN, WENN DAS MENÜ GEÖFFNET IST)
    Dim jo3 As JavaObject = sm
    Dim event As Object = jo3.CreateEventFromUI("com.jeremyfeinstein.slidingmenu.lib.SlidingMenu$OnCloseListener", "Close", Null)
    jo3.RunMethod("setOnCloseListener", Array(event))
    
    
    ScrollView3.Panel.LoadLayout("ScrollviewLayout")
    ScrollView3.Panel.Height = Panel1.Height
    
    ICONS_Laden
        
    '#################################################################
    
End Sub


Sub ICONS_Laden
    AjustaImageView(btactionmenu,File.DirAssets,"menu.png")
    AjustaImageView(ic1Menu,File.DirAssets,"menu.png")
    AjustaImageView(ic2Menu,File.DirAssets,"menu.png")
    AjustaImageView(ic3Menu,File.DirAssets,"menu.png")
    AjustaImageView(ic4Menu,File.DirAssets,"menu.png")
    AjustaImageView(ic5Menu,File.DirAssets,"menu.png")
    AjustaImageView(ic6Menu,File.DirAssets,"menu.png")

    Schriftarten_Laden
End Sub

Sub AjustaImageView(Imv As ImageView, Dir As String, FileName As String)
    Private bmp As Bitmap = LoadBitmap(Dir, FileName)
    Dim Delta, Height, Width As Int
    If bmp.Width / bmp.Height > Imv.Width / Imv.Height Then
        Height = bmp.Height / bmp.Width * Imv.Width
        Delta = (Imv.Height - Height) / 2
        Imv.Height = Height
        Imv.Top = Imv.Top + Delta
    Else
        Width = bmp.Width / bmp.Height * Imv.Height
        Delta = (Imv.Width - Width) / 2
        Imv.Width = Width
        Imv.Left = Imv.Left + Delta
    End If
    Imv.Gravity = Gravity.FILL
    Imv.Bitmap = bmp
End Sub

Sub Schriftarten_Laden
    Private cs As CSBuilder
    cs.Initialize
    cs.Append("Test").Size(20).Bold.Append(",").PopAll
    cs.Append(CRLF).PopAll
    cs.Append("Mustermann").Size(10).Bold.PopAll
    lbProfilInfo.Text = cs
End Sub
Sub Activity_Resume

End Sub

Sub Activity_Pause (UserClosed As Boolean)

End Sub
 

OliverA

Expert
Licensed User
Longtime User
Top