I have a tablet pc .
One compile and run the code. Generate at log this but run well.
Class not found: b4a.example3.miedit, trying: MiEdit.com.miedit
Class not found: b4a.example3.miedit, trying: MiEdit.com.miedit
The other pc with same version of B4A generate error and crash,
Only when run in release mode, when use debug mode the same app run in my phone.
I don't understand java to find the solution,
And why work in debug but not in release mode.
Thanks.
Crash error log:
Main:
Custom View Class:
One compile and run the code. Generate at log this but run well.
Class not found: b4a.example3.miedit, trying: MiEdit.com.miedit
Class not found: b4a.example3.miedit, trying: MiEdit.com.miedit
The other pc with same version of B4A generate error and crash,
Only when run in release mode, when use debug mode the same app run in my phone.
I don't understand java to find the solution,
And why work in debug but not in release mode.
Thanks.
Crash error log:
HTML:
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
Class not found: b4a.example3.miedit, trying: MiEdit.com.miedit
Class not found: b4a.example3.miedit, trying: MiEdit.com.miedit
main_activity_create (java line: 345)
java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayout(LayoutBuilder.java:170)
at anywheresoftware.b4a.objects.ActivityWrapper.LoadLayout(ActivityWrapper.java:209)
at MiEdit.com.main._activity_create(main.java:345)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:186)
at MiEdit.com.main.afterFirstLayout(main.java:104)
at MiEdit.com.main.access$000(main.java:17)
at MiEdit.com.main$WaitForLayout.run(main.java:82)
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.reflect.InvocationTargetException
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.objects.CustomViewWrapper.AfterDesignerScript(CustomViewWrapper.java:64)
at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayout(LayoutBuilder.java:162)
... 14 more
Caused by: java.lang.RuntimeException: Font asset not found b4x_fontawesome.otf
at android.graphics.Typeface.createFromAsset(Typeface.java:284)
at anywheresoftware.b4a.objects.TextViewWrapper.getTypeface(TextViewWrapper.java:155)
at anywheresoftware.b4a.keywords.constants.TypefaceWrapper.getFONTAWESOME(TypefaceWrapper.java:52)
at MiEdit.com.miedit._initialize(miedit.java:164)
... 17 more
Main:
B4X:
#Region Project Attributes
#ApplicationLabel: B4A Example
#VersionCode: 1
#VersionName:
'SupportedOrientations possible values: unspecified, landscape or portrait.
#SupportedOrientations: unspecified
#CanInstallToExternalStorage: False
#BridgeLogger:True
#End Region
#Region Activity Attributes
#FullScreen: False
#IncludeTitle: false
#End Region
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.
Private MiEdit1 As MiEdit
Private MiEdit2 As MiEdit
End Sub
Sub Activity_Create(FirstTime As Boolean)
'Do not forget to load the layout file created with the visual designer. For example:
Activity.LoadLayout("1")
End Sub
Sub Activity_Click
End Sub
Sub Activity_Resume
End Sub
Custom View Class:
B4X:
#Event: MePica (txt as String)
'#DesignerProperty: Key: BooleanExample, DisplayName: Boolean Example, FieldType: Boolean, DefaultValue: True, Description: Example of a boolean property.
'#DesignerProperty: Key: IntExample, DisplayName: Int Example, FieldType: Int, DefaultValue: 10, MinRange: 0, MaxRange: 100, Description: Note that MinRange and MaxRange are optional.
'#DesignerProperty: Key: StringWithListExample, DisplayName: String With List, FieldType: String, DefaultValue: Sunday, List: Sunday|Monday|Tuesday|Wednesday|Thursday|Friday|Saturday
'#DesignerProperty: Key: StringExample, DisplayName: String Example, FieldType: String, DefaultValue: Text
#DesignerProperty: Key: ColorExample, DisplayName: Color Example, FieldType: Color, DefaultValue: 0xFFCFDCDC, Description: You can use the built-in color picker to find the color values.
#DesignerProperty: Key: DefaultColorExample, DisplayName: Default Color Example, FieldType: Color, DefaultValue: Null, Description: Setting the default value to Null means that a nullable field will be displayed.
'#DesignerProperty: Key: XXX, DisplayName: XXX, FieldType: XXX, DefaultValue: XXX, Description: XXX
Sub Class_Globals
Private mEventName As String
Private mCallBack As Object
Private mBase As B4XView
'Private xui As XUI
Private Const DefaultColorConstant As Int = -984833 'ignore
Private Button2 As B4XView
Private Label1 As B4XView
Private EditText1 As B4XView
Private CheckBox11 As B4XView
End Sub
Public Sub Initialize (CallBack As Object, EventName As String)
mEventName = EventName
mCallBack = CallBack
Dim df As EditText
df.Initialize("EditText1")
df.SingleLine = True
df.TextColor=Colors.Green
Dim b As Button
b.Initialize("Button2")
b.Typeface = Typeface.FONTAWESOME
b.TextColor=Colors.Blue
b.Text="BT"
Dim l As Label
l.Initialize("Label1")
l.Gravity=Gravity.CENTER_VERTICAL
l.TextColor=0xFFC55663
Dim t As CheckBox
t.Initialize("CheckBox11")
t.Checked=True
t.Text=""
EditText1=df
Button2=b
Label1=l
CheckBox11=t
End Sub
Public Sub DesignerCreateView (Base As Panel, Lbl As Label, Props As Map)
mBase = Base
mBase.AddView(Label1, 0%x, 0%y, mBase.Width*.8, mBase.Height/2)
mBase.AddView(Button2, mBase.Width*.8, 0%y, mBase.Width*.2, mBase.Height/2)
mBase.AddView(EditText1, 0%x, mBase.Height/2, mBase.Width*.6, mBase.Height/2)
mBase.AddView(CheckBox11, mBase.Width*.6, mBase.Height/2, mBase.Width*.4, mBase.Height/2)
Label1.Text=""
EditText1.Text=""
mBase.Color= Props.Get("ColorExample")
Label1.TextColor = Props.Get("DefaultColorExample")
End Sub
Public Sub GetBase As Panel
Return mBase
End Sub
private Sub EditText1_TextChanged (Old As String, New As String)
Label1.Text=New
If IsNumber(New) Then
Label1.Text=New*2
Else
Label1.Text="N/A"
End If
End Sub
private Sub Button2_Click
CallSub2(mCallBack, mEventName & "_MePica", Label1.Text)
Log(mCallBack)
Log(mEventName)
End Sub
private Sub EditText1_EnterPressed
Log("Enter")
End Sub
private Sub EditText1_FocusChanged (HasFocus As Boolean)
Log("Focus"&HasFocus)
End Sub
private Sub Label1_Click
Log("LC")
End Sub
private Sub Label1_LongClick
Log("LLC")
End Sub
private Sub Button2_LongClick
EditText1.Text="0"
End Sub
Sub CheckBox11_CheckedChange(Checked As Boolean)
End Sub