Italian errore all'avvio della app

Nikeddy

Active Member
Licensed User
Longtime User
Salve a tutti, non capisco che problema mi sta dando:

** Activity (main) Create, isFirst = true **
Downsampling image due to lack of memory.
main_activity_create (B4A line: 48)
Activity.LoadLayout("1")
java.lang.RuntimeException: java.lang.ClassCastException: java.lang.Class cannot be cast to java.lang.reflect.ParameterizedType
at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayout(LayoutBuilder.java:170)
at anywheresoftware.b4a.objects.ActivityWrapper.LoadLayout(ActivityWrapper.java:209)
at anywheresoftware.b4a.samples.mysql.main._activity_create(main.java:412)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:186)
at anywheresoftware.b4a.samples.mysql.main.afterFirstLayout(main.java:102)
at anywheresoftware.b4a.samples.mysql.main.access$000(main.java:17)
at anywheresoftware.b4a.samples.mysql.main$WaitForLayout.run(main.java:80)
at android.os.Handler.handleCallback(Handler.java:751)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6692)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1468)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1358)
Caused by: java.lang.ClassCastException: java.lang.Class cannot be cast to java.lang.reflect.ParameterizedType
at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayoutHelper(LayoutBuilder.java:408)
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

sto impazzendo!

queste le righe di codice

PHP:
Region Module Attributes
    #FullScreen true
    #IncludeTitle True
    #ApplicationLabel Eddy
    #VersionCode 1
    #VersionName 1.0
    #SupportedOrientations portrait
#End Region

'Activity module
Sub Process_Globals
    Private COUNTRIES_LIST = countries_list,elenco = elenco As String, incassogiorno = incassogiorno As String, COUNTRY_POPULATION = country_population As String, incassotot = incassotot As String, zona = zona As String, conta = conta As String
End Sub

Sub Globals
    Type TwoLines (First As String, Second As String)
    Dim lblPopulation As Label
    Dim ListView1 As ListView
    Dim ListView2 As ListView
    Dim listview3 As ListView
    Dim lblCountry As Label
    Dim lblCountry As Label
    Dim lbl_indirizzo As Label
    Dim lbl_ubicazione As Label
    Dim lbl_incmedio As Label
    Dim lbl_frequ As Label
    Dim lbl_zona As Label
    Dim ricordamacchina As String
    Private Panel2 As Panel
    Private Panel1 As Panel
    Dim webview1 As WebView
    Private Panel3 As Panel
    Private Panel4 As Panel
    Private panel6 As Panel
    Private Label17 As Label
    Private panel5 As Panel
    Private panel7 As Panel
End Sub

Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("1")
'DateTime.DateFormat=ddMMyyyy
'DateTime.TimeFormat=HHmm
Panel1.SetLayout(0,0,100%x,100%y)
Panel2.SetLayout(0,0,100%x,100%y)
Panel3.SetLayout(0,0,100%x,100%y)
Panel4.SetLayout(0,0,100%x,100%y)
panel5.SetLayout(0,0,100%x,100%y)
panel6.SetLayout(0,0,100%x,100%y)
panel7.SetLayout(0,0,100%x,100%y)
Panel2.Visible=False
Panel4.Visible= False
Panel3.Visible=False
panel5.Visible= False
panel6.Visible= False
panel7.Visible= False
Panel1.Visible= False
FetchCountriesList
End Sub
 
Last edited:

Star-Dust

Expert
Licensed User
Longtime User
Activity.LoadLayout(1) O Activity.LoadLayout("1") ?
 

udg

Expert
Licensed User
Longtime User
Private COUNTRIES_LIST = countries_list,elenco = elenco As Strin...
Non capisco questa sintassi. Stai definendo un tipo, si tratta di un elenco di variabili ?
 
Last edited:
D

Deleted member 103

Guest
Sub Process_Globals
Private COUNTRIES_LIST = countries_list,elenco = elenco As String, incassogiorno = incassogiorno As String, COUNTRY_POPULATION = country_population As String, incassotot = incassotot As String, zona = zona As String, conta = conta As String
End Sub
e poi ti meravigli che B4a ti da errore? :(
 

LucaMs

Expert
Licensed User
Longtime User
perche? che problema ha?
Prima cosa manca il "cancelletto" nel nome della prima Region:

Region Module Attributes
#Region Module Attributes

Poi non si capiscono le DICHIARAZIONI nella Process_Globals:
Sub Process_Globals
Private COUNTRIES_LIST = countries_list,elenco = elenco As String, incassogiorno = incassogiorno As String, COUNTRY_POPULATION = country_population As String, incassotot = incassotot As String, zona = zona As String, conta = conta As String
End Sub


In quella routine (sub) devi dichiarare delle variabili ed il loro TIPO, non assegnargli dei valori (cosa che va fatta in altre routine, inizialmente nella Activity_Create).

Ad esempio:
Private lstCountries As List (oppure Public ...)

Nell'Activity_Create puoi anche scrivere lstCountries = lstQualcosa ma lstQualcosa deve essere stata già dichiarata e inizializzata.
 

Nikeddy

Active Member
Licensed User
Longtime User
** Activity (main) Create, isFirst = true **
main_activity_create (B4A line: 114)
Activity.LoadLayout ("1")
java.lang.RuntimeException: java.lang.ClassCastException: java.lang.Class cannot be cast to java.lang.reflect.ParameterizedType
at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayout(LayoutBuilder.java:170)
at anywheresoftware.b4a.objects.ActivityWrapper.LoadLayout(ActivityWrapper.java:209)
at anywheresoftware.b4a.samples.mysql.main._activity_create(main.java:507)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:186)
at anywheresoftware.b4a.samples.mysql.main.afterFirstLayout(main.java:102)
at anywheresoftware.b4a.samples.mysql.main.access$000(main.java:17)
at anywheresoftware.b4a.samples.mysql.main$WaitForLayout.run(main.java:80)
at android.os.Handler.handleCallback(Handler.java:751)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6692)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1468)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1358)
Caused by: java.lang.ClassCastException: java.lang.Class cannot be cast to java.lang.reflect.ParameterizedType
at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayoutHelper(LayoutBuilder.java:408)
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.ClassCastException: java.lang.Class cannot be cast to java.lang.reflect.ParameterizedType
** Activity (main) Resume **
** Activity (main) Pause, UserClosed = false **
 

Attachments

  • Screenshot_20180419-103555.png
    Screenshot_20180419-103555.png
    143 KB · Views: 216

Star-Dust

Expert
Licensed User
Longtime User
Manda tutto il codice che lo guardo.
Vai su menù file e seleziona esporta in formato ZIP
 

Nikeddy

Active Member
Licensed User
Longtime User
se continuo all'errore, mi dice

B4X:
java.lang.RuntimeException: java.lang.ClassCastException: java.lang.Class cannot be cast to java.lang.reflect.ParameterizedType
** Activity (main) Resume **
main_activity_keypress (B4A line: 407)
Panel3.Visible=False
java.lang.RuntimeException: Object should first be initialized (Panel).
    at anywheresoftware.b4a.AbsObjectWrapper.getObject(AbsObjectWrapper.java:50)
    at anywheresoftware.b4a.objects.ViewWrapper.setVisible(ViewWrapper.java:271)
    at anywheresoftware.b4a.samples.mysql.main._activity_keypress(main.java:612)
    at java.lang.reflect.Method.invoke(Native Method)
    at anywheresoftware.b4a.BA.raiseEvent2(BA.java:186)
    at anywheresoftware.b4a.samples.mysql.main$HandleKeyDelayed.runDirectly(main.java:228)
    at anywheresoftware.b4a.samples.mysql.main$HandleKeyDelayed.run(main.java:225)
    at android.os.Handler.handleCallback(Handler.java:751)
    at android.os.Handler.dispatchMessage(Handler.java:95)
    at android.os.Looper.loop(Looper.java:154)
    at android.app.ActivityThread.main(ActivityThread.java:6692)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1468)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1358)
 

Star-Dust

Expert
Licensed User
Longtime User
Se non stai sviluppando qualche segreto militare allora manda il codice ;)
 
Top